#avr | Logs for 2013-05-23

Back
[02:31:54] <rue_house> anyone have a fav piece of code for inputting a value from a serial port from 0 to 65535 via ascii?
[02:34:36] <theBear> not really, but i suppose i'd go with treating two bytes as a single 16bit value (unless you mean avoiding non-characters) ... oh, you mean inputting a decimal number ?
[02:55:32] <Grievar> rue_house: IMO if you're doing text->number conversion on your microcontroller you're doing it wrong
[02:55:50] <rue_house> I'm using human firendly
[02:55:56] <Grievar> what does that mean
[02:56:04] <rue_house> oh good point I'll do it hexdec
[02:56:21] <rue_house> it means you can open a serial terminal program and operate the device
[02:58:20] <Grievar> rue_house: inp = beginning_of_buffer; output_number = 0; while ((*inp <= '9') && (*inp >= '0') && (inp < end_of_buffer)) { output_number = (output_number * 10) + (*inp - '0'); inp++ }
[02:58:29] <Grievar> (inp is a char *, output_number is an int)
[02:58:50] <rue_house> no buffering for me tho
[02:59:04] <Grievar> oh, well the modification there is obvious
[02:59:20] <rue_house> :)
[03:00:29] <Grievar> int output_number = 0; char c; c = character_from_serial(); while ((c <= '9') && (c >= '0')) { output_number *= 10; output_number += (c - '0'); c = character_from_serial(); }
[03:00:37] <rue_house> } else if (isDigit(command)) {
[03:00:37] <rue_house> number *= 10;
[03:00:38] <rue_house> number += command - '0';
[03:00:39] <Grievar> you get the idea
[03:03:03] <rue_house> hack of the decade
[03:04:03] <rue_house> http://paste.debian.net/5929/
[03:06:31] * rue_house fixes comments to match code
[03:16:51] <specing> rue_house: there are too many comments in your code
[03:17:06] <rue_house> hahaha
[03:17:13] <rue_house> you must work on open source projects
[03:18:33] <specing> e.g. you went with FOR and BAK constants and have to write comments on each line what they do
[03:18:51] <specing> you could have went with FORWARD and BACKWARD and it would have been obvious
[03:18:58] <rue_house> I dont have to, i just do
[03:19:29] <rue_house> I'v leanred to write comments in such a way as that I can firgure out what my code does years later
[03:23:41] <Roklobsta> it helps to not swear. i have inherited code from workers where the comments no longer match the code.
[03:29:44] <beaky> hello
[03:30:00] <beaky> How do you write a program?
[03:30:10] <theBear> i open a text editor and wiggle my fingers for a while
[03:30:23] <theBear> then after stretching, i type
[03:31:08] <beaky> Ah sorry I meant how do you design a program*
[03:31:56] <beaky> My professor said that the majority of avr apps can be modelled through Finite State Automata
[03:32:10] <beaky> how do you that kind of thing?
[03:32:37] <theBear> i'm not the state machine expert, and i disagree with your crazy prof, but there are experts here
[03:32:44] <theBear> then again, he probably shoulda taught you that by now
[03:33:12] <Roklobsta> i am working on a state machine now.
[03:33:17] <beaky> ah; so there are alternatives to using finite state automata?
[03:33:31] <specing> state machines are good
[03:33:36] <beaky> Roklobsta: wow how do you come up with state machines?
[03:33:36] <specing> *on FPGAs
[03:33:38] <theBear> state machine = finite state automata
[03:33:51] <Roklobsta> it's nifty. i have a state context. a table of pointers function for the state functions.
[03:34:01] <Roklobsta> i designed it using a pencil.
[03:34:13] <Roklobsta> i drew all the states i needed with all the inputs and outputs
[03:34:28] <Roklobsta> i mean conditions for s state change.
[03:34:29] <beaky> my professor said state machines are cool since you can enumerate all possible states of a system, every set of outputs, and all transitions between states, and verify everything
[03:34:44] <Roklobsta> yes they are deterministic and you can close all the holes.
[03:35:36] <beaky> but he codes his as giant switch statements, and when you have things like blinking it becomes verbose (a state for every blink step, on or off, so there's blink_1, blink_1_off, blink_2, etc. for a 3s blink)
[03:35:37] <theBear> but even when using them, i'm tempted to say you often need other code/concepts to make most useful things
[03:36:14] <theBear> like that traffic light code i saw ? he's doing it wrong :)
[03:36:36] <beaky> hahaha
[03:36:45] <Roklobsta> and to process a state i just call: State_Ptr[Modem->ConnState.State](Modem);
[03:37:18] <theBear> see... the approach is supposed to SIMPLIFY things, kinda a least common denominator concept, but for code instead of fractions
[03:37:41] <beaky> so the alternative to giant switches is to have each state be a function that will be invoked through an event handler looking up a table?
[03:37:53] <theBear> table is the operative word
[03:37:55] <Roklobsta> i started with a box and the boolean variables i wanted for the input to enact various state changes.
[03:37:56] <beaky> or to do some state minimzation process?
[03:38:17] <theBear> any minimization should be done before you code anything
[03:38:20] <Roklobsta> then i drew a state diagram
[03:38:33] <theBear> normalisation is certainly a relevant concept
[03:38:42] <theBear> you know what that is right ?
[03:38:44] <Roklobsta> so the state machine i am working on pretty much gets a 3G modem turned on and running.
[03:39:00] <Roklobsta> yes 3G on an AVR
[03:39:02] <beaky> what is normalization?
[03:39:17] * beaky has never taken an automata theory course
[03:39:43] <theBear> sigh... how to put it in a short coherant statement... and it's not automata, it's a general concept...
[03:39:45] <beaky> I guess it has something to do with eliminating duplicate states and making the machine have fewer states overall while doign the same function
[03:39:48] <Roklobsta> the nice thing about drawing it out was that it made it piss easy to code and i have a nice picture to use to trace things as i test and debug it.
[03:40:27] <beaky> Roklobsta: right; my professor just conjures up an FSM to conquer just about any problem that was thrown at him :D
[03:40:45] <Roklobsta> find a probllem and solve it
[03:40:51] <beaky> and it works most of the time..., when does the FSM approach fall apart
[03:41:54] <theBear> oooh, ever done database stuff ? that's a good example of simply definable normalisation
[03:42:12] <beaky> so normalization is removing redundancy
[03:42:14] <theBear> well doing it right is
[03:42:45] <beaky> and in my traffic light thing, I did it wrong?
[03:42:50] <theBear> kinda, removing redundancy by sorting things into the most practical sets/arrangements
[03:42:55] <beaky> ah
[03:45:44] <theBear> like in a db, if you've got a field which will only ever have one of several distinct values/data in it, rather than repeating it for every record, you have a 2nd database with the possible values/data, and just refer to it from the first db, in this case meaning that any values regardless of size will only take a single value/reference, which saves a lot of space if the data is large, and makes it easy to alter or add without needing to alter ALL the rec
[03:45:45] <theBear> ords that refer to it...
[03:46:35] <beaky> so in an FSM, normalization is like encapsulating all the redundancy in discrete states?
[03:46:55] <theBear> for example in some kind of employee database, rather than writing the dept. name in a field per employee, you just use a single value to refer to a table of departments, making it trivial to modify the name of a department
[03:47:27] <theBear> well, it's about choosing states/what the state machine 'does' in a way that is most practical and efficient
[03:49:02] <beaky> (green) -> 10s -> (blinking) -> (3s) -> (amber) -> (2s) -> (red)
[03:50:21] <beaky> ah
[03:50:37] <beaky> how can I model an fsm elegantly as a traffic light?
[03:50:54] <beaky> how can I model a set of traffic lights elegantly as a traffic light?
[03:50:59] <beaky> as an fsm*
[03:52:17] <theBear> for start, the basic table won't care about timing, it'll only define states that the timing/outside influence 'system' will choose from
[03:52:42] <beaky> ah
[03:52:55] <beaky> so transitions should be in a separate transition table?
[03:53:39] <theBear> mmmm, you'd have to write some things down to decide on that, but it's unlikely
[03:54:05] <theBear> remember, i said that not EVERYTHING in a normal useful program can be practically based on finite tables
[03:54:16] <beaky> right
[04:22:11] <electon_> anybody know where i can order loose ( one or two) SMD avr's from in india?
[05:14:08] <megal0maniac> Roklobsta: 3G on an AVR?...
[05:15:32] <megal0maniac> That's like... USB host + some kind of USB - serial bridge + TCP/IP stack + other things
[05:17:48] <megal0maniac> The hell have ASUS done? They've made a tablet/laptop combination thingy with dual screens
[05:18:31] <megal0maniac> And they're both full hd. On an 11.6" notelet
[05:33:23] <OndraSter_> hehe
[05:33:35] <OndraSter_> there is nothing wrong with fullHD on 11.6"
[05:33:43] <OndraSter_> I had 1400x1050 eight years ago on 12.1"
[05:34:32] <twnqx> using my 1680x1050 @ 15.4" makes my eyes hurt
[05:34:41] <twnqx> and ~1.5m distance and 12h/day
[05:34:44] <twnqx> at*
[05:38:24] <jacekows1i> increase font sizes
[05:38:40] <jacekows1i> higher resolution is generally better, if software isn't designed for constant DPI
[05:42:13] <beaky> hello
[05:42:36] <beaky> beginner question: How do you build and deploy an avr program?
[05:44:04] <tzanger> beaky: well you build it (most likely in AVR Studio) and "deploy" it by programming it into the chip
[05:44:17] <Grievar> beaky: Many different ways, here's one example: https://github.com/rfmerrill/krackrainbow/blob/master/firmware/go.sh
[05:44:43] <tzanger> agreed, I wish I had 300+DPI on my macbook air
[05:44:48] <beaky> ah thanks
[05:44:49] <tzanger> I love it on my iphone and ipad
[05:45:26] <beaky> yeah high dpi is awesome for reading and programming and just about everything: a luxury once sampled becomes a necessity
[05:45:51] <tzanger> yep
[05:47:36] <beaky> On windows, should I use atmel studio 6, or should I download a different or older toolchain?
[05:48:02] <beaky> atmel studio 6 is what atmel's "getting started" thing recommends
[05:48:33] <jacekowski> rotfl&lol
[05:48:46] <beaky> so it's bad? :(
[05:48:54] <jacekowski> avr studio 4 is the best one
[05:49:01] <jacekowski> anything past that uses visual studio
[05:49:05] <jacekowski> and sucks big time
[05:49:08] <beaky> argh visual studio
[05:49:30] <beaky> but aren't the more modern avrs unsupported by avr studio 4?
[05:49:52] <jacekowski> depends
[05:49:59] <jacekowski> if you use gcc, they are
[05:50:11] <jacekowski> avr studio 4 will integrate with any version of winavr
[05:50:28] <beaky> so i should use winavr over gcc?
[05:50:39] <jacekowski> winavr is gcc
[05:51:00] <beaky> oh maybe I was thinking of CodeVision(r) AVR
[05:53:31] <Grievar> I just can't do dev on windows
[05:53:46] <Grievar> My dev workflow is so dependent on having a unix-like shell
[05:53:53] <Roklobsta> avr supply the latest gcc anyway as a standalone package from the avr site. it's superceded winavr but it's maintained by the same guys
[05:54:17] <Roklobsta> ok, use avr-gcc and cygwin
[05:54:38] <beaky> ah
[05:55:17] <beaky> alright so I will 1. download the latest avr studio 4 and install it, 2. download and install the latest avr-gcc and toolchain
[05:56:09] <jacekowski> or you can use avr studio 6, but that's painful
[05:56:21] <Roklobsta> here is the avr toolchain for windows http://www.atmel.com/tools/ATMELAVRTOOLCHAINFORWINDOWS.aspx
[05:57:13] <Roklobsta> unlike winavr it doesn't seem to have avarice which is needed for gdb. you still need to get the seperately, same goes for avrdude.
[05:58:42] <Grievar> Annoying property of avrdude: It erases the flash before checking if the new .hex file is valid
[06:00:16] <Roklobsta> sumit a boog report
[06:00:32] <Roklobsta> they might just say "well stop making bad hex files"
[06:01:21] <Grievar> Why is it that whenever I state that I'm unhappy with the state of something, people respond by suggesting things for me to do?
[06:01:36] <beaky> its free software :D write a patch
[06:01:55] <beaky> said every arrogant free software maintainer ever
[06:02:01] <nevdull> Grievar: maybe -D (disable auto erase) would help?
[06:03:25] <Grievar> Everytime I make a statement to the effect of "piece of software X has annoying property Y" people start suggesting solutions. I'm not asking for help, I'm just making an observation
[06:04:26] <megal0maniac> And people are responding logically. Are you expecting something else?
[06:05:20] <Grievar> Er, they're responding logically to a false assumption :P
[06:05:53] <megal0maniac> Nobody is attacking you, we're just "observing" that it's open source software, therefore you can change anything you like. :)
[06:06:23] <Grievar> I'm not saying that anyone's attacking me
[06:06:52] <Grievar> megal0maniac: But who said I /wanted/ anything to be changed?
[06:07:05] <nevdull> that's a good thing because i think your AC is very low
[06:07:33] <Grievar> you mean very high
[06:07:33] <megal0maniac> Nobody. We're being observant of the fact that you can :)
[06:07:51] <megal0maniac> Anyone here use Intel RST before?
[06:08:39] <tzanger> eh?
[06:08:42] <tzanger> intel RST?
[06:09:02] <megal0maniac> tzanger: Yeah
[06:09:15] <beaky> yay my stk500 arrived at my doorstep :D how do you use it in avr studio 4?
[06:09:47] <megal0maniac> It seems to not be able to see my drives on the SATA6 controller, only on the SATA3. i.e. my DVD writer :/
[06:11:45] <Roklobsta> jesus even with ssd .net 4 updates take forever. wtf?
[06:25:24] <tzanger> http://imgur.com/a/D3vya?gallery
[06:25:26] <tzanger> 800-some-odd backgrounds
[06:25:30] <tzanger> if anyone's interested
[06:33:25] <megal0maniac> Thanks :)
[06:33:34] <theBear> no no, .net updates take forever, is the correct version of that statement
[06:36:40] <RikusW> .never ? :-P
[06:37:39] <RikusW> beaky: there is docs with AS4
[06:51:56] <megal0maniac> theBear: Got everything back up and running. Installed most recent drivers for everything, now we'll see how it goes...
[06:52:19] <theBear> well, good luck i spose :)
[08:04:09] <megal0maniac> So far so good :)
[09:39:24] <w|zzy> jadew: http://dangerousprototypes.com/2013/05/23/olsfront-logic-analyzer/ brilliant!
[09:39:39] <w|zzy> I didn't realise you were still working on it.
[09:42:22] <jadew> hah, nice
[09:42:32] <jadew> yeah, I want to add support for advanced triggering soon
[09:42:59] <jadew> but I don't really know how to make the UI for it, I might shave off some features to keep it simple and practical
[09:44:41] <w|zzy> can't be any worse than triggering on java one
[09:45:03] <jadew> well, the advanced triggering is not implemented there either
[09:45:18] <jadew> it's a new way of triggering, implemented in the last firmware
[09:45:45] <jadew> you get 10 triggers, 2 timers, 2 ranges, 2 else statements and several ways of combining them
[09:45:52] <jadew> so you can see how that could become problematic in the UI
[09:46:33] <jobgg> hey
[09:48:39] <w|zzy> oh. didn't see that update
[09:48:41] <jadew> I didn't know they made a blog post about it
[09:48:55] <jadew> w|zzy, yeah, it's not implemented in any client yet
[09:48:59] <w|zzy> it only just got realeased
[09:49:07] <jadew> most likely because it's a challange in terms of UI
[09:49:42] <w|zzy> time for me to sleep. hopefully you get some interest.
[09:49:44] <w|zzy> cya
[09:49:58] <jobgg> has anyone here played around with the ATtiny1634 before?
[09:49:59] <jadew> see ya
[09:56:38] <jobgg> i've bought myself a couple of them along with an avrisp mkII, and I'm trying to get the toolchain running, and I'm desperately hoping I'm not asking this in a higher level group dedicated to ... i don't know, AVR Compilers or something.
[09:57:42] <jobgg> that would make me feel quite stupid.
[09:57:45] <jadew> jobgg, in regard to the toolchain, you can either use avrstudio and do everything from there
[09:58:16] <jadew> or winavr (if on windows) and use makefiles and the compilers and all that directly
[09:58:26] <jobgg> i'm running everything on ubuntu though
[09:58:55] <jadew> then no avrstudio for you
[09:59:00] <jadew> but not all is lost
[09:59:04] <jobgg> -.- noooooooooo
[09:59:28] <jadew> you can use makefiles
[09:59:29] <jadew> http://dumb.ro/files/avr/Makefile
[09:59:40] <jadew> here's an example
[10:05:52] <tzanger> jadew: dude you're from .ro? cool
[10:05:57] <tzanger> (I know you are, I'm teasing now)
[10:06:04] <jadew> haha
[10:07:58] <jobgg> how do you use those makefiles?
[10:09:24] <jobgg> also, what packages will i need to use them?
[10:11:38] <jadew> someone else might be able to help you with the packages, but you basically edit them so they fit what you're doing
[10:12:02] <jadew> you edit the source files list, the chip, the AVRDUDE string and the frequency
[10:12:14] <jadew> and then you just run make flash
[10:12:16] <jadew> from the command line
[10:12:24] <jadew> and the code will get compiled and uploaded on the chip
[10:16:20] <jobgg> sounds reasonable. could I also use AVR Eclipse?
[10:16:50] <jadew> if there's such a thing, sure
[10:16:56] <jadew> I don't know anything about it tho
[10:20:36] <jobgg> thing is, I'm really only comfortable at the bit level or at the level where everything is abstracted away, and you get a nice IDE, and a drink, and a 3 course meal (Hey Visual Studio!). Bash falls inbetween that.
[10:21:04] <jadew> bash falls at the bottom of everything really :P
[10:21:12] <jadew> but you'll get used to it soon
[10:21:18] <jadew> read a bit about makefiles
[10:21:23] <jadew> about the toolchain
[10:21:29] <jobgg> under assembly?
[10:21:42] <jadew> well, bash has nothing to do with assembly
[10:22:01] <jadew> but as a language, yeah
[10:22:03] <jadew> it sucks
[10:22:17] <jobgg> i mean does it fall at the bottom of assembly?
[10:22:56] <jobgg> as, is it more low level. if yes, I've overlooked something, if not, i'll get to it.
[10:23:11] <jadew> it's not more low level than ASM
[10:23:19] <jadew> but you don't really need it for this
[10:23:48] <jadew> using makefiles or compiling by hand has nothing to do with it
[10:23:55] <jobgg> really?
[10:24:04] <jadew> yep
[10:24:23] <jobgg> i blame my complete nonunderstanding of makefiles on making that blunder.
[10:25:01] <jobgg> i thought makefiles were just .bat or similar files that bundle up all the things you'd need to write to compile it by hand.
[10:25:04] <jadew> read a bit on them, there's nothing complex about it
[10:27:24] <jobgg> i'll do that. someday, both my forrays into computers might meet, and then i will finally understand all these things.
[10:28:50] <jobgg> or not...i guess these boxes will always be magic dust and blue smoke to me
[10:33:15] <megal0maniac> Blue smoke? You're lucky..
[10:33:46] <megal0maniac> Computer still hasn't crashed. Running 3 drives + SSD now
[10:33:59] <megal0maniac> But one of my SATA ports appears to be dead :'(
[10:45:38] <megal0maniac> RikusW: Long stay in Bloem? :)
[10:47:50] <megal0maniac> Lol
[11:01:24] * twnqx doesn't understand gui people
[11:01:57] <megal0maniac> What's a gui people? :)
[11:02:07] <twnqx> jobgg is :P
[11:05:59] <tzanger> gui people are people who use AS
[11:06:03] <tzanger> who love Eclipse
[11:06:19] <tzanger> and use programs like mIRC to use IRC :-)
[11:07:45] <megal0maniac> tzanger: I use AS and Windows 7 for most things
[11:08:07] <twnqx> see. gui person.
[11:08:19] <megal0maniac> And I use irssi on a router which I ssh into for IRC, and all my linux installations are headless because I don't see the need for an X server
[11:09:38] <megal0maniac> Often I only switch on my PC to get to Putty
[11:10:36] <megal0maniac> So am I a gui person?
[11:11:41] <twnqx> yes
[11:11:46] <megal0maniac> Aw..
[11:12:01] <jadew> I don't understand people who use mIRC either, telnet is just fine!
[11:12:08] <megal0maniac> telnet??
[11:12:11] <megal0maniac> You can do that?
[11:12:14] <twnqx> no, the ping/pong is annoying
[11:12:19] <twnqx> sure you can
[11:12:36] <jadew> twnqx, if you don't stop talking, you don't have to pong :P
[11:12:43] <twnqx> lol
[11:12:56] <twnqx> i... am not sure
[11:13:02] <twnqx> too long since i last did it :P
[11:15:41] <megal0maniac> Telnet didn't work for me
[11:15:58] <twnqx> need the right port
[11:16:24] <megal0maniac> 6667?
[11:16:34] <megal0maniac> Just said "couldn't lookup hostname" and timed out
[11:16:36] <twnqx> telnet irc.freenode.net 6666
[11:16:36] <twnqx> Trying 2a02:2f0d:bff0:0:81:18:85:57...
[11:16:36] <twnqx> Connected to chat.freenode.net.
[11:16:36] <twnqx> Escape character is '^]'.
[11:16:36] <twnqx> :hobana.freenode.net NOTICE * :*** Looking up your hostname...
[11:16:39] <megal0maniac> But I like irssi anyway
[11:16:45] <twnqx> well of course
[11:16:52] <twnqx> at that point you are connected to the irc server
[11:16:57] <twnqx> irc is a pure text protocol
[11:17:12] <twnqx> ERROR :Closing Link: 127.0.0.1 (Connection timed out)
[11:17:13] <twnqx> funny.
[11:17:24] <megal0maniac> What do you say to it after that? :P
[11:17:44] <twnqx> http://oreilly.com/pub/h/1963
[11:18:47] <twnqx> see :P
[11:27:41] <megal0maniac> Oh damn!
[11:27:48] <megal0maniac> Just saw that :P
[11:28:32] * megal0maniac doesn't read the IRC noise usually
[11:29:17] <tzanger> I use irssi in screen via ssh
[11:29:56] <twnqx> same. just not here.
[11:30:06] <twnqx> only on one of the 5 networks i'm on :P
[11:30:14] <megal0maniac> tzanger: I do exactly the same
[11:30:43] <megal0maniac> Couldn't find a nice Windows IRC client. Also this runs on my router so it's always on. I log, too.
[11:32:20] <beaky> hello
[11:32:27] <megal0maniac> Hello beaky
[11:32:49] <twnqx> one day i'll ask you, beaky... one day
[11:46:32] <jadew> rolling your own IRC client shouldn't be that big of a deal
[11:47:00] <beaky> I amm using irssi
[11:47:20] <LoRez> jadew: telnet works. it isn't super useful or pretty, but it's as capable as you are.
[11:48:20] <jadew> I'm so capable it plays video and shows URL previews
[11:49:33] <jadew> the new telnet IRC client with copy & paste in notepad URL catcher
[11:50:42] <jadew> "manual PONG! all messages in one window! be in control! use telnet!"
[11:53:56] <megal0maniac> Irssi is surprisingly popular here..
[11:54:18] <jadew> well, it's the best you can get in textmode
[11:54:27] <jadew> and it's better looking than xchat
[11:54:54] <megal0maniac> It's what I resorted to when all the windows clients sucked
[11:55:12] <megal0maniac> So it's the best you can get, in my humble opinion :)
[11:55:48] <megal0maniac> RikusW: What is going on with your internet?
[11:57:38] * megal0maniac expects a ping timeout before a reply
[11:57:44] <megal0maniac> Supper!
[11:58:28] <beaky> How do I program my avr using an avr ispmkii?
[11:58:37] <twnqx> jadew: i guess that depends on the number of channels you're in
[11:58:59] <jadew> what depends?
[11:59:10] <twnqx> irssi vs. xchat
[11:59:22] <twnqx> my irssi has ~40 channels+dialogs open on average
[11:59:57] <twnqx> my xchat with four bncs + 2 extra sessions another 30 channels
[12:00:23] <jadew> I use mIRC, there's something about it that makes sense (beside the scripting language which is garbage)
[12:00:35] <Badaboom> I cant open my xchat2 sometimes
[12:00:48] <twnqx> xchat is dead, use hexchat :P
[12:00:57] <twnqx> especially since i'm on linux
[12:01:17] <Badaboom> ywnqx: i got to thinking about those displays
[12:01:31] <Badaboom> i think ill try to reverse engineer one
[12:01:42] <twnqx> it's kinda sad that they are glued
[12:01:52] <Badaboom> i know:(
[12:02:01] <twnqx> can you even use the digitizer after removing it from the cover?
[12:02:03] <jadew> what's glued?
[12:02:32] <Badaboom> ywnqx: some models fuse the digitizer,, some dont,, ill have to see on these
[12:02:55] <Badaboom> wth,, i medd your name up,,sorry
[12:03:06] * Badaboom is tired today
[12:03:53] <twnqx> no worries, i guess i'm still recognizable :P
[12:03:59] <Badaboom> lol
[12:04:09] <RikusW> megal0maniac_afk: I wish I knew whats wrong with my ADSL line :S
[12:04:36] <RikusW> beaky: using AS its fairly easy
[12:04:46] <RikusW> just connect everything and program
[12:04:59] <RikusW> hmm for AS5/6 you'll need to add the STK500 first
[12:07:02] <beaky> but I don't know how to connect the pins right :( my chip is on some breadboard
[12:10:50] <RikusW> you need wires that fit onto the pinheaders
[12:11:05] <RikusW> I use YY05CT + 0.5 mm solid core wire
[12:11:26] <RikusW> otherwise use ribbon cable
[12:11:56] <beaky> alright I will cut 6 wires
[12:12:08] <beaky> and plug them in the holes in my breadboard :D
[12:13:48] <RikusW> or put the avr on the STK500 itself
[12:13:49] <RikusW> in the _right_ socket
[12:14:04] <RikusW> you'll need the connectors for the pinheaders too
[12:14:14] <RikusW> and remember mosi->mosi
[12:14:51] <beaky> ah
[12:19:08] <beaky> btw how do I ensure I don't zap my toys with static? ^^
[12:20:09] <twnqx> normally i would recommend an antistatic wristband, connected to earth for that... but knowing the wiring in your region...
[12:21:03] <beaky> heh
[12:21:37] <twnqx> hey, i measured 110V against earth in the middle of my mainboard when i lived in saudi
[12:21:51] <twnqx> and i was wondering why the pc chassis felt so strange
[12:21:56] <twnqx> yeaaaah 110V
[12:22:41] <jadew> damn
[12:22:43] <twnqx> how to make 220V: use 2x 110V, 180° shifted, and remove the returns
[12:22:51] <twnqx> \o/
[12:22:54] <jadew> well, wrist bands have a 1Meg resistor, no?
[12:22:58] <jadew> or is that 10M?
[12:23:02] <twnqx> depends
[12:23:05] <jadew> that should be enough to keep you safe
[12:24:21] <jadew> let me check mine
[12:25:15] <jadew> 1M
[12:31:11] <beaky> so i'll just wear a wristband connected to my power socket?
[12:35:19] <twnqx> ummm
[12:35:24] <twnqx> not to power, please :P
[12:35:43] <twnqx> to return, or preferable earth if you have that
[12:38:36] <beaky> earth?
[12:38:47] * beaky fetches his potted plant
[12:40:38] <twnqx> Oo
[12:40:53] <twnqx> i see you electrocuting the plant :X
[12:43:22] <twnqx> earth is the third pin on the outlet.. it is called ground alternatively, i think
[12:43:27] <beaky> ah
[12:43:41] <beaky> there we go :D
[12:44:01] <twnqx> funnily, in my place in saudi
[12:44:06] <twnqx> it was never connected to anything.
[12:44:12] <beaky> oh man my breadboard looks like a dish of black spaghetti wire
[12:44:18] <twnqx> :P
[12:47:28] <inkjetunito> mmm knäckebröd
[12:47:55] <twnqx> looks swedish
[12:49:02] <inkjetunito> yeah, they eat breadboard in sweden
[13:03:18] <theBear> usually its better to pick something less dangerous and closer to what you are doing
[13:03:30] <beaky> right
[13:03:46] <beaky> maybe I can pick a pc power supply
[13:04:32] <theBear> also for protecting electronics you have to think about potential.... if something isn't plugged in, grounding yourself to the mains/a tap/whatever is useless, you need to connect to the chassis/gnd of the thing that isn't plugged in, to guarantee low potential between you and the chips
[13:04:43] * tzanger has been reading about defeating code protection
[13:18:21] <beaky> alright I've finally connected MOSI to MOSI, MISO to MISO, SCK to SCK, and RESET, GND, and Vcc to the same ones that my avr uses. as soon as I put RESET, my circuit stopped going, why is that?
[13:26:48] <megal0maniac_afk> beaky: Do you have a pull-up resistor in your circuit on the reset line?
[13:27:51] * megal0maniac_afk makes a decision to never use mtnbusiness as my ISP
[13:28:29] <megal0maniac_afk> RikusW: By now you must be swearing
[13:52:42] * RikusW is considering using GPRS again....
[13:57:35] <megal0maniac_afk> As long as it isn't with MTN :P
[14:00:27] <RikusW> I used vodacom
[14:00:35] <megal0maniac_afk> Good!
[14:00:41] <megal0maniac_afk> MTN is letting you down
[15:40:49] <beaky> what's a pull-up resistor?
[15:41:21] <thetruthisoutthe> resistor up to the positive rail
[15:42:26] <beaky> ah; that I do have :D I ahve a 10k ohm resistor from my RESET pin to my Vcc bus
[15:43:00] <thetruthisoutthe> it has one btw
[15:43:40] <beaky> ah so it isn't needed?
[15:44:02] <thetruthisoutthe> no, it will be default working, until you pull reset low
[15:45:26] <thetruthisoutthe> haven't tried it?
[15:46:59] <beaky> ah
[15:47:01] <beaky> it works!
[15:50:47] <beaky> oh wait... it still doesn't :(
[15:51:10] <beaky> when I stick my RESET pin of my ISP onto the RESET of my avr, the whole system dies :(
[15:55:16] <beaky> ah damn my voltage regulator is melting
[15:58:08] <Grievre> Why does a TWI bus error result in the avr holding the clock line low until software manually clears it?
[15:58:43] <Grievre> oh because it's a state, derp
[15:59:02] <Grievre> if it automatically cleared there'd be no way to detect it
[16:01:04] <twnqx> beaky: just exactly what's the resistor value you run from VCC to reset?
[16:02:17] <thetruthisoutthe> 1 ohm
[16:03:44] <thetruthisoutthe> sup seldon ?
[16:04:36] <beaky> hmm it is 0
[16:05:00] <beaky> my isp thing is shorting
[16:05:12] <beaky> I guess I connected everything wrong
[16:05:19] <seldon> Compiler's driving me up the wall. Thanks for asking. :P
[16:05:27] <thetruthisoutthe> happens
[16:05:37] <thetruthisoutthe> gcc likes to fail bad
[16:05:38] <twnqx> beaky: it shiuld be 4.7 or 10k
[16:06:05] <thetruthisoutthe> twnqx <= or nothing :)
[16:06:11] <seldon> It happens with arcane c++ template magic. I think I've puzzled it out, though.
[16:06:36] <twnqx> thetruthisoutthe: i am a fan of my 10k resistors
[16:06:42] <thetruthisoutthe> i avoid that problem by not using c++
[16:07:18] <thetruthisoutthe> twnqx <= ok, btw the reset pin has a 30k internally
[16:07:26] <twnqx> oh, really?
[16:07:36] <twnqx> so why is it generally recommended to have an external?
[16:07:40] <thetruthisoutthe> you can verify it in the datasheet
[16:07:51] <thetruthisoutthe> i'd guess it gives even greater noise immunity
[16:08:05] <twnqx> well yes, 30k is quite a bit
[16:08:54] <thetruthisoutthe> but for testing out a led flasher or something, you don't need it
[16:10:39] <beaky> how come when I connect my reset lead from my isp to the vcc bus on my board, I get a short circuit? :D
[16:10:58] <twnqx> reset is active low
[16:11:04] <twnqx> your isp pulls it to 0
[16:11:15] <twnqx> if you have it tied straight to vcc... it's a short
[16:11:23] <beaky> ah
[16:11:27] <twnqx> (which might destroy your programmer, even
[16:11:34] <beaky> oops
[16:12:01] <beaky> so the right way is to stick the reset to GND?
[16:12:18] <twnqx> no, with a resistor of at least 1kohm to vcc
[16:12:36] <Tom_itx> 10k
[16:12:42] <beaky> alright I will use a 10k one
[16:12:47] <thetruthisoutthe> reset does a reset when pulled low.
[16:13:12] <Tom_itx> 1k would be too strong for the programmer to overcome i believe
[16:13:24] <Tom_itx> at least some of them
[16:13:25] <twnqx> 1k would be 5mA
[16:13:32] <thetruthisoutthe> connect reset to an io, pull low, = suicide :)
[16:13:39] <twnqx> all atmel based programmers should be able to sink/source 20
[16:14:38] <thetruthisoutthe> i like to use series protection resistors
[16:15:03] <thetruthisoutthe> so using too low value pullup will prevent correct logic levels
[16:15:08] <twnqx> wow
[16:15:17] <twnqx> i think i clicked "next" >100 times
[16:15:29] <twnqx> RRST Reset Pull-up Resistor 30-100 kΩ
[16:17:52] <thetruthisoutthe> twnqx <= though i hacked together a buffered programmer, and i have not used protection resistors for the tristate buffer
[16:18:23] <twnqx> buffers are for beginners and whimps
[16:19:09] <thetruthisoutthe> say this whentechnicians connect 12V to your device and get it back to you saying it died
[16:19:48] <antto> or when you're building a nuclear power plant in japan ;P~
[16:20:02] <beaky> yay the 10k ohm resistor stopped the crashes
[16:20:04] <twnqx> you obviously get away without buffers in the latter case
[16:20:05] <beaky> I mean shorts*
[16:20:19] <twnqx> see, if we say "a 4.7k - 10k resistor"
[16:20:23] <beaky> but my ISP still doesn't detect my avr :(
[16:20:28] <twnqx> we mean: do not put anything but a resistor.
[16:20:37] <beaky> ah
[16:20:43] <thetruthisoutthe> twnqx <= without a cmos buffer you can not drive a ttl input through 2k protection resistors
[16:21:22] <twnqx> your 2k resistor will not help you with the 12V if that breaks down the gate/source barrier :P
[16:21:59] <thetruthisoutthe> (that can never happen btw)
[16:26:36] <stanreg> Does anyone know what this "bit" function accomplishes? eg: CLKPR = bit(CLKPCE)
[16:27:39] <twnqx> i would expect the same as _PV :P
[16:28:01] <twnqx> but that is a wild guess, why not just search for the declaration?
[16:33:15] <stanreg> hmm.
[16:33:21] <stanreg> Check this out
[16:33:23] <stanreg> ---
[16:33:25] <stanreg> static void setPrescaler (uint8_t mode) {
[16:33:25] <stanreg> cli();
[16:33:25] <stanreg> CLKPR = bit(CLKPCE);
[16:33:25] <stanreg> CLKPR = mode;
[16:33:28] <stanreg> sei();
[16:33:29] <stanreg> }
[16:33:31] <stanreg> ---
[16:33:46] <stanreg> AHH, nvm, I get it :)
[16:34:15] <stanreg> Seems like you have to write to bit CLKPCE of CLKPR before being able to change CLKPR's other bits.
[16:45:37] <bsdfox> iirc there is a cycle limit on how fast you need to change it too
[19:04:19] <Fleck> anyone can help me with setting attiny13 to run at 8MHz with internal oscillator?
[19:05:41] <tzanger> Fleck:you just set the fuses
[19:05:45] <tzanger> google for avr fuse calculator
[19:06:04] <Fleck> there are only 4.8 and 9.6MHz
[19:10:05] <twnqx> and since there is no full blown pll with arbitrary divider/multiplicator, the answer is almost "no"
[19:10:19] <twnqx> you can just detune the oscillator if you're lucky
[19:11:45] <tzanger> Fleck: what's wrong with 4.8 or 9.6? What are you trying to do?
[19:12:13] <Fleck> chiptunes :/
[19:12:30] <Fleck> code is for 8MHz
[19:15:11] <twnqx> fleck: do you have an oscilloscope or frequency counter?
[19:15:29] <Fleck> nope
[19:35:55] <ambro718> anyone else noticed that avr-gcc 4.8 does floating point much faster than 4.7?
[19:36:05] <ambro718> or it may be just sqrtf, I'm not sure
[19:50:10] <Hotroot> Quick static question. Would putting a multimeter on DCV detection and touching the + and - leads dissipate any bodily static?
[19:51:47] <OndraSter> I just touch the earth pin in wall socket
[19:51:52] <OndraSter> or the heater
[19:51:55] <OndraSter> or computer chassis
[19:52:00] <OndraSter> or anything that is earthed
[19:53:20] <Hotroot> Right, but the multimeter is very portable.
[20:04:26] <Hotroot> Hmm, nvm
[20:10:01] <jadew> it wouldn't dissipate anything :P
[20:10:21] <jadew> you have to touch something that has an earth connection
[20:11:03] <jadew> when you're statically charged, you're not charged like a battery, so if you "close the circuit" you don't get drained out
[20:11:27] <jadew> well, mainly because you don't close the circuit
[20:13:01] <ambro718> warning: format ‘%f’ expects argument of type ‘double’, but argument 4 has type float [-Wformat=]
[20:13:47] <ambro718> this doesn't make any sense. In C floats are auto-promoted to doubles. Further, in avr-gcc doubles and floats are the same
[20:14:43] <Tom_itx> i'll take a double rootbeer float
[20:16:51] <ambro718> ok printf seems completely broke
[20:18:11] <ambro718> %f at least
[20:23:09] <ambro718> oh, I just needed to enable the full printf implementation
[20:49:08] <Horologium> ambro718, watch that full printf implementation..it is huge.
[20:49:54] <ambro718> yeah I got a few k more, but it's for debugging only
[21:11:20] <ambro718> avr-gcc-4.8 is claimed to include fixed-point types, but I'm getting this: error: ‘_Accum’ does not name a type
[21:13:06] <ambro718> oh, they're only available in C mode not C++ :(
[23:51:21] <nevdull> hi..does atmel studio 6 incorporate AVR32 support or is it still a separate AVR32 studio product?