Author Topic: ATMEGA 32U4  (Read 1028 times)

0 Members and 1 Guest are viewing this topic.

Offline mousepadheadTopic starter

  • Newbie
  • Posts: 7
  • Country: au
ATMEGA 32U4
« on: August 20, 2026, 03:15:32 am »
Hi all!

I recently spun up 5x boards using ATMEGA 32U4 MCU. I was attempting to flash using USBASP (over and over).
I attempted many times (maybe 3x each board) thinking my I wasn't holding my TagConnect pogo pins with correct continuity.
I think realised I had 3.3V jumper installed on USBASP...

2 of the boards worked immediately flashing with the 5V jumper installed.
2 of the boards were only able to flash once I wired an external MCU generating 16kHz clock soldered to XTAL1/2.
The last board I am unable to get any response out whatsoever.

What are the potential failure modes here? any chance of bringing this last board back from the dead?
« Last Edit: August 20, 2026, 03:37:02 am by mousepadhead »
 

Offline jheissjr

  • Regular Contributor
  • *
  • Posts: 156
  • Country: us
Re: ATMEGA 32U4
« Reply #1 on: August 20, 2026, 03:21:20 am »
Wrong fuse bits? Scope the programming pins on the MCU on the working and non-working boards and compare.
« Last Edit: August 20, 2026, 04:44:42 am by jheissjr »
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 12640
  • Country: nz
Re: ATMEGA 32U4
« Reply #2 on: August 20, 2026, 10:30:07 am »
USBASP always gave me flashing problems and bricked MCUs. I stopped using it and the problems went away.
Cant be sure it was the cause but it seems likely.

I now use a MPLAB SNAP DEBUGGER (bare pcb with some heatshrink around it for protection).
You have to use the microchip studio thing once to reflash the programmer into AVR mode, but once you've done that you can use AVRDUDE with it.
Another annoying thing is if you have a bad connection during flashing, like slipping with the programming header, then the programmer drops into a slower programming speed mode and the only way I've found to get it out of that state is a USB power cycle.

They're pretty cheap. Cheap enough to always keep a spare in case you accidently feed 12V to it or something,  ::)
https://www.digikey.com/en/products/detail/microchip-technology/PG164100/9562532
« Last Edit: August 20, 2026, 10:42:18 am by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline elektryk

  • Frequent Contributor
  • **
  • Posts: 284
  • Country: pl
Re: ATMEGA 32U4
« Reply #3 on: August 20, 2026, 11:47:55 am »
They're pretty cheap. Cheap enough to always keep a spare in case you accidently feed 12V to it or something,  ::)
https://www.digikey.com/en/products/detail/microchip-technology/PG164100/9562532

Wow during C19 it was crazy overpaid, maybe 5 times more expensive.
 

Offline eugene

  • Frequent Contributor
  • **
  • Posts: 600
  • Country: us
Re: ATMEGA 32U4
« Reply #4 on: August 20, 2026, 07:35:41 pm »
You can use avrdude and just about any dev board (Arduino, whatever) to both flash the boards and read/write the fuse bits.
90% of quoted statistics are fictional
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 12640
  • Country: nz
Re: ATMEGA 32U4
« Reply #5 on: August 21, 2026, 01:40:26 am »
You can use avrdude and just about any dev board (Arduino, whatever) to both flash the boards and read/write the fuse bits.

Yep, the MPLAB SNAP just get you proper level shifting for programming 3.3V or 5V stuff, and debugging etc.
It's nice, and it's worth $11 but yes, any AVR can act as a programmer just fine if that is all you want and don't care about level shift.
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline elektryk

  • Frequent Contributor
  • **
  • Posts: 284
  • Country: pl
Re: ATMEGA 32U4
« Reply #6 on: August 21, 2026, 04:01:51 am »
For this price its quite ok. After a little mod there's also possibility to program modern AVRs with UPDI.
 

Offline Renate

  • Super Contributor
  • ***
  • Posts: 1747
  • Country: de
    • Renate's Android Page
Re: ATMEGA 32U4
« Reply #7 on: August 21, 2026, 04:54:46 am »
I have an old ATMEL ICE that I got for cheap years ago.
I like that it has level converters, V measurement and DGI.
I've programmed lots of 32u4 and 328 and Tinies with ISP.
Nowadays it's more SAMD and ST32F with SWD.
I had to look up what UPDI was, it sounds bogus.
 

Offline coromonadalix

  • Super Contributor
  • ***
  • Posts: 8796
  • Country: ca
Re: ATMEGA 32U4
« Reply #8 on: August 21, 2026, 09:50:25 am »
usbasp  had many variations and firmware type into them,  some works very well under avr dude / avrdudess,   some not,  some dont have level translators or buffers in case of ..  etc ...

there are plenty of low cost substitutes  like ice, stk 500  etc ...   

got some snap for 12$   i'll check on how to use them
 

Offline Buriedcode

  • Super Contributor
  • ***
  • Posts: 1948
  • Country: gb
Re: ATMEGA 32U4
« Reply #9 on: August 23, 2026, 10:45:58 pm »
...
2 of the boards were only able to flash once I wired an external MCU generating 16kHz clock soldered to XTAL1/2.
...


That sounds very low frequency - which I believe should be 8x the SCLK of the programmer - but I guess the USBasp can use 2kHz clock.  Probably takes an age to flash though.

Years ago (like..15?) I had issues with brown outs on some AVR boards during programming (long story but programmer supplied ~3V instead of 5V) and *some* fuses were cleared, whilst others weren't, and it appeared almost random as to which ones were cleared.  Even during runtime AVRs can behave weirdly below the recommended voltage, as different parts of the chip can operate at different thresholds - so the EEPROM might read back 0xFF, but the VDD is enough to run the CPU.

If the SPIEN fuse is set - it prevents flashing via the SPI port, so a high voltage parallel programmer is required.  Thankfully you can knock one up with an Arduino UNO and jellybean parts.

https://mightyohm.com/blog/2008/09/arduino-based-avr-high-voltage-programmer/

I believe the Atmega32u4 comes with a USB DFU bootloader - so if you haven't written to the bootloader section it could still be there.  I *think* if you hold the HWB pin low during a reset it enters the bootloader, and should enumerate in windows as a HID device. But I don't think you can change the fuses via that.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->