#avr | Logs for 2014-06-24

Back
[02:35:22] <Duality> avr assembly rules
[02:37:41] <Thrashbarg> indeed
[03:01:30] <edmont> hi
[03:01:49] <edmont> do you know of any available bootloader for 256k flash size?
[03:02:06] <edmont> i mean, capable of serial programming
[03:05:26] <edmont> i was using some stk500 variant for atmega128rfa1, but now moved to atmega256rfr2
[06:28:41] <inflex> What are the 256K AVRs like?
[06:28:51] * inflex is still living in the land of 512 byte and maybe 8K AVRs
[06:29:07] <Lambda_Aurigae> just like the other ones with more memory.
[06:29:18] <Lambda_Aurigae> and usually more i/o pins.
[06:29:26] <inflex> Still 8 bit?
[06:29:35] <Lambda_Aurigae> yes.
[06:29:48] <inflex> Interesting, how do they handle the 8bit addressing limits?
[06:29:54] <Lambda_Aurigae> they just do some magic with extra registers to access the extended memory.
[06:30:21] <Lambda_Aurigae> the only limit is how many 8bit registers you use to access the memory.
[06:30:29] <specing> its like PIC "banks"
[06:30:45] <specing> except the memory layout is more consistent
[06:31:31] <Lambda_Aurigae> the commodore 128 could access 128K of ram plus 48K of rom on an
[06:31:36] <Lambda_Aurigae> on an 8bit processor.
[06:31:40] <Lambda_Aurigae> just did bank switching.
[06:32:03] <Lambda_Aurigae> the avr with 256K of flash does much the same only more transparent.
[06:34:42] <inflex> fair enough. Been using AVRs for a long time, just never really the big stuff.
[06:34:50] <inflex> Largest I ever used was a 16K Mega168
[06:36:05] <Lambda_Aurigae> if you are programming in C it is really transparent.
[06:37:29] <twnqx> 256k flash exist?
[06:37:33] * twnqx only knew 128
[06:37:58] <twnqx> and that did just use 16bit per address, so still 16bit addressing
[06:39:16] <Duality> what happens when you jump in assembly to the reset vector ?
[06:39:36] <Lambda_Aurigae> the program goes to where the reset vector points.
[06:39:56] <Duality> but does it reset the avr ?
[06:40:08] <Lambda_Aurigae> it doesn't cause a hardware reset, no.
[06:40:40] <Duality> but a hardware reset does cause the program to start at the reset vector ?
[06:40:55] <Lambda_Aurigae> yes.
[06:40:58] <antto> i use an atmega2561
[06:41:03] <antto> iz iz nice
[06:41:16] <Duality> and a watchdog timer reset is that a hardware reset ?
[06:41:24] <Lambda_Aurigae> no.
[06:41:25] <antto> my firmware has consumed about 81kB so far
[06:41:31] <Lambda_Aurigae> it jumps to the reset vector.
[06:41:45] <inflex> what do people put on such large AVRs? GUI display stuff ?
[06:41:49] <Lambda_Aurigae> but does not cause the chip to go through it's power on procedure which is what a hardware reset does.
[06:42:00] <Lambda_Aurigae> inflex, all kinds of stuff.
[06:42:00] <specing> inflex: probably lookup tables
[06:42:07] <specing> inflex: for eg log() or something
[06:42:21] <inflex> My largest was for a Low Ohms Meter, which did a lot of 64 bit math and drove a simple 16x2 panel.
[06:42:28] <antto> inflex in my case the avr is part of an analog synth, and thus it has a complex sequencer..
[06:42:36] <inflex> specing: true, cheaper than trying to get a uC with a dedicated math unit
[06:42:42] <antto> buttons, leds, IO..
[06:42:51] <specing> inflex: nah, ARMs are cheap nowadays
[06:42:56] <Lambda_Aurigae> I've used the extra flash in my atmega1284p to hold text for menus, to hold lookup tables for sin/cos/tan/log, to hold web page..
[06:43:19] <specing> inflex: <3 unobtainium stellarises
[06:43:19] <antto> i don't really have much tables..
[06:43:36] <Lambda_Aurigae> and for large complex programs
[06:44:44] <Lambda_Aurigae> aaand, off to work.
[06:45:42] <antto> inflex https://www.youtube.com/watch?v=AL2Vej7UXCM
[06:46:00] <antto> those two things..
[06:47:02] <inflex> antto: those things are AVR driven?
[06:47:08] <antto> yes
[06:47:12] <inflex> very nice job.
[06:47:13] <antto> the sound is analog
[06:47:44] <antto> ehm, i didn't make the whole thing... i'm just h4x0rizing the firmware
[06:47:51] <inflex> A lot of sophisticated panel/switchwork there
[06:47:55] <inflex> oooh right *laugh*
[06:47:57] <antto> oh, and i made the front panel
[06:48:48] <antto> so it's mostly code, very few tables (mostly tables for ordering the LEDs)
[06:49:42] <antto> uses a lot of ram too i think
[06:49:51] <Pyrofer_> hello
[06:50:38] <Duality> hmm i see. so if i wanted to do a reset, i would have to reintialize everything my self? by doing a jump to the reset vector which then jumps to a subroutine which does that ?
[06:51:29] <Duality> i gues the watchdog timer is a really nice thing for when you programm "freezes" :)
[06:52:49] <Pyrofer_> can anybody help me with programming proglems, using usbasp programmer
[06:53:01] <Pyrofer_> *problems, excuse the spelling...
[06:53:05] <antto> ouch, usbasp
[06:53:20] <Pyrofer_> I get told the device id is 0000000
[06:53:30] <antto> Pyrofer_ is it one of the made-in-china ones?
[06:53:32] <inflex> Oddly, I have to admit, I've found the most enjoyment squeezing useful functionality out of the Attiny5 and 10
[06:53:37] <Pyrofer_> yeah, made in china
[06:53:47] <inflex> ( I found the 4 and 9 just too limited without the ADC )
[06:53:51] <twnqx> Duality: just don't rely on default in your program and initialize evrything anyway
[06:53:54] <Pyrofer_> ive used it ok before, the chip is running code
[06:53:58] <Pyrofer_> but it was over a year ago
[06:54:09] <Pyrofer_> and I can't work out why it says ID 0000000 now
[06:54:26] <antto> Pyrofer_ i have one too, it worked at first, then it began to act WTF on me
[06:54:44] <antto> the OS sees it as appearing and disappearing
[06:54:47] <Pyrofer_> I think it's a timing issue
[06:55:04] <antto> that happens on windows/linux and no matter which usb port or even on another computer
[06:55:06] <inflex> http://nqrc.com/images/PLD-BAC-55C.jpg <=- this was perhaps my most popular AVR project commercially. Stopped production 2 years ago, still have people wanting me to make them again :(
[06:55:43] <antto> Pyrofer_ i'd say throw it away and get something better
[06:56:33] <antto> inflex wut's that?
[06:57:17] <Duality> twnqx: not saying i rely on defaults :) i always initialize everything. just brainstorming some ideas i have thinking about what i think to know etc :)
[06:57:25] <inflex> antto: basically just a 2S lipo -> 5.5V linear regulator with low voltage alarm. Nothing more. Designed for competition hand-launched radio controlled gliders
[06:57:37] <inflex> ( 2S lipo is 8.4~7.2V )
[06:58:00] <antto> o_O .. i don't understand.. at all
[06:58:03] <inflex> it also blinked out the voltage of the pack so the people could see how much was left
[06:58:06] <Pyrofer_> assuming I want to use the programmer and not bin it quite yet...
[06:58:14] <Pyrofer_> I think previously I entered some timing commands
[06:58:17] <Pyrofer_> but no idea what they were
[06:58:19] <twnqx> is that a switching or a linear regulator?
[06:58:26] <inflex> twnqx: linear.
[06:58:31] <twnqx> Oo what a waste
[06:58:37] <Duality> inflex: why that :( ?
[06:58:37] <inflex> twnqx: actually, not really
[06:59:06] <antto> Pyrofer_ there was -B i think.. for adding some small delays between the bytes or something
[06:59:09] <inflex> twnqx: most of the time the unit only is pulling about 10mA, but then it gets bursts of 1~2A demand... switching reg ends up being less efficient
[06:59:21] <antto> Pyrofer_ i mean, -B for avrdude
[06:59:24] <twnqx> mh
[06:59:26] <Pyrofer_> tried a couple random -B values
[06:59:29] <inflex> ( because of the extended time in the idle state )
[06:59:34] <Pyrofer_> didn't get much. Had some random device ID some times
[06:59:41] <antto> Pyrofer_ how much did you try?
[06:59:43] <twnqx> i'd say 90% over the full range isn't unusual with these low drops, low currents...
[06:59:57] <Pyrofer_> i tried B5, B6, B10
[06:59:59] <inflex> twnqx: also, switching had problems with the generated RF, even with shielded parts, was larger, more expensive.
[07:00:03] <antto> try -B50 -B100 ;P~
[07:00:26] <twnqx> well yes, RF is a minor problem, larger for sure
[07:00:29] <antto> Pyrofer_ also, do you have a pic of the usbasp itself?
[07:00:40] <twnqx> and more expensive... yes, slightly
[07:00:41] <antto> because it really smells like it's the same as mine
[07:00:53] <Pyrofer_> warning: cannot set sck period. please check for usbasp firmware update
[07:01:05] <antto> yeah, how familiar
[07:01:12] <inflex> twnqx: RF was a major problem with some of receivers being used, strange behaviours
[07:01:19] <Pyrofer_> no pic handy, but it's a crap cheap chinese one I know
[07:01:29] <inflex> twnqx: actually, to be fair, it probably wasn't the RF, rather would be the ripple in the DC
[07:02:02] <antto> Pyrofer_ http://imagizer.imageshack.us/a/img547/3872/20130105131444.jpg ?
[07:02:10] <twnqx> that's just a matter of using more expensive capacitors :P
[07:02:17] <twnqx> and higher switching frequencies :D
[07:02:25] <Pyrofer_> heh, even cheaper than that
[07:02:36] <Pyrofer_> just a small PCB with a chip on it and a header on one end and USB on the other
[07:02:53] <inflex> End of the day, this unit proved to be a dependable solution that fit the bill.
[07:02:54] <twnqx> inflex: amusingly, i am just looking at lipo batteries :D
[07:03:01] <inflex> twnqx: for what purpose?
[07:03:05] <antto> does it have the same website address printed on it?
[07:03:18] <antto> betemcu.cn
[07:03:19] <twnqx> powering a PC addon that has no external source
[07:03:34] <inflex> twnqx: goign with single cell and boost reg?
[07:03:37] <Pyrofer_> yup, same url
[07:03:44] <twnqx> single cell, but ldo
[07:03:49] <twnqx> i just need 3.3V
[07:03:52] <antto> well then, welcome to the club
[07:04:00] <Duality> i wish caps were upto where lipos are :)
[07:04:01] <inflex> twnqx: oh, should be ample fine then.
[07:04:07] <inflex> Duality: how so?
[07:04:15] <twnqx> easier to use :P
[07:04:20] <twnqx> less aging, etc
[07:04:20] <antto> Pyrofer_ you know what i did? i gave up on it, and used the parallel port on my old PC
[07:04:23] <inflex> twnqx: though the 4.2V off charge will be fun
[07:04:32] <twnqx> i want to charge from USB
[07:04:39] <inflex> oh okay, I've done a lot of that
[07:04:55] <Pyrofer_> I know it worked previously as I have a programmed chip :(
[07:05:07] <antto> yes yes... mine worked too
[07:05:15] <antto> then i didn't use it for 1 month or so
[07:05:18] <inflex> http://nqrc.com/?vp=PLD-LICH-150
[07:05:23] <twnqx> inflex: you don't happen to have a public reference circuit? ...
[07:05:26] <inflex> Sorry, that was for twnqx
[07:05:33] <inflex> twnqx: sure, what sort of charge rate?
[07:05:58] <antto> and next time it started to cause USB problems in the OS, and basically is unusable (yet it functions, i even flashed the newest version of the firmware to it)
[07:05:59] <twnqx> well, i'd need schematics, as i need to fit everyrthing into the size of a dsub-15 case :P
[07:06:03] <Duality> inflex: because caps are awesome :)
[07:06:15] <inflex> twnqx: shouldn't be a problem at all
[07:06:19] <twnqx> http://shop.lipopower.de/150-mAh-37V-Einzelzelle-15C that battery probably (sorry for german)
[07:06:58] <Pyrofer_> so what programmer should I use?
[07:06:59] <Duality> Pyrofer_: are you sure you connected it right to the chip ?
[07:07:03] <twnqx> so, max 150mA charge current
[07:07:15] <Pyrofer_> only 6 wires, pretty damn sure they are correct...
[07:07:45] <antto> Pyrofer_ something better... a cheap variant is to use a computer with parallel port, and make yourself a small adapter for ISP (that's what i did)
[07:07:48] <Duality> well, i often was sure too,
[07:07:49] <inflex> twnqx: actually, 300mA
[07:07:55] <antto> or, a more proper AVR ISP
[07:08:11] <Duality> one that supports j-tag
[07:08:29] * Duality is still waiting for a cheap all in one programmer
[07:09:11] <antto> http://i.imgur.com/0m6Sk6E.jpg <- my franken-adapter ;]
[07:09:52] <Duality> antto: that is ... if you have a parallel port
[07:10:08] <antto> yeah, and it's probably the cheapest variant
[07:10:15] <Pyrofer_> pretty sure this is what I have http://www.ebay.co.uk/itm/USBASP-USBISP-AVR-Programmer-cable-for-KK2-0-KK2-1-Multiwii-/291080150284
[07:10:27] <myself> dapa works great, it's just slow
[07:10:35] <myself> totally adequate for flashing bootloaders and stuff
[07:10:36] <antto> because i needed to flash atmega2561 which afaik isn't supported by some of the older AVRISPs
[07:10:38] <Duality> usbasp is slow too
[07:10:43] <Pyrofer_> no parallel port on any of my machines handy. don't want to mess around making adapters either
[07:10:46] <Duality> now usbtiny that thing is nice and fast :)
[07:11:43] <antto> yeah, this looks equally as crap as mine
[07:11:55] <antto> mine just has a plastic box around it
[07:12:33] <antto> the chip on it works, as i said, i managed to put the newest firmware on it
[07:12:50] <Tom_itx> i'm rather partial to mine
[07:12:51] <antto> that didn't fix the issue at all tho, it still is unusable (yet blinks and what not)
[07:14:40] <Pyrofer_> well all the ones I am finding are the same essential cheap crap thing
[07:14:57] <Pyrofer_> only one I found so far that isn't, its a "Genius G540" multi programmer
[07:15:15] <Tom_itx> Pyrofer_, http://tom-itx.no-ip.biz:81/~webpage/boards/USBTiny_Mkii/USBTiny_Mkii_index.php
[07:15:56] <antto> Pyrofer_ don't search for "usbasp" but for "avr isp programmer" perhaps
[07:16:03] <antto> or what Tom_itx said ;P~
[07:16:15] <antto> just.. if it looks too chinese - skip it ;]
[07:18:00] <Pyrofer_> kicking myself for not writing down the command line I used last time
[07:18:23] <Tom_itx> did you add delay?
[07:18:28] <Tom_itx> -B32
[07:18:36] <Pyrofer_> yeah, i added stuff last time but can't remember what it was.
[07:19:08] <Pyrofer_> -b32 gives me random device ids
[07:19:10] <Tom_itx> http://tom-itx.no-ip.biz:81/~webpage/how_to/atmega168/using_avrdude_index.php
[07:22:17] <antto> i also didn't want to spend the money for a good programmer... but now i see.. it's like buying a cheap gun.. it can explode in your hand ;P~
[07:22:40] <antto> or just malfunction in general
[07:22:50] <myself> ehh, it'll frustrate you
[07:23:48] <antto> so i'm with the parallel port now... but if i ever buy a programmer again - i'd surely not even look at those cheap chinese pieces of crap >:(
[07:27:37] <Tom_itx> mine is being used on 2 or 3 production lines i know of
[09:16:00] <edmont> hi
[09:17:17] <edmont> why the serial programming 128k device bootloader flash write routine wouldn't work for a 256k device while program size < 128k?
[09:41:18] <antto> uhm..
[09:42:27] <antto> edmont are you asking why your programer can flash a chip with 128k flash but not a 256k one?
[09:50:39] <Tachyon`> know of any situations where an SPI.transfer would halt the arduino?
[09:52:22] <edmont> antto: yes
[09:52:36] <edmont> assuming i'm not using the upper 128k memory
[09:53:36] <antto> edmont oh, are you flashing using a bootloader on the chip (and thus via avrdude) or over ISP and a programmer?
[09:53:56] <edmont> bootloader
[09:54:06] <edmont> with ISP i dont have any problems
[09:54:21] <edmont> i'd like to use avrdude -c arduino
[09:59:48] <edmont> antto: my bootloader is based in this one: https://github.com/logos-electromechanical/Zigduino/blob/master/arduino/bootloaders/atmega/ATmegaBOOT_168.c
[10:03:05] <edmont> it works to the point it is passing through the flash writting routine (line 615)
[10:03:35] <edmont> but the thing is when i read the flash it's not modified
[10:03:46] <edmont> so something is going wrong there
[10:05:39] <antto> the bootloader "writes" the data onto the flash, but then when you read it back to veryfy - it turns out it hasn't?
[10:05:55] <edmont> yeah
[10:06:11] <antto> can you tell whether the bootloader modifies the data at all or not?
[10:06:17] <antto> is it all 0xFF or something?
[10:06:43] <edmont> yes, 0xFF
[10:07:03] <edmont> i'm using Atmega256RFR2
[10:07:17] <edmont> with Atmega128RFA1 it works great
[10:07:49] <edmont> i'm not interested in the extra flash but in the extra ram
[10:49:36] <Tachyon`> http://pastebin.com/F0Z8m6qQ <- My AVR code is halting on SPI access (at line 135 in this paste), does anyone know why, it's a 328P and the code worked on my 2560
[12:09:44] <TheArtist> Hello folks!! I'm building some project and i need some help. I am making this: http://www.bidouille.org/hack/nespadusb
[12:10:01] <TheArtist> i have everything connected in the breadboard
[12:10:17] <TheArtist> the pc detects the hid controller as a NES controller, all good
[12:10:37] <TheArtist> but in the test panel of the windows the only key that is responding is A
[12:10:47] <TheArtist> and when pressing A every button lights up
[12:10:51] <TheArtist> any ideas?
[12:31:26] <TheArtist> So no ideas at all?
[12:49:19] <Tachyon`> ah, a NES controller
[13:15:35] <chickensk> hi. i am having trouble configuring analog comparator on atmega8. anybody used it succesfully ?
[13:21:00] <Jordan_U> [
[13:29:24] <chickensk> do somebody know why low level on AIN1 (AIN0 with bandgap) toggles TIMER1 on ATMEGA8 constantly ?
[13:31:02] <Casper> maybe you setted timer1 to have it as a a clock source?
[13:32:54] <chickensk> Casper hi. timer1 has clock source /1024 from main clock
[13:39:15] <Duality> how do you program an avr with spi, how does a avr get programmed by spi?
[13:39:32] <Duality> the spi triggers a reset and then just sends the bytes that go into flash ?
[13:39:46] <Duality> or first sends address then the byte ?
[13:41:31] <Casper> it use spi yes, but there is a protocol
[13:41:35] <Casper> you still need a programmer
[13:42:09] <Duality> yes
[13:42:17] <Duality> but i want to know what the programmer actually sends out
[13:42:29] <Duality> inorder to program the chip :)
[13:43:55] <Casper> there is an handshake like stuff
[13:44:25] <Casper> then it will send a chip erase command, wait for it to complete, then issue a flash program command, and send the data somehow
[13:44:34] <Casper> it's described in the datasheet actually
[13:49:58] <Kev> http://www.atmel.com/images/doc0943.pdf
[14:00:08] <Duality> so what i understand from the document, is that the programmer keeps the reset line low through the whole programming thing ?
[14:13:59] <onr> is arduino uno r3 good enough as atmega328 programmer?
[14:42:03] <onr> i'm under the impression that the silence means "no"
[14:43:18] <Tachyon`> I think any arduino can be used as a programmer
[14:43:34] <Tachyon`> there's details on the arduino website at http://arduino.cc/en/Tutorial/ArduinoISP
[14:45:16] <Casper> onr: silence mean nobody was there that know the answer
[14:45:32] <Casper> and if you can talk from the pc to an AVR, then that avr can be used as a programmer
[14:52:50] <onr> thanks Tachyon`
[14:53:19] <onr> i should get a dedicated programmer for avr
[14:53:38] <Tachyon`> well, I just flash them with a bootloader then use a usb to ttl serial adapter
[15:23:44] <lilbilly> I'm using avrdude to flash an atmega168p. I'm getting an error when using atmega168p as the MCU name. The error is: error: MCU 'atmega168p' supported for assembler only
[15:24:29] <lilbilly> anyone know why I'm getting this error and how to fix it?
[16:04:17] <Kev> lilbilly, what version of avrdude are you using ?
[16:13:19] <umquant> anyone here pretty experienced with writing unit tests for their embedded applications?
[20:16:28] <N1njaneer> Hey again guys! Got logged out, forgot to log back in. X.x
[20:19:40] <Lambda_Aurigae> well, we were hoping..
[20:19:56] <N1njaneer> ... that I would be gone forever? :D
[20:23:22] <Lambda_Aurigae> I didn't say that!
[20:24:11] <N1njaneer> Hehehe
[20:24:30] <N1njaneer> So what is new with all of you?
[20:28:59] <Lambda_Aurigae> I just got a 4.74 dollar pay raise.
[20:29:10] <Lambda_Aurigae> and have a potential job offer for another 5.00 dollars on top of that.
[20:30:16] <Lambda_Aurigae> and, it's bedtime.
[20:30:18] <Lambda_Aurigae> laters.
[20:37:30] <N1njaneer> Awesome!
[22:21:39] <Jordan_U> I have a chip that I'm trying to program (and failing). Atmel Studio is complaining that "Target voltage appears to be below operating range for this device family". The chip is fresh from the board manufacturer, who revieved it directly from digikey and so it doesn't have any useful program on it currently. We're measuring the voltage to the chip at 3.3 Volts, but the voltage on the RESET pin is only 2.85 volts. Am I right in ...
[22:21:45] <Jordan_U> ... expecting the voltage on RESET to also be 3.3 Volts rather than 2.85? Any ideas what might be happening here?
[22:23:45] <Casper> too weak/missing pullup on reset?
[22:26:32] <Jordan_U> Casper: I'm seeing the same problem with two boards. I guess it's possible we recieved two bad chips, or that the two chips were damaged in the same way somehow.
[22:26:59] <Casper> or your programmer pull low the reset pin
[22:27:04] <Casper> partially
[22:27:21] <Jordan_U> Casper: I'm measuring without the programmer connected.
[22:27:40] <Casper> try to mesure from vcc to reset
[22:29:13] <Jordan_U> Casper: -1.47 Volts.
[22:29:52] <Casper> that is weird
[22:30:32] <Casper> the reason why I asked to do that mesurement is to rule out the possibility that your meter have a lower than expected impedance that screw the reading
[22:31:21] <Casper> something is officially wrong
[22:31:46] <Casper> it is possible that you got a defective batch
[22:31:55] <Casper> or... is it some china stuff?
[22:32:08] <Casper> from unofficial source?
[22:32:46] <Jordan_U> Casper: From Digikey, definitely official.
[22:34:01] <Casper> yeah
[22:34:09] <Casper> I'ld say a bad batch
[22:40:39] <Jordan_U> Casper: I would hope that Atmel would have better QA than that, especially for an automotive grade chip (ATMega64M1-15AZ).
[22:41:43] <Casper> do you want them 100% tested? if so pay 100+$ per chip
[22:42:19] <Jordan_U> Casper: Do you have experience with recieving defective AVR chips?
[22:42:32] <Casper> nope
[22:42:45] <Casper> they are normally reliable
[22:43:15] <Jordan_U> Casper: Can you think of any way this could be our fault? (I'm hoping it is)
[22:45:01] <Casper> overvoltage on reset or negative voltage or ESD
[22:45:35] <jacekowski> reset is supposed to survive 12V
[22:45:55] <jacekowski> that's how HVP is enabled
[22:46:27] <jacekowski> but maybe reset pin is disabled
[22:47:27] <Jordan_U> jacekowski: Would it come from digikey that way?
[22:47:55] <jacekowski> unlikely
[22:49:03] <Jordan_U> jacekowski: And disabled in what way? I would expect that if it were disabled via fuse bits I'd still either be getting no pull or 3.3 volts, not 2.85 volts.
[22:50:47] <Casper> the 2.85 is what puzzle me
[22:51:12] <Casper> I wonder if they installed a resistor instead of a cap...
[22:54:54] <jacekowski> Jordan_U: with highZ input you can get anything