#avr | Logs for 2012-04-01

Back
[05:39:30] <OndraSter> mornin
[05:39:31] <OndraSter> !time
[05:39:31] <tobbor> My watch says its 03:30 Sun Apr 01 2012
[05:39:34] <OndraSter> hmm
[05:47:32] <tosmo> what avr simulator would you recommend on linux? i saw simulavr and simavr. the first one works together with gdb which i have no experience with. currently i mainly want to keep track of the amount of ram used so far
[06:12:54] <jacekowski> simulator isn't really going to help with that
[06:19:01] <raek> tosmo: do you mean program size, size of statically allocated variables, stack size, or heap size?
[06:20:16] <raek> you should be able to determin the first two from messages from the compiler or by analyzing the binary
[06:21:18] <j4cbo> and you really, really, really shouldn't be using malloc() etc on an avr
[07:21:39] <tosmo> raek, j4cbo: i won't use malloc, so yes, actually it should be determinable at compile time. on the other hand, after all i wan't to see whether im within the limit of the avr, so stack will also be of concern. is it reasonable to estimate stack size by estimating the max amount of nested functions/isr's ? btw, what are the stack requirements for a function?
[07:24:24] <tosmo> (with "stack requirement" i ment amount of memory. i'd guess sreg+return pointer+extra = 32bit?)
[08:46:18] <abcminiuser_> Tom_itx, I have some new firmware for the programmer
[08:46:41] <abcminiuser_> I reverted the watchdog command timeout management, since it breaks on devices with WDTRST programmed
[10:24:51] <Tom_itx> abcminiuser_ what changes did you make?
[10:25:10] <abcminiuser_> Tom_itx, just replaced the watchdog code with timer 0 code instead
[10:25:14] <abcminiuser_> Hang on, I'll push the GIT
[10:25:30] <Tom_itx> doesn't affect the 4Mhz clock does it?
[10:26:24] <Tom_itx> looks like it's on timer1
[10:27:40] <abcminiuser_> No, this uses Timer 9
[10:27:43] <abcminiuser_> Err 0 rather
[10:28:30] <Tom_itx> why were we messin with wdt anyway?
[10:30:21] <abcminiuser_> Makes code nicer
[10:30:30] <abcminiuser_> But breaks if the user has WDTRST fuse set
[10:30:38] <abcminiuser_> Ok pushed, back in 15
[10:30:50] <Tom_itx> mmm
[10:43:33] <WormFood> http://freenode.net/privacy_change.html big changes coming to freenode
[10:47:00] <Roamin> has anyone ever used a TLC5920 16x8 bit LED driver/controller? I'm confused with the timing, and how the part really operates
[11:07:02] <Tom_itx> WormFood does that include PM?
[11:10:45] <cyanide> april 1
[11:10:46] <cyanide> lol
[11:12:40] <cyanide> it is april 1 in amerika now
[11:12:50] <cyanide> time to turn off the monitor and have a break
[11:17:10] <WormFood> Tom_itx, of course it does ;)
[11:18:00] <Tom_itx> april fools
[11:26:44] <specing> s/april //
[11:48:38] * abcminiuser_ back
[11:50:26] <Tom_itx> what's up today abcminiuser_?
[11:50:52] <abcminiuser_> Tom_itx, not a whole lot, just writing some inline ASM for the XMEGA CCP regs
[11:51:04] <abcminiuser_> God the GCC inline ASM syntax is obtuse
[11:51:36] <Tom_itx> early in the week somebody discovered an error in a pdf. who should they contact?
[11:51:58] <Tom_itx> lemme see if i can find it
[11:55:04] <Tom_itx> http://tom-itx.dyndns.org:81/~tom-itx/irc/logs/%23avr/2012-03-28.html
[11:55:07] <Tom_itx> near the bottom
[11:55:29] <Tom_itx> I am having trouble with the at90usb1287 datasheat page 326 ... it says that when using the ADC in differential mode the result is a 2-compliment number .... example 1 says -400 = 0x270 ... ok ... and example 2 says -41 = 0x29 ... this doesn't seem correct to me ... should -41 = 0x3D8 ?
[11:55:58] <Tom_itx> timemage, plus with the formula giving and the voltages in the example the answer should be -40 not -41
[11:58:41] <specing> abcminiuser_: WHAT DID YOU SAY?!
[11:58:54] <specing> abcminiuser_: WHAT IS WRONG WITH GCC's INLINE ASM SYNTAX?
[11:59:18] * specing gets into GNU defence mode
[12:01:37] <abcminiuser_> specing, good lord
[12:01:44] <abcminiuser_> It breaks new ground in WTFery
[12:02:00] <abcminiuser_> Works great, but the contraints need to be documented
[12:02:11] <specing> Ah that
[12:02:36] <specing> You know that instruction set reference manual?
[12:03:11] <specing> I have it printed and have notes on constraints for 1/3 of all instructions :D
[12:04:04] <specing> actually
[12:04:15] <specing> abcminiuser_: you work for ATMEL, document it!
[12:04:33] <Tom_itx> wrong department
[12:05:08] <specing> Its always wrong department...
[12:05:18] <abcminiuser_> specing, bleh
[12:06:52] <specing> abcminiuser_: Who is going to do it if not you?
[12:07:50] <abcminiuser_> specing, AVR Toolchain dev team
[12:07:55] <abcminiuser_> I guess
[12:08:01] <specing> ...
[12:08:28] <specing> And they are like where? two doors ahead of your department?
[12:09:09] <aod> hey guys, wtf are u talking about?
[12:09:55] <abcminiuser_> specing, Chennai, India IIRC
[12:10:12] <abcminiuser_> So a bit of a walk...
[12:10:50] <specing> ...
[12:48:43] <cyanide> whats a good POWERFUL servo?
[13:06:46] <specing> cyanide: ask dirty, if he is still alive
[13:08:54] <cyanide> im talking about enough power to lift an american
[13:09:13] <cyanide> while still being relatively small, like a maximum of 5ft by 2ft
[13:09:40] <cyanide> some nice car porn http://forums.nasioc.com/forums/showthread.php?t=1336349
[13:10:10] <mrfrenzy> well how much does the american weigh, and how fast and far must he be lifted?
[13:10:51] <cyanide> well the servo will be used to change gears in a car transmission
[13:11:08] <cyanide> the "displacement" is not more than a few millimetres, say 15mm
[13:11:17] <cyanide> the speed and power are critical
[13:11:59] <mrfrenzy> heh, some guy in the swedish electronics forum just had the very same idea
[13:12:21] <cyanide> its quite common actually
[13:12:31] <cyanide> another way is by using hydraulic actuators and valves
[13:12:44] <cyanide> but thats a lot more complicated, expensive and difficult to repair
[13:12:58] <cyanide> but will always be lightning quick
[13:13:14] <cyanide> i might find something here http://www.servocity.com/html/servos___accessories.html
[13:13:17] <mrfrenzy> what about pneumatics? those are cheap and reliable
[13:14:13] <cyanide> i'll stick with what im comfortable with, i think. troubleshooting something i dont understand while being in the pitlane doesnt sound fun
[13:16:21] <cyanide> this is nice lol http://www.youtube.com/watch?v=v5FYpeea4V8
[13:16:28] <cyanide> but probably nowhere near powerful enough
[13:18:13] <cyanide> http://www.youtube.com/watch?v=BhcZBr38Kmc
[13:39:30] <j4cbo> tosmo: https://github.com/j4cbo/stacker
[13:55:53] <gkwhc> Hi, does one usually need to "refresh" the DMA after one transfer is completed, so that you have it run contiinuously?
[13:56:11] <Steffanx> xmega?
[13:56:27] <gkwhc> Steffanx: no, actually an ARM
[14:02:08] <gkwhc> hmm i just tried resetting/reconfiguring the DMA when transfer completes, and it seems to be running repeatedly now
[14:19:11] <RikusW> Steffanx: http://www.gallagher.co.nz/energizer.aspx?mktprodid=3009
[14:19:22] <RikusW> that is what electrified me ;)
[14:20:33] <Steffanx> Nice nice
[14:20:42] <RikusW> its got a PIC16C77 inside :|
[14:21:19] <RikusW> its fairly expensive iirc ZAR7000
[14:24:27] <Kevin`> remote control, nice
[14:24:36] <RikusW> very
[14:24:42] <Kevin`> although you get good at carefully walking through the fence after a while
[14:24:57] <RikusW> yeah :-D
[14:26:08] <RikusW> getting a shock from mains don't even compare to that thing.....
[14:26:40] <RikusW> there is a microcontroller inside the remote too
[14:26:56] <Kevin`> it would be interesting to see how the device communicates using what is essentially continuous extreme ESD
[14:27:11] <RikusW> seems they used a resistive divider
[14:27:20] <RikusW> its a 170us pulse about every second
[14:27:26] <RikusW> at about 8kV
[14:27:51] <RikusW> or 6kV if the fence is longish, and loaded with grass
[14:28:45] <RikusW> there is some kind of stepup transformer connected to about 8x 1n4007 inside the remote too
[14:30:26] <RikusW> Kevin`: have you been energised before ? ;)
[14:31:02] <Kevin`> yes
[14:32:20] <RikusW> there isn't much that can compare to that jolt....
[14:33:52] <Kevin`> fortunately it's designed to be pretty harmless. if it was continuous..
[14:34:51] <RikusW> we have a smaller battery operated version too
[14:35:21] <RikusW> I suspect its pulse is longer, it makes your arm lame for about a minute....
[14:49:11] <RikusW> its got 2x 30uF 1200V pulse grade caps inside and a IR40TPS12 SCR and a big stepup transformer
[17:18:10] <SmashCat> Hi - was asking this in the Arduino channel, but might be better here. I have an AVR Dragon, and have AVR Studio as an IDE to upload code using ISP to an Arduino Pro Ethernet (no USB on it, so have to use ISP). I have set up the environment to recognise the AVR Dragon, and the ATMega328 it's connected to - however there's no option in AVR Studio 5 to upload the code to the device it seems.
[17:19:03] <Tom_itx> sure there is
[17:19:17] <Tom_itx> do you have a hex file?
[17:20:11] <SmashCat> Tom_itx: It's built the project ok, so I guess it's put th hex file somewhere
[17:20:21] <Tom_itx> you need to find it
[17:20:29] <Tom_itx> then i'll tell you how
[17:21:09] <SmashCat> Tom_itx: Ok I'll find it - strange a GUI doesn't do this really :-)
[17:21:09] <grummund> it's a secret
[17:21:19] <grummund> only Tom knows
[17:21:27] <grummund> you must pay :p
[17:21:57] * Tom_itx hands it over to grummund
[17:22:16] <grummund> split 50/50 ;)
[17:23:01] <Tom_itx> under 'tools' select 'avr programming'
[17:23:17] <Tom_itx> then under the 'tool' dropdown select the dragon
[17:23:28] <Tom_itx> and under 'device' select your chip
[17:23:36] <SmashCat> Tom_itx: Yep, I already have that setup.
[17:23:52] <specing> Or even better: get avrdude
[17:23:54] <SmashCat> I did that part first - it found the Dragon ok, and found the device ID etc
[17:24:07] <Tom_itx> then once you select 'apply' click on 'memories'
[17:24:23] <Tom_itx> and under 'flash' navigate to your hex file
[17:24:42] <Tom_itx> make sure erase before programming is checked
[17:24:56] <SmashCat> Tom_itx: Ah ok got it
[17:25:01] <Tom_itx> :)
[17:26:08] * Tom_itx gives grummund 50%
[17:26:34] <grummund> woot. i'm rich
[17:27:02] <grummund> just don't anyone else the secret, right.
[17:27:19] <SmashCat> Tom_itx: Cool - all seems to be working, thanks.
[17:30:35] <SmashCat> Tom_itx: Is there a plugin or setting to enable an "upload to device" button on the toolbar? To save having to go through the AVR Programming device setup every time?
[17:33:39] <Tom_itx> nope
[17:34:09] <SmashCat> Tom_itx: heh, ok cheers
[17:54:22] <iR0b0t1> Can anyone help me with the procedure to set the UART's baud on an ATmega328? Between the arduino code and the datasheet I still don't get it. I've also got an atmega328 (on an arduino board) which I can't seem to effectively program, or at least get data back from.
[17:55:44] <Tom_itx> UBRR0 reg i believe
[17:56:09] <Tom_itx> http://www.wormfood.net/avrbaudcalc.php
[17:56:13] <Tom_itx> what baud?
[18:10:35] <wollw> https://github.com/Wollw/Cellular-Polymaton/blob/master/src/serial.h
[18:10:41] <wollw> https://github.com/Wollw/Cellular-Polymaton/blob/master/src/serial.c
[18:10:55] <wollw> ^^ If it's helpful that's a pretty simple example of how I've done it.
[18:12:30] <SmashCat> Hmm, I think I may have been a bit hasty thinking it'd be straight forward to convert an Arduino project to AVR Studio.
[18:13:07] <wollw> They're pretty different.
[18:13:38] <wollw> The 328P's datasheet is your best friend.
[18:14:38] <Tom_itx> SmashCat, if you're ready to make the switch you'd better read the chip data sheet a bit
[18:14:49] <SmashCat> wollw: Yeah - I've finally got it to find al the include files - had to specify each one separately as it can't look in subdirectories libraries.
[18:15:48] <SmashCat> Tom_itx: I've done projects for the ATTiny chips without the Arduino libs (AT2313 and ATTiny45 mainly) - but this project will be on an Arduino board, so can use the libs if possible
[18:16:31] <Tom_itx> i don't care so much for 'blackbox' coding
[18:17:23] <SmashCat> Tom_itx: Well I don't have time to write my own Ethernet driver etc, so just want to transfer a working project across initially
[18:17:45] <wollw> SmashCat: what's the motivation for switching if you have it working with the arduino libs and are using an arduino?
[18:17:50] <wollw> just education?
[18:18:58] <SmashCat> wollw: Mainly as the board I'm using is a hybrid Arduino/Ethernet model without USB, so I'm using a Dragon AVR programmer (ISP), and it's supported in AVR Studio. Thought it'd be the right time to try iy
[18:19:03] <SmashCat> *it
[18:19:14] <wollw> ah
[18:19:34] <wollw> well, you can just flash the hex file the arduino ide builds too
[18:20:01] <grummund> SmashCat: you can add library directories to the search list
[18:20:04] <SmashCat> wollw: Yeah I've been considering doing that :-) Just using AVRDude on the command line
[18:21:18] <SmashCat> grummund: I ended up adding them all to the AVR/CNU C++ Compiler -> Directories
[18:21:43] <grummund> i think wollw means use avrstudio to flash the aurduino built hex file
[18:22:18] <SmashCat> grummund: Ah yes I see - that'd make more sense - heh
[18:22:46] <wollw> so, you want to use the arduino ethernet library but write the rest using the atmel libraries?
[18:25:21] <SmashCat> wollw: No I'm using the Ethernet, SPI and EEPROM libs (as they're from the existing project) plus some libs I wrote. I had to add them all separately as Include paths. It's finding them all ok now, but there's other problems - it doesn't seem to understand PROGMEM for one thing, so I think your idea of just using th eArduino environment and using AVR Studio to upload via the Dragen will be better
[18:26:25] <wollw> PROGMEM is specific to avr-libc if i remember right
[18:27:07] <wollw> I haven't actually used AVRStudio before though so I don't really know.
[18:27:44] <grummund> PROGMEM isn't arduino specific
[18:28:33] <grummund> #include <avr/pgmspace.h>
[18:29:19] * wollw wonders how avr-libc's PROGMEM differs from amtel's then.
[18:29:55] <grummund> it doesn't, what you said is correct ;)
[18:30:09] <grummund> i said it's not *arduino* specific
[18:30:34] <wollw> grummund: well, the Arduino libs are built on top of avr-libc
[18:30:49] <SmashCat> grummund: That include is actually in all my headers. Just throws errors.
[18:30:50] <grummund> yes i wasn't disagreeing
[18:31:21] <wollw> I've run into some problems compiling older code using newer versions of avr-libc
[18:31:31] <wollw> grummund: sorry, I'm a little out of it today :)
[18:31:51] <grummund> SmashCat: perhaps you didn't install winavr, or installed in the wrong order so avrstudio doesn't see it and that's why all the trouble finding header files
[18:32:27] <wollw> SmashCat: what error is it giving in particular about PROGMEM?
[18:32:38] <SmashCat> grummund: It does find the headers ok - no errors there. I did intentionally misname pgmspace.h just to check.
[18:32:57] <wollw> I've run into problems where I had to change the declaration for PROGMEM variables using different versions of the libraries.
[18:33:07] <SmashCat> wollw: It falls over with "only initialized variables can be placed into program memory area"
[18:33:35] <SmashCat> (they are all initialized and declared as const)
[18:34:06] <SmashCat> i.e. static const prog_char strDefaultHTTPResponse[] PROGMEM = "blah";
[18:34:43] <grummund> can you reduce it to <20 lines that still fails?
[18:36:28] <SmashCat> grummund: Er, there's quite a few includes etc going on. The only errors are related tot he PROGMEM entries though. Suppose I could start a new project and just try declaring a PROGMEM string
[18:36:42] <grummund> i would do that
[18:42:22] <SmashCat> grummund: Yes it works if I put all the PROGMEM const definitions into one file with the code. If I add them to an include it falls over again. Even if I add the includes for io and pgmspace to the include. Going to try just pasting everything into one big file to see if it can compile it...
[18:43:44] <wollw> SmashCat: What V-USB does is has the definitions in a .c file and "extern" declarations in a .h
[18:44:29] <OndraSter> yo, anybody ever used QTouch? :)
[18:45:55] <wollw> https://gist.github.com/2279469 <-- this compile fine by the way
[18:47:49] <SmashCat> wollw: Weird, doesn't work here for me. I'll have to come back to it I think. Getting a bit late here now and I want to get it on the hardware and the hardware into the case - I'll use the Arduino IDE to compile and just use AVR Studio to upload for now I think.
[18:49:44] <wollw> Probably a good idea.
[21:04:21] <inflex> lo all
[23:08:58] <Casper> hey Richard_Cavell
[23:09:07] <Richard_Cavell> hiya
[23:09:14] <Richard_Cavell> I'm frustrated dude
[23:09:22] <Richard_Cavell> done some study today, brain is full and it's only 2pm
[23:09:25] <w32stuxnet> morning/afternoon/night all, anyone know how to get serial data out of a UCMINI mote?
[23:10:59] <Casper> small medical question for ya: a few days ago I grinded my knee... the wound is ok, but there is a pinkish spot on my thigh that is growing... I think it's some meds allergy (I stopped to take it, seems to have stopped to grow, we'll see tomorrow). When is it worrysome enought to consult a doctor? the net is really unreliable about it
[23:11:20] <Casper> it go from: it's normal to get in the emergency room ASAP
[23:11:35] <Casper> btw, I was grinding rusty metal
[23:12:25] <Richard_Cavell> Casper: it's difficult to diagnose over IRC
[23:12:41] <Casper> I know
[23:12:45] <Richard_Cavell> people go to their doctor when they have nothing wrong with them, so if you have a legitimate injury, it's fair for you to go
[23:13:05] <Casper> at a minimum, I'ld wait like 4 hours
[23:13:25] <Landon> AIDS
[23:13:28] <Landon> definitely AIDS
[23:13:29] <Tom_itx> we need pics
[23:13:30] <Casper> so not interresting much...
[23:14:04] <Casper> Tom_itx: if you really want an hairy pic, I actually can post one you know
[23:14:25] <Richard_Cavell> Casper: go on post pics
[23:14:35] <Tom_itx> not for me
[23:14:37] <Casper> let me check something first...
[23:16:28] * Casper starts to really think it's meds allergy
[23:17:46] <Casper> pic...
[23:19:35] <Casper> hmmm let's forget about it for tonight... it's less pink... which suggest the allergy...
[23:20:23] <Casper> meaning there is another meds that I'm allergic... fun...
[23:21:08] <Casper> bactrim, penicillin... and now something in that stuff...
[23:22:42] * Casper thinks he put the finger on the exact ingredient
[23:23:49] <Casper> "Bactrim contains a combination of sulfamethoxazole and trimethoprim" one of the ingredient is Bacitracin... wikipedia say: "It can cause contact dermatitis and cross-reacts with allergic sensitivity to sulfa-drugs"
[23:24:21] <Casper> case closed
[23:25:34] <Casper> (btw, that wround will leave a big mark... the wound is 7/8"x1/4"...)