atmega168A programming with avrdude

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
Dkuriloff
 
Posts: 9
Joined: Wed May 16, 2012 8:12 am

atmega168A programming with avrdude

Post by Dkuriloff »

I have version 5.8cvs of avrdude running in the terminal program on a MacBook pro OS10
The atmega168A is just an slightly improved version of the non-A
version but only the 168 is listed. They are completely compatible.
But the signature bytes are different, so i have been told that avrdude gets confused and
thinks you have the wrong. I was also told that I could just
use the atmega168 selection but would probably need to add the the '-F' option to Force avrdude to ignore the signature bytes. What command lines do I use to make this all work?
Thanks

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

Re: atmega168A programming with avrdude

Post by adafruit »

what command line are you using now?

Dkuriloff
 
Posts: 9
Joined: Wed May 16, 2012 8:12 am

Re: atmega168A programming with avrdude

Post by Dkuriloff »

I have not yet tried to send a command line yet. I need to use the AtinyUSB to do this:


Find attached a .hex file. This should be the most current code
complied specifically for your hardware configuration.


You should be able to just test the isp connection with avrdude first

avrdude -c usbtiny -P usb -p m168

Then you need to set the fuses first (and you only need to do this once)

avrdude -c usbtiny -P usb -p m168 -U lfuse:w:0xf7:m -U hfuse:w:0xdc:m
-U efuse:w:0xf9:m

then program the flash memory

avrdude -c usbtiny -P usb -p m168 -U flash:w:mod-six_dan_sp.hex

Couple of things, the part on your clock is an atmega168a
You may need to change that 'm168' in the above command lines to match
the correct part. Else avrdude will balk. You can get a list of devices support by your version of avr dude
with the cmd 'avrdude -p ?' avrdude may or may not have a m168a in its list. You may need to
update avrdude, or override the signature test with the '-F' cmd.

Also, I am not sure how to configure the Atinyusb to be strapped to provide power to the
target instead of getting power from the target???????

Thanks....I am clearly a newby.

User avatar
adafruit_support_bill
 
Posts: 88097
Joined: Sat Feb 07, 2009 10:11 am

Re: atmega168A programming with avrdude

Post by adafruit_support_bill »

I have not yet tried to send a command line yet. I need to use the AtinyUSB to do this:
Find attached a .hex file. This should be the most current code
complied specifically for your hardware configuration.
I'm confused by your post. Are you quoting some tutorial?
I need to use the AtinyUSB
Do you mean the USBTinyISP or the ATTinyUSB? USBTinyISP usage is documented here. I believe there are ATTinyUSB tutorials out there too.

Dkuriloff
 
Posts: 9
Joined: Wed May 16, 2012 8:12 am

Re: atmega168A programming with avrdude

Post by Dkuriloff »

Sorry for the confusion.

USBtinyISP is what I have.

The quote is from a programmer who developed the code needed to program an atmega168A chip for a digital clock.

I need to use a hex file to program the on board atmega IC using the command lines he is suggesting. First to program the fuses then to program the flash memory. The question is whether or not I need to change the command lines for the 168A versus the 168.

Will I need to override the signature test with the '-F' cmd?

How can I do this properly for the 168A which does not show up on the list of supported devices in my version of avrdude.

Thanks

User avatar
adafruit_support_bill
 
Posts: 88097
Joined: Sat Feb 07, 2009 10:11 am

Re: atmega168A programming with avrdude

Post by adafruit_support_bill »

If you use the command line for the 168 as is, it will probably tell you that the signatures don't match. If you add the "-F" option, it will disable the signature check and program it as if it were a 168. If they are totally compatible, that should not be a problem.

Dkuriloff
 
Posts: 9
Joined: Wed May 16, 2012 8:12 am

Re: atmega168A programming with avrdude

Post by Dkuriloff »

OK

Great. But where do I add the "-F " option in the command line?

Do I add -F after each occurance of m168?

e.g. m268 -F

User avatar
adafruit_support_bill
 
Posts: 88097
Joined: Sat Feb 07, 2009 10:11 am

Re: atmega168A programming with avrdude

Post by adafruit_support_bill »

Just one -F at the end should do it.

Dkuriloff
 
Posts: 9
Joined: Wed May 16, 2012 8:12 am

Re: atmega168A programming with avrdude

Post by Dkuriloff »

OK.

Thanks so much.

I will try it this weekend and let you know if it works.

Also, is there a newer version of avrdude beyond what I have (5.8cvs) that supports the atmega168A?

User avatar
adafruit_support_bill
 
Posts: 88097
Joined: Sat Feb 07, 2009 10:11 am

Re: atmega168A programming with avrdude

Post by adafruit_support_bill »

The latest version (5.11) is available here. Don't know about 168A support.

Dkuriloff
 
Posts: 9
Joined: Wed May 16, 2012 8:12 am

Re: atmega168A programming with avrdude

Post by Dkuriloff »

I tried to upgrade latest version of CrossPack for AVR Development but neglected to deinstall old veriosn.

Now I get command not found
for everything and avrdude is not recognized either.

How can I get my ternminal program to work again?

CrossPack does support atmega168A

User avatar
adafruit_support_bill
 
Posts: 88097
Joined: Sat Feb 07, 2009 10:11 am

Re: atmega168A programming with avrdude

Post by adafruit_support_bill »

I tried to upgrade latest version of CrossPack for AVR Development but neglected to deinstall old veriosn.
I haven't used crosspack. Maybe uninstall everything and start over?

Dkuriloff
 
Posts: 9
Joined: Wed May 16, 2012 8:12 am

Re: atmega168A programming with avrdude

Post by Dkuriloff »

avrdude version 5.11.1, URL: <http://savannah.nongnu.org/projects/avrdude/>
Emily-Kuriloffs-MacBook-Air:~ emilykuriloff$

I got the latest version of avrdude as above

parts listed are:
m168p = ATMEGA168P [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:8655]
m168 = ATMEGA168 [/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf:8467]

when I try to load a hex file I get this:
Emily-Kuriloffs-MacBook-Air:~ emilykuriloff$ avrdude -c usbtiny -P usb -p m168

avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
avrdude done. Thank you.

with the -F command I get this:

Emily-Kuriloffs-MacBook-Air:~ emilykuriloff$ avrdude -c usbtiny -P usb -p m168 -F

avrdude: initialization failed, rc=-1
avrdude: AVR device initialized and ready to accept instructions
avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
avrdude: Expected signature for ATMEGA168 is 1E 94 06

avrdude done. Thank you.

I tried to type in the m168a and got this

Emily-Kuriloffs-MacBook-Air:~ emilykuriloff$ avrdude -c usbtiny -P usb -p m168a
avrdude: AVR Part "m168a" not found.

any help here?

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

Return to “USBtinyISP”