Newbie experiences with USBtinyISP

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
User avatar
dataman
 
Posts: 98
Joined: Wed May 20, 2009 7:03 pm

Newbie experiences with USBtinyISP

Post by dataman »

Just a repeat from my blog today.
I couldn't find this well documented anywhere:

Burning a booltloader to an ATmega328 using a Duemilanove and a USBtinyISP

Just wanted to recount some of hair-pulling experiences of the last day.
I built my USBtinyISP when I first got into Arduinos, thinking this was the primary programming route.
It's sat on my shelf for the last 6 months, as this is really the atypical programming route.

Why you'd ever want to burn a bootloader?
ATmega328's come blank from the chip factory,
The Arduino folks load bootloaders onto the 328s to
allow them to accept program over the simpler USB port.
Without a bootloader, the chip will only talk to the more complex ICSP port.
And for that you need a programmer, like the USBtinyIsp.
Kits avaialble at Adafruit:
http://http://www.adafruit.com/index.ph ... ucts_id=46
USBtinyISP.jpg
USBtinyISP.jpg (75.89 KiB) Viewed 4922 times
First, a sanity check:
1) To program a Duemilanove, you'll need the 6 pin cable, it's built as shown upper left.
Both males facing up.
2) The 6 pin cable was removed for clairty puposes.
3) Note the power jumper is in place to provide external power.
4) Read the last step of assembly instructions, you want replace R7 & R4 with jumpers for general use.
5) Get your drivers loaded and configured: (http://www.ladyada.net/make/usbtinyisp/use.html)
6) Connect programmer, you should have a solid green light.
The red light does not come on until programming begins.

USBtinyISP2.JPG
USBtinyISP2.JPG (89.68 KiB) Viewed 4922 times
Next, the double-back-flip:

1) The programming cable plugs into the 6-pin ICSP header reversed.
You can confirm this as the PWR led should be lit on the Duemilanove.
USBtinyISP3.jpg
USBtinyISP3.jpg (99.17 KiB) Viewed 4922 times
Watch it, here' comes the second back flip.

2) Nearly every chip in the world is inserted with its notch to the left, that's pin 1 afterall.
I was also lulled into a false sense of security with the lovely "ATMEGA328" printed across my chip.
So, I popped that one out and popped a blank 328p in, missing that the notch points to the RIGHT.
Didn't kill the CPU, but a full day of debugging why the TinyISP wasn't working.
Flipped the CPU around, and everything worked first shot.
Second back flip? Match the notch!

The rest are commands straight out of LadyAda's manual:

avrdude -c tinyisp -p m8
"Initialization failed, rc=-1" is expected (THAT'S GOOD!) if nothing is connected, or the CPU is in backwards.
"Could not find USB device" means you're not talking at all.

avrdude -c tinyisp -p m328p
"AVR device initialized and ready to accept insructions" is very good.
Means you're ready to program your 328.

Start Arduino Studio,
Select Tools | Board | "Arduino Duemilanove or Nano w/ATmega 328"
Select Tools | Burn Bootloader | w/USBtinyISP

You should observe in the status area:
Burning bootloader to I/O Board (this may take a minute)...
Then:
Done burning bootloader.

That should do it.

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

Re: Newbie experiences with USBtinyISP

Post by adafruit »

nice tutorial!

willy
 
Posts: 1
Joined: Wed Nov 11, 2009 12:33 am

Re: Newbie experiences with USBtinyISP

Post by willy »

Thanks. Great tutorial. Just days ago I was just struggling with the same thing and was amazed at how difficult this information was to find. So if I understand this correctly - in order to program an Arduino board via the USB port, you need to burn the bootloader on the chip? I've been going thorugh the awesome Arduino tutorials on ladyada.net and this was the only stumbling block I had. I finally chose this option and all of the sudden, I was able to program via the USB port. One question that has been nagging me is - can you use the tinyisp to do the actual programming of the chip in the Arduino environment? I haven't been able to get that to work even though I can burn the bootloader. It does work great in the Win-AVR envirnoment. I used it to program several other kits that I put together.

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

Re: Newbie experiences with USBtinyISP

Post by adafruit »

Arduinos should be preprogrammed with a bootloader. the IDE cant easily use the usbtiny to program a sketch, just the bootloader

dagb
 
Posts: 2
Joined: Fri Sep 14, 2012 5:23 pm

Re: Newbie experiences with USBtinyISP

Post by dagb »

adafruit wrote:Arduinos should be preprogrammed with a bootloader. the IDE cant easily use the usbtiny to program a sketch, just the bootloader
3 years later, is this still the case?

Dag B

tiloldar
 
Posts: 15
Joined: Sun Feb 08, 2009 6:43 pm

Re: Newbie experiences with USBtinyISP

Post by tiloldar »

select USBtiny from tools>programmer>USBtinyISP
Then I have had no problem uploading sketches
using File>upload using programmer
Arduino 1.0.1
Tilo

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

Return to “USBtinyISP”