TinyAVR, AVR Dragon, and BusPirate - Page 1
Forum section: electronics / beginners

author: selkathguy
author_rank: Unknown
timestamp: April 08, 2013, 06:52:25 am
content: Is it possible to program the TinyAVR 85 (8-DIP) using an AVR Dragon?Right now I have it set up with a BusPirate to check and see if I can get it to respond to SPI programming commands.The TinyAVR documentation indicates how to program it over SPI, and I'm pretty sure I've got it hooked up correctly with the AUX output on the BusPirate controlling the nRESET on the TinyAVR.The documentation says it should echo back 0x53 when issuing 3rd of the 4-byte Programming Enable command after the chip is powered up with the nRESET line held low. I do this but I get no echo back.Edit for clarity: I would like to program using the AVR Dragon. However, I just wanted to see if I could talk to it since I can't figure out how to connect it up to the Dragon. This post is me asking how to hook this microcontroller up to the AVR Dragon, but also curious why my attempts to communicate with it via the BusPirate have failed.BusPirate:Note: CS is not connected here.Code:SPI>ca/A/@ controls AUX pinSPI>aAUX LOWSPI>[0xACr 0x53r 0x00r 0x00r][0xACr 0x53r 0x00r 0x00r]/CS ENABLEDWRITE: 0xACREAD: 0x00WRITE: 0x53READ: 0x00WRITE: 0x00READ: 0x00 <<<--------------WRITE: 0x00READ: 0x00/CS DISABLEDBusPirate Connections (image):http://puu.sh/2w8dBCan I just use my AVR Dragon to program the Tiny? I haven't found a lot of documentation or tutorials. I'm a newbie so I could be going about this all wrong. Does anyone have experience programming a TinyAVR with an AVR Dragon? Any pointers would be greatly appreciated!

author: TerminalJack505
author_rank: Super Contributor
timestamp: April 08, 2013, 08:16:18 am
content: Yes, you can use an AVR Dragon to program an ATtiny85. Use the ISP header on the Dragon. Just hook those 6 pins to the appropriate signals on the ATtiny.ISP Header Pin ATtiny85 Pin=============== ============1 - MISO 6 - MISO2 - VTG 8 - VCC3 - SCK 7 - SCK4 - MOSI 5 - MOSI5 - RESET# 1 - RESET#6 - GND 4 - GND

author: Phroon
author_rank: Contributor
timestamp: April 08, 2013, 12:14:51 pm
content: The nice folks at Evil Mad Scientist have a nicewriteup on the pin outs and connections necessaryfor in system programming. It's the same information TerminalJack505 listed, but with a few more pictures. Handy for people like me who keep forgetting how to do it.

author: selkathguy
author_rank: Unknown
timestamp: April 08, 2013, 12:58:02 pm
content: Quote from: TerminalJack505 on April 08, 2013, 08:16:18 amYou are amazing, thank you. I don't know why I didn't think those pins would work.I will try this as soon as I am home from work.Quote from: Phroon on April 08, 2013, 12:14:51 pmThis minimalist target board for programming is precisely what I was trying to make. Bookmarked and thank you!

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: April 08, 2013, 01:48:39 pm
content: Just a shot in the dark, but check that you did toggle the bus pirates power pin on?

author: selkathguy
author_rank: Unknown
timestamp: April 08, 2013, 02:00:06 pm
content: Quote from: HackedFridgeMagnet on April 08, 2013, 01:48:39 pmMhm, I accidentally left it out of the terminal input, but yeah I used 'W' to switch on the VREG for Vcc and made sure that the SPI logic levels were at 3v3 and not 5v. Also made sure to set the serial clock to the correct sampling edge phase and polarity. I don't expect too many problems when I get home and try it with the AVR Dragon, but I was just curious why it wasn't responding if it is simple SPI. I suppose I am using the BusPirate as a confidence-building exercise to test whether or not I understand how things are working.

author: MacAttak
author_rank: Unknown
timestamp: April 08, 2013, 05:40:37 pm
content: You didn't by chance set the debugwire fuse bit did you? That will prevent programming until you unset it. I haven't tried sending direct SPI commands, but when using Atmel Studio and my programmer (jtagice3) it would always abort any attempts to upload a program while debugwire was enabled on the device. Debugwire is a really nice feature, just have to always remember to turn it back off when done.

author: selkathguy
author_rank: Unknown
timestamp: April 08, 2013, 06:10:43 pm
content: Quote from: MacAttak on April 08, 2013, 05:40:37 pmThese TinyAVRs are right out of the tube from the factory. I have not programmed any of them. So no lock bits should be set, and SPIEN should be set by default. At least according to the documentation they should.

author: Phroon
author_rank: Contributor
timestamp: April 09, 2013, 03:22:23 am
content: Looks like the Bus Pirate is supported as an AVR programmer by AVRDUDE:http://dangerousprototypes.com/docs/Bus_Pirate_AVR_ProgrammingThey use a different pinout than what you have, with CS on the !Reset pin.