Author Topic: Programming ATmega32U4 with USBASP  (Read 2078 times)

0 Members and 2 Guests are viewing this topic.

Offline avf32Topic starter

  • Newbie
  • Posts: 9
  • Country: gb
Programming ATmega32U4 with USBASP
« on: August 27, 2021, 01:01:27 pm »
Hi all,

I'm trying to program an ATmega32U4 on my breadboard with a USBASP programmer, but all I'm getting is:

avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: error: program enable: target doesn't answer. 1
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

I've double- and triple-checked with my multimeter that the connections are correct by probing the pins on the MCU and the corresponding pins on the programmer.  Just in case the MCU was set to use a crystal (though in theory it's brand new and should be configured to use the internal oscillator), I've stuck a crystal on it (with 22pF caps to ground, and I have tried two crystals).  The progammer definitely works, I program ATtiny84As with it regularly.

The only ideas I have left are trying to update the firmware on the programmer (which I will do once I get a second one), and the MCU being faulty.

Is there anything else I could have missed?

Many thanks,
Alex
 

Offline avf32Topic starter

  • Newbie
  • Posts: 9
  • Country: gb
Re: Programming ATmega32U4 with USBASP
« Reply #1 on: August 27, 2021, 01:32:01 pm »
I was missing the pull-up on the reset pin.  Double-checked, and it does need the crystal.

The fuses are indeed set to the factory defaults, but I also missed this note in the datasheet: "The default setting of CKSEL3..0 results in Low Power Crystal Oscillator for ATmega16U4 and ATmega32U4, and Internal RC oscillator for ATmega16U4RC and ATmega32U4RC."


avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9587 (probably m32u4)

avrdude: safemode: Fuses OK (E:F3, H:99, L:5E)

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->