Cannot burn avr 1284p with usb avr programmer under linux

Guys hi,
Would appreciate some word of advice since I feel kinda stuck.

I have been working on a crude prototype on a breadboard with avr 1284p.
I have been using pololu’s avr to burn the flash and all is working great.

Now i want to make another copy of my prototype, this time on a tightly packed single smaller breadboard,
so i am basically trying to replicate the same configuration as i had before.

Unfortunately - i cannot burn the second avr1284p with pololu.
when i run
avrdude -p atmega1284p -P /dev/ttyACM0 -c avrispv2 -b 57600 -U flash:w:main.hex
I get:
avrdude: stk500v2_command(): command failed
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

Here are a few more observations:

  1. I can burn the flash perfectly for both systems with atmel’s proprietary burner (and avr studio),
    but it connects to different pins and uses a different protocol altogether. I would have used it, but i want to use linux as
    my development environment and this programmer has no support under linux (jtagice3).
  2. the working system runs with a 20mhz external crystal, the system being debugged runs with 16mhz external crystal . Tried to switch - didn’t help.
  3. the voltage on vdd pin of the pololu programmer is 5v just as it is for the av1284p.
  4. the system is powered through a 5v voltage regulator from a bench top power supply
  5. I have a cable which is IDC 6 pin on one side (goes into pololu) and 6 male header pins on the other.
    I am sticking these 6 pins in a row in 6 pins of the avr1284p. I use the same cable for both systems.
    One works and one doesn’t , so its probably not the cable.

If there is any additional information that might be useful - i will gladly provide.

Kindly advise,

Hello, Arie.

I would use the jtagice3 to carefully compare the fuse settings of the two chips. It is possible that you disabled SPI programming with the SPIEN fuse on the second AVR, but not the first.


David hi ,

Thank you for your reply to this matter.
I’ve checked the fuse values (with jtagice for the new system and with the pololu programmer for the older one).

Both of them were set by me to [E,H,L] = [0xFF,0x99,0xF7].

I use the full swing oscillator settings mode so that i don’t have to worry about the precise frequency of the crystal when i switch from one system to the other.

Hope it can provide further insight. Are there any fuse settings you would try to tweak with to test this kind of behavior?

Thanks again,

Kind regards,

Hey guys,

In an attempt to solve this,
I’m uploading an image of my breadboard - perhaps this could help ? … directlink



It looks like your AVR’s MOSI, MISO, and SCK lines are connected to some other pins of other devices. Those other devices could be interfering with the programming if you are not careful.


Hey guys, i ended up carefully reassemblying my circuit on a new breadboard, checking at every stage that the avr burner works.
I have used the same processor, although not the same exact crystal (but of the same frequency).

I guess sometimes , if your system is not too big, this way would be easier than debugging it.
It now works.

Thanks to everyone who contributed to this thread !