AVR Programmer
micahp
Posts: 11
This is a prop AVR programmer following the AVR910 protocol. It is pretty rough but with a little work it can be cleaned up and made into a proper prop object. I've only tested it on a Atmega168 using avrdude 5.3 on OSX.
To get it to support another AVR processor add the processor code in the ch == "t" area (e.g., ser.tx( $MyCode ) (the specific processor code can be found in the avrdude.conf file).
Hope you find this useful.
To get it to support another AVR processor add the processor code in the ch == "t" area (e.g., ser.tx( $MyCode ) (the specific processor code can be found in the avrdude.conf file).
Hope you find this useful.
spin
7K
Comments
Load Instructions
Load Extended Address byte(1) $4D $00 Extended adr $00
Load Program Memory Page, High byte $48 $00 adr LSB high data byte in
Load Program Memory Page, Low byte $40 $00 adr LSB low data byte in
Load EEPROM Memory Page (page access) $C1 $00 0000 000aa data byte in
Read Instructions
Read Program Memory, High byte $28 adr MSB adr LSB high data byte out
Read Program Memory, Low byte $20 adr MSB adr LSB low data byte out
Read EEPROM Memory $A0 0000 00aa aaaa aaaa data byte out
Read Lock bits $58 $00 $00 data byte out
Read Signature Byte $30 $00 0000 000aa data byte out
Read Fuse bits $50 $00 $00 data byte out
Read Fuse High bits $58 $08 $00 data byte out
Read Extended Fuse Bits $50 $08 $00 data byte out
Read Calibration Byte $38 $00 $00 data byte out
Write Instructions(6)
Write Program Memory Page $4C adr MSB adr LSB $00
Write EEPROM Memory $C0 0000 00aa aaaa aaaa data byte in
Write EEPROM Memory Page (page access) $C2 0000 00aa aaaa aa00 $00
Write Lock bits $AC $E0 $00 data byte in
Write Fuse bits $AC $A0 $00 data byte in
Write Fuse High bits $AC $A8 $00 data byte in
Write Extended Fuse Bits $AC $A4 $00 data byte in
I use the following options for avrdude:
avrdude -p t25 -c avr910 -v -P -F com5 -e -U flash[noparse]:w:[/noparse]first.hex
But I get the following response:
avrdude: error: programmer did not respond to command: select device
Does anybody has a clue whats wrong?
It's hard to find the protocol going from avrdude to the programmer. The AVR910 docs seem to only give the programmer to avr protocol... so I'm a bit lost. I've been using the avr910.c portion of the avrdude sources to figure out bits and pieces... but it's tedious.
Anyone else using this, or know anything that may help?
Usually the only way to resusitate them is the high volts programming method and not the ISP, as they are probably in the External clk or 32KHz mode. Couldn't be ***** to build one, chucked them, they're so cheap.
Ponyprog and the fuse calculator are my favourates.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Style and grace : Nil point
Post Edited (Toby Seckshund) : 8/11/2009 8:11:04 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
Get a $49 USD Atmel AVR Dragon from Mouser or Digi-Key. Dragon supports ISP/HVSP/JTAG/D-wire. Jumper the Dragon for HVSP, stick in your "dead" little AVRs, and bring them back to life in a matter of seconds using AVR Studio via FLIP (both free, see Atmel site). As a bonus, the Dragon also supports JTAG and D-Wire in-circuit debug for all parts with 32kB flash and less!
Small AVR's are dirt cheap compared with the Propeller and with AVR Studio plus WinAVR you get a free un-crippled fully polished and supported IDE with debug, simulator, assembler, and GNU C/C++. That means you have double-precision floating point with AVRs (Yippee!)
Not to say the Propeller doesn't have its merits too! I love the Propeller and use it all the time. They're really different parts for different jobs IMHO.
I don't want to start a Propeller vs. AVR war. I just don't want to see anyone with a pile of "dead" AVR's in their junk box because of clobbered fuses or lock bits. They're likely not really dead
Post Edited (Drone) : 8/11/2009 9:01:10 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
For me, the past is not over yet.
Thanks Drone!· Looks like·I need to get a·Dragon.· I have "killed" a number of ATTiny45's that may not actually be dead [noparse];)[/noparse]
·
/me wonders if micahp = picogui's micah?
I've often wondered why there isn't a board that will program MCUs from different companies considering that so many of the simple programmers you find online are simply a PIC or AVR with a program like the one posted. Wouldn't be hard to detect, communicate, or switch between (jumper) target modes.
James: I've not used it yet, but I'd be happy to get a USBlyzer dump for you. Unfortunately, I don't have any AVR chips other than the one (and only) within my Arduino. If you feel like posting me a cheapo ATTiny I could send you the log. Or, if you're on Windows you could try out USBlyzer yourself- IIRC they have a free trial.
My one thought about Prop vs AVR: Different controllers for different projects. You can get PICs for as little as $0.35, pretty capable PIC16FXXs for $0.50, or an Atmega attiny for $2. I'm happy to spend $1 for a controller to stick inside a friend's card to do some silly LED blinkenlights, but there's no way I'd stick a Propeller in there. Not unless it was a Protoboard that happened to be the actual gift. :P
I'd never waste a $8 Propeller on a toss-away project. Heck, I wouldn't waste a $4 MCU on one. But there are still plenty of fun little projects needing a only a small controller at the helm. OK- I'm done.
Post Edited (RevAaron) : 8/11/2009 4:56:36 PM GMT
I'm trying to do a USB gamepad HID device as cheap as I can. I wouldn't mind going with the prop(, but for some reason I've turned down the prop-usb in my head... not sure atm why....
Ohh and there are such things as Universal Device Programmers that will program everything from EPROMs to FPGAs to Pics to AVRs etc.... I saw one with 20000 supported devices.... only $700 [noparse];)[/noparse]
Post Edited (James Newman) : 8/11/2009 5:38:59 PM GMT
http://www.mcselec.com/index.php?option=com_content&task=view&id=14&Itemid=41
The Bascom demo version does not expire, and it works with all the common programming hardware. I much prefer it to PonyPro and AvrDude. Never had a chip go bad from a fuse setting using that setup.
Well, I played around with it last night and it seems to be programming the fuses right. I'm still having problems though. I set the 2313s lfuse to 0xEF, and can't ever get it to run from crystal. I can generate a signal from the prop and reprogram it back to 0x64 and run the internal just fine. Finally, I figured maybe I'm setting the fuses to the wrong values... since I'm able to bring it back with an external clock... so I set lfuse to 0x00. Still no crystal, and now it required a really high clock from the prop, due to the divide by 8.
Anyway, I had been questioning my capacitors on the crystal for a while... I wanted 20p, but I think I'm way off. The site I had been using for quick reference for values had my 472s as 20p... but after thinking about it, that's obviously wrong. So I'ma find some 20p caps and see if that works.
Now I exclusively use TTL crystal oscillators as opposed to discrete crystals...· they're available in std through hole DIP package and are only $1 - $2.· The benefit is they are full clock circuts, so you apply vcc and get a no hassle clock signal out that feeds the avr external clock pin, no fussy capactiors required.· In fact, if ever a fuse was improperly programmed, these oscillators function as a clock so you can still communicate.
edit - Example datasheet:
http://www.ecsxtal.com/store/pdf/ecs_100.pdf
Post Edited (Agent420) : 8/12/2009 6:51:01 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Style and grace : Nil point
http://www.microsoft.com/windows/virtual-pc/download.aspx
So... ummm the universal command works, and fuses write just fine.
123456
All help apriciated
THanks
Igor