Programming my First AVR

USB AVR Programmer and SPI interface. Adafruit's USBtinyISP.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
adamjon858
 
Posts: 1
Joined: Sat Nov 17, 2007 1:14 pm

Programming my First AVR

Post by adamjon858 »

I'm trying to program my first AVR and I believe I have all the right tools/components, although I'm not entirely sure how to use them correctly.

I'm programming a ATtiny2313 with the following:
-Olimex AVR-P20 Board
-USBTinyISP

USBTiny: http://www.ladyada.net/make/usbtinyisp/index.html

Olimex: http://www.olimex.com/dev/avr-p20.html

I have the USBTinyISP drivers correctly installed and setup with AVRdude. When I plug it in via USB the green light on the programmer lights up. When I try using "avrdude -c usbtiny -p t2313" it gives me the error "...initialization failed, rc=-1.."

From what I've gathered, this error means that AVRdude acknowledges the programmer but senses that it is not connected to a board/chip.

Next, while the USBtiny is still plugged into USB, I plug a 9V DC wall adapter into the Olimex board and connect the USBtiny to the ICSP header on the Olimex board. Then I run the command: "avrdude -c usbtiny -p t2313". I get back "Could not find USB Device...". I've tried this numerous times to no avail. I have noticed that when I plug in the olimex board and connect the USBtiny to it and connnect the Usbtiny to my computers USB port as the LAST step, the usbtiny's green LED does not go on and I get no response from Avrdude again.

I'm pretty sure the ATtiny2313 is properly socketed in the olimex board and everything appears to be working (I tried testing some points with a multimeter even though I dont' know what I'm doing). I'm guessing the problem lies some how with the USBtiny?

Furthermore, the JP3 jumper is left open on the USBtiny (as the olimex board is powering the chip). The 3.3v jumper on the olimex board is also left open along with the LED jumper.


Thanks in advance for the help! You guys rock.

If we can't figure this out without pictures, I'd be happy to post some, although I don't think they'll help much. I do have a webcam so if anyone was willing to do a video chat with me and observe what I was doing in real time that would probably be the best option.

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: Programming my First AVR

Post by adafruit »

adamjon858 wrote:I'm trying to program my first AVR and I believe I have all the right tools/components, although I'm not entirely sure how to use them correctly.

I'm programming a ATtiny2313 with the following:
-Olimex AVR-P20 Board
-USBTinyISP

USBTiny: http://www.ladyada.net/make/usbtinyisp/index.html

Olimex: http://www.olimex.com/dev/avr-p20.html

I have the USBTinyISP drivers correctly installed and setup with AVRdude. When I plug it in via USB the green light on the programmer lights up. When I try using "avrdude -c usbtiny -p t2313" it gives me the error "...initialization failed, rc=-1.."

From what I've gathered, this error means that AVRdude acknowledges the programmer but senses that it is not connected to a board/chip.
correct
Next, while the USBtiny is still plugged into USB, I plug a 9V DC wall adapter into the Olimex board and connect the USBtiny to the ICSP header on the Olimex board. Then I run the command: "avrdude -c usbtiny -p t2313". I get back "Could not find USB Device...". I've tried this numerous times to no avail. I have noticed that when I plug in the olimex board and connect the USBtiny to it and connnect the Usbtiny to my computers USB port as the LAST step, the usbtiny's green LED does not go on and I get no response from Avrdude again.
make sure the jumper is not placed while you're also powering the target sepeartely. it will screw up the usbtiny because its shorting the usb computer power to the 9v power. not good!

if you get the 'initialization failed' response then you should start from there and try to figure out why the board isnt responding. check the wiring and see if maybe they use a non-standard pinout.

User avatar
marburg
 
Posts: 3
Joined: Wed Nov 21, 2007 12:27 am

Post by marburg »

Sadly, add me as a "me too"

Setup: usbtiny, Windows connected to an Olimex P40-8535 board with an Olimex AVR-M16 (makes a SMD Atmega16 into a DIP Atmega16). Running the dev board from a 12VDC wall wart to the Olimex board, and confirmed 5VDC to the Atmega16.

Plug USB into usbtiny with dev board unpowered: good comms ("initialization failed...")

Then plug in dev board: "Could not find USB device"

Various combinations of plugging/unplugging USB and dev board power in different orders yields consistent results: if the dev board is powered, the USBtiny doesn't enumerate as a good USB device.

I've confirmed the 5V net on the Olimex is not connected to VCC on the USB tiny. I'd believe some sort of power/ground bus bounce when I power the Olimex, but I don't think this addresses the case where you first power the dev board, then plug USB into the USBtiny.

EDIT: Just succeeded in programming the Atmega16 by using the usbtiny to power it (jumper on JP3). So as long as I'm careful I should be able to switch between the DC power for testing and USB power for programming. Not an ideal situation, sigh.

Locked
Please be positive and constructive with your questions and comments.

Return to “USBtinyISP”