USBtiny with atmega328: How to hookup, and Avrdude 5.5

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

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
soerena
 
Posts: 57
Joined: Fri Nov 16, 2012 7:00 am

USBtiny with atmega328: How to hookup, and Avrdude 5.5

Post by soerena »

Hi,

I'm on Mac OSX 10.7 (Mountain)

I've build the UsbTiny 2.0 (spokepov dongle) programmer, and the green LED lights up when it's connected.

I followed option 1 here: http://www.ladyada.net/learn/avr/setup-mac.html) and installed the AvrMacPack (from here http://www.obdev.at/products/crosspack/download.html)
Then I went ahead and followed these steps: http://www.ladyada.net/learn/avr/avrdude.html
When in the terminal, I write "avrdude -c asdf" (to get a list of the supported programmers) I don't see USBTiny anywhere.. All I see is this:

Code: Select all

Valid programmers are:
  dasa3    = serial port banging, reset=!dtr sck=rts mosi=txd miso=cts [/usr/local/etc/avrdude.conf:563]
  dasa     = serial port banging, reset=rts sck=dtr mosi=txd miso=cts [/usr/local/etc/avrdude.conf:550]
  siprog   = Lancos SI-Prog <http://www.lancos.com/siprogsch.html> [/usr/local/etc/avrdude.conf:537]
  ponyser  = design ponyprog serial, reset=!txd sck=rts mosi=dtr miso=cts [/usr/local/etc/avrdude.conf:524]
  pavr     = Jason Kyle's pAVR Serial Programmer [/usr/local/etc/avrdude.conf:495]
  dragon_dw = Atmel AVR Dragon in debugWire mode [/usr/local/etc/avrdude.conf:488]
  dragon_hvsp = Atmel AVR Dragon in HVSP mode  [/usr/local/etc/avrdude.conf:480]
  dragon_pp = Atmel AVR Dragon in PP mode    [/usr/local/etc/avrdude.conf:472]
  dragon_isp = Atmel AVR Dragon in ISP mode   [/usr/local/etc/avrdude.conf:464]
  dragon_jtag = Atmel AVR Dragon in JTAG mode  [/usr/local/etc/avrdude.conf:456]
  jtag2dw  = Atmel JTAG ICE mkII in debugWire mode [/usr/local/etc/avrdude.conf:448]
  jtag2isp = Atmel JTAG ICE mkII in ISP mode [/usr/local/etc/avrdude.conf:440]
  jtag2    = Atmel JTAG ICE mkII            [/usr/local/etc/avrdude.conf:432]
  jtag2fast = Atmel JTAG ICE mkII            [/usr/local/etc/avrdude.conf:424]
  jtag2slow = Atmel JTAG ICE mkII            [/usr/local/etc/avrdude.conf:416]
  jtagmkII = Atmel JTAG ICE mkII            [/usr/local/etc/avrdude.conf:408]
  jtag1slow = Atmel JTAG ICE (mkI)           [/usr/local/etc/avrdude.conf:401]
  jtag1    = Atmel JTAG ICE (mkI)           [/usr/local/etc/avrdude.conf:393]
  jtagmkI  = Atmel JTAG ICE (mkI)           [/usr/local/etc/avrdude.conf:385]
  avr911   = Atmel AppNote AVR911 AVROSP    [/usr/local/etc/avrdude.conf:379]
  avr109   = Atmel AppNote AVR109 Boot Loader [/usr/local/etc/avrdude.conf:373]
  butterfly = Atmel Butterfly Development Board [/usr/local/etc/avrdude.conf:367]
  usbasp   = USBasp, http://www.fischl.de/usbasp/ [/usr/local/etc/avrdude.conf:361]
  avr910   = Atmel Low Cost Serial Programmer [/usr/local/etc/avrdude.conf:355]
  stk500hvsp = Atmel STK500 V2 in high-voltage serial programming mode [/usr/local/etc/avrdude.conf:349]
  stk500pp = Atmel STK500 V2 in parallel programming mode [/usr/local/etc/avrdude.conf:343]
  stk500v2 = Atmel STK500 Version 2.x firmware [/usr/local/etc/avrdude.conf:337]
  stk500v1 = Atmel STK500 Version 1.x firmware [/usr/local/etc/avrdude.conf:331]
  stk500   = Atmel STK500                   [/usr/local/etc/avrdude.conf:325]
  avrisp2  = Atmel AVR ISP mkII             [/usr/local/etc/avrdude.conf:315]
  avrispmkII = Atmel AVR ISP mkII             [/usr/local/etc/avrdude.conf:309]
  avrispv2 = Atmel AVR ISP V2               [/usr/local/etc/avrdude.conf:303]
  avrisp   = Atmel AVR ISP                  [/usr/local/etc/avrdude.conf:297]
Hmm.. So I dare not venture any further in my process, since I'm not even sure if it's going to work.

Other notes:
I didn't install any drivers, since it says here: http://learn.adafruit.com/usbtinyisp/drivers that it's not necessary.
I didn't install any of the hardware/firmware stuff. S
I have installed xcode and the tools to be able to do a "make".

Thanks in advance
Søren

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: USBtiny with atmega328: How to hookup, and Avrdude 5.5

Post by adafruit_support_rick »

Seems like you don't have the correct avrdude.conf installed. Or you don't have it installed in the right place.
Double check the USBtiny instructions here:
http://learn.adafruit.com/usbtinyisp/download

I know it says that usbtiny should be installed already in avrdude 5.5. But your avrdude.conf looks truly ancient - it's missing lots more things than just usbtiny.

Here's what I get from that same command - you can see that there's a big difference (I'm also running MacOSX 10.7.5)

Code: Select all

Valid programmers are:
  c2n232i  = serial port banging, reset=dtr sck=!rts mosi=!txd miso=!cts [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:791]
  dasa3    = serial port banging, reset=!dtr sck=rts mosi=txd miso=cts [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:778]
  dasa     = serial port banging, reset=rts sck=dtr mosi=txd miso=cts [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:765]
  siprog   = Lancos SI-Prog <http://www.lancos.com/siprogsch.html> [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:752]
  ponyser  = design ponyprog serial, reset=!txd sck=rts mosi=dtr miso=cts [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:739]
  pavr     = Jason Kyle's pAVR Serial Programmer [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:710]
  dragon_pdi = Atmel AVR Dragon in PDI mode   [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:703]
  dragon_dw = Atmel AVR Dragon in debugWire mode [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:695]
  dragon_hvsp = Atmel AVR Dragon in HVSP mode  [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:687]
  dragon_pp = Atmel AVR Dragon in PP mode    [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:679]
  dragon_isp = Atmel AVR Dragon in ISP mode   [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:671]
  dragon_jtag = Atmel AVR Dragon in JTAG mode  [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:663]
  jtag2pdi = Atmel JTAG ICE mkII PDI mode   [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:655]
  jtag2avr32 = Atmel JTAG ICE mkII im AVR32 mode [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:647]
  jtagmkII_avr32 = Atmel JTAG ICE mkII im AVR32 mode [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:639]
  jtag2dw  = Atmel JTAG ICE mkII in debugWire mode [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:631]
  jtag2isp = Atmel JTAG ICE mkII in ISP mode [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:623]
  jtag2    = Atmel JTAG ICE mkII            [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:615]
  jtag2fast = Atmel JTAG ICE mkII            [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:607]
  jtag2slow = Atmel JTAG ICE mkII            [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:599]
  jtagmkII = Atmel JTAG ICE mkII            [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:591]
  jtag1slow = Atmel JTAG ICE (mkI)           [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:584]
  jtag1    = Atmel JTAG ICE (mkI)           [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:576]
  jtagmkI  = Atmel JTAG ICE (mkI)           [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:568]
  butterfly_mk = Mikrokopter.de Butterfly       [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:562]
  mkbutterfly = Mikrokopter.de Butterfly       [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:556]
  avr911   = Atmel AppNote AVR911 AVROSP    [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:549]
  avr109   = Atmel AppNote AVR109 Boot Loader [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:543]
  butterfly = Atmel Butterfly Development Board [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:537]
  usbtiny  = USBtiny simple USB programmer, http://www.ladyada.net/make/usbtinyisp/ [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:531]
  usbasp   = USBasp, http://www.fischl.de/usbasp/ [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:525]
  avr910   = Atmel Low Cost Serial Programmer [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:519]
  stk600hvsp = Atmel STK600 in high-voltage serial programming mode [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:513]
  stk600pp = Atmel STK600 in parallel programming mode [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:507]
  stk600   = Atmel STK600                   [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:501]
  stk500hvsp = Atmel STK500 V2 in high-voltage serial programming mode [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:495]
  stk500pp = Atmel STK500 V2 in parallel programming mode [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:489]
  stk500v2 = Atmel STK500 Version 2.x firmware [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:483]
  mib510   = Crossbow MIB510 programming board [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:477]
  stk500v1 = Atmel STK500 Version 1.x firmware [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:471]
  stk500   = Atmel STK500                   [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:465]
  buspirate = The Bus Pirate                 [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:455]
  avrisp2  = Atmel AVR ISP mkII             [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:449]
  avrispmkII = Atmel AVR ISP mkII             [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:443]
  avrispv2 = Atmel AVR ISP V2               [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:437]
  avrisp   = Atmel AVR ISP                  [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:431]
  jtagkey  = Amontec JTAGKey, JTAGKey-Tiny and JTAGKey2 [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:408]
  2232HIO  = FT2232H based generic programmer [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:382]
  avrftdi  = FT2232D based generic programmer [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:355]
  arduino  = Arduino                        [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:335]
  wiring   = Wiring                         [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:329]

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: USBtiny with atmega328: How to hookup, and Avrdude 5.5

Post by adafruit_support_rick »

See this thread - it shows how to get the current directory for avrdude.conf
http://www.adafruit.com/forums/viewtopi ... 52&t=43565

User avatar
soerena
 
Posts: 57
Joined: Fri Nov 16, 2012 7:00 am

Re: USBtiny with atmega328: How to hookup, and Avrdude 5.5

Post by soerena »

Seems like you don't have the correct avrdude.conf installed. Or you don't have it installed in the right place.
Double check the USBtiny instructions here:
http://learn.adafruit.com/usbtinyisp/download

I know it says that usbtiny should be installed already in avrdude 5.5. But your avrdude.conf looks truly ancient - it's missing lots more things than just usbtiny.


Just to get one thing clear: when I install the newest MacAvrPack from here http://www.obdev.at/products/crosspack/download.html, does it also install the avrdude.conf files by itself, or do I need to do this manually afterwards ?

I just tried installing the Mac OS X Intel binaries version v5.4 into /"myusername"/local/etc and /"myusername"/local/bin, but this didn't do anything.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: USBtiny with atmega328: How to hookup, and Avrdude 5.5

Post by adafruit_support_rick »

You might have to install avrdude.conf directly into the Arduino application package.
In the Finder, right-click on your Arduino app and select 'Show Package Contents'.
Navigate down to Resources/Java/hardware/tools/avr/etc. Drop the new avrdude.conf in there.

User avatar
soerena
 
Posts: 57
Joined: Fri Nov 16, 2012 7:00 am

Re: USBtiny with atmega328: How to hookup, and Avrdude 5.5

Post by soerena »

You might have to install avrdude.conf directly into the Arduino application package.
In the Finder, right-click on your Arduino app and select 'Show Package Contents'.
Navigate down to Resources/Java/hardware/tools/avr/etc. Drop the new avrdude.conf in there.
I already installed the Mac OS X Intel binaries version v5.4 into the arduino folders that you mention, but this doesn't seem to do anything.

I don't quite get how installing avrdude into the arduino app has anything to do with using avrdude inside terminal. Is avrdude constantly using arduino somehow?

User avatar
soerena
 
Posts: 57
Joined: Fri Nov 16, 2012 7:00 am

Re: USBtiny with atmega328: How to hookup, and Avrdude 5.5

Post by soerena »

by the way, should I install the firmware stuff linked to here: http://learn.adafruit.com/usbtinyisp/download ? This is really not very clearly described

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: USBtiny with atmega328: How to hookup, and Avrdude 5.5

Post by adafruit_support_rick »

soerena wrote:I don't quite get how installing avrdude into the arduino app has anything to do with using avrdude inside terminal. Is avrdude constantly using arduino somehow?
Ah - sorry - I thought you were using the IDE. I'm getting confused between this and some Trinket threads.
soerena wrote:by the way, should I install the firmware stuff linked to here: http://learn.adafruit.com/usbtinyisp/download ? This is really not very clearly described
You mean the USBtinyISP firmware? No - that is not necessary. All you should need from that page is the WinAVR download.

In a Terminal window, what do you get back this?

Code: Select all

avrdude -v

User avatar
soerena
 
Posts: 57
Joined: Fri Nov 16, 2012 7:00 am

Re: USBtiny with atmega328: How to hookup, and Avrdude 5.5

Post by soerena »

when typing avrdude -v in the terminal, I get this:

avrdude: Version 5.3.1.osxintelhack, compiled on Feb 1 2007 at 22:30:12
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

System wide configuration file is "/usr/local/etc/avrdude.conf"
User configuration file is "/Users/sorenandreasen/.avrduderc"
User configuration file does not exist or is not a regular file, skipping


avrdude: no programmer has been specified on the command line or the config file
Specify a programmer using the -c option and try again

Does it look OK to you?

User avatar
soerena
 
Posts: 57
Joined: Fri Nov 16, 2012 7:00 am

Re: USBtiny with atmega328: How to hookup, and Avrdude 5.5

Post by soerena »

You mean the USBtinyISP firmware? No - that is not necessary. All you should need from that page is the WinAVR download.
But WinAVR is for windows, right? I'm on Mac OSX 10.7.5, so it's AvrMacPack (which I have) I need, right?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: USBtiny with atmega328: How to hookup, and Avrdude 5.5

Post by adafruit_support_rick »

Right - you did say MacOSX. So you want AvrMacPack.
But that comes with avrdude 5.5, and the version info you posted shows version 5.3.1. So that's where the problem is.

I haven't tried out the AvrMacPack, but I get the idea that it should automatically install everything in the right place. Maybe you need to run it again?

If that doesn't help, then scroll down to the 'MacOSX' section on this page, you'll see how to manually install avrdude.

You'll know you have it right when 5.3.1 doesn't appear in the version info anymore

User avatar
soerena
 
Posts: 57
Joined: Fri Nov 16, 2012 7:00 am

Re: USBtiny with atmega328: How to hookup, and Avrdude 5.5

Post by soerena »

OK, so now usbtiny shows up when I type avrdude -c asdf!! hurray!

Next step is hooking it up to an atmega328p to burn my program onto it.

A few stupid questions:

- Do I need to upload a bootloader in order to be able to upload sketches or can I just upload without a bootloader?
- Couldn't I just do this with an arduino uno board and just remove the original MC ? What is the benefit of using the tiny usb?
- If I can program a MC with just the use of the tiny usb, how would I go about connecting it to the MC?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: USBtiny with atmega328: How to hookup, and Avrdude 5.5

Post by adafruit_support_rick »

You need the bootloader if you want to upload sketches with the Arduino IDE.

You could swap chips in a Uno, but you would still need a bootloader to use the chip with the IDE.

Of course, you can actually buy pre-programmed chips:
http://www.adafruit.com/products/123

Other than the USBtinyISP, there are several approaches to programming chips. We have a tutorial here:
http://learn.adafruit.com/arduino-tips- ... arduinoisp
And a kit:
http://www.adafruit.com/products/462

You can use the same kit to create a "standalone" programmer. The tutorial is here:
http://learn.adafruit.com/standalone-av ... programmer

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: USBtiny with atmega328: How to hookup, and Avrdude 5.5

Post by adafruit_support_rick »

For a minimal configuration of using the USBTinyISP to directly program a chip, see this tutorial:
http://learn.adafruit.com/mass-avr-isp-programmer

User avatar
soerena
 
Posts: 57
Joined: Fri Nov 16, 2012 7:00 am

Re: USBtiny with atmega328: How to hookup, and Avrdude 5.5

Post by soerena »

Can't I just upload a bootloader with the arduino uno and a new 328p chip ? no?

I'm sorry, right now it's a bit confusing what the benefits of using the usbtiny are..


Can I upload arduino sketches to a 328p that doesn't have the bootloader, by using the usbtiny? And this way avoid spending flash memory on the bootloader.. ?? Or am I misunderstanding something?

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

Return to “USBtinyISP”