Atmega32u4 - no sign of life. Trying to load bootloader. - Page 1
Forum section: electronics / general

author: gmc
author_rank: Regular Contributor
timestamp: July 27, 2020, 12:07:31 pm
content: I'm busy with a project which uses a Atmega32u4. I have mega32u4-au which I carefully soldered to the PCB. No shorts and connections double checked.I've based the circuit on the attachment.Vcc = 5VUsing a 16Mhz xtal with 22pf capsUCap connected to 1uF Cap.All the Vcc and GND lines connected.HWB Connected to GND (Have also tried leavig is not connected)I've now trying to use my USBTinyISP connected to ICSP pins but it's not detecting the 32u4.Code:avrdude -c usbtiny -p m32u4avrdude: initialization failed, rc=-1If I try and force a detection I get:Code:avrdude -c usbtiny -p m32u4avrdude: Device signature = 0xc0778aavrdude: Expected signature for ATmega32U4 is 1E 95 87Code:Block Poll Page PolledMemory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------eeprom 65 20 4 0 no 1024 4 0 9000 9000 0x00 0x00flash 65 6 128 0 yes 32768 128 256 4500 4500 0x00 0x00lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00Programmer Type : USBtinyDescription : USBtiny simple USB programmer, https://learn.adafruit.com/usbtinyispavrdude: programmer operation not supportedavrdude: Using SCK period of 10 usecCMD: [ac 53 00 00] [ff ff ff ff]CMD: [ac 53 00 00] [ff ff ff ff]avrdude: initialization failed, rc=-1Double check connections and try again, or use -F to overridethis check.So either I have a faulty 32u4 (The USBTiny works when I tested against a ATmega88PA) or there is some circuit issue.I've beeped out the connections from the 32u4 pins and they all go to the correct place.Is there something I'm maybe missing on the schematic? I've swapped out the crystal, same issue. I've measured the voltage on the 32u4 pins and its also stable at 5V.

author: FlyingDutch
author_rank: Regular Contributor
timestamp: July 27, 2020, 12:21:29 pm
content: Hi,avrdude is shit (it waits for specific ICs signature) - theoretically you can change it in avrdude config, but better install "Atmel Studio" and use programer from Tools menu. Then connect to Atmega and first set fusebits in IC for proper value - especially clock for external crystal. After writing fusebits you should be able to program the AtMega.Best Regards

author: FlyingDutch
author_rank: Regular Contributor
timestamp: July 27, 2020, 12:28:02 pm
content: BTW: on USB D+ and D - it is better to use zener diodes - see this link:http://fab.cba.mit.edu/classes/863.16/doc/projects/FabFTDI/FabFTDI.htmlRegards

author: wraper
author_rank: Unknown
timestamp: July 27, 2020, 12:40:09 pm
content: Quote from: FlyingDutch on July 27, 2020, 12:28:02 pmIt's a crappy hack only for AVR MCUs without USB hardware powered from 5V.

author: gmc
author_rank: Regular Contributor
timestamp: July 27, 2020, 12:58:34 pm
content: A quick read and it looks like Atmel Studio doesn't support USBTiny. You need to configure Atmel studio to use avrdude.

author: FlyingDutch
author_rank: Regular Contributor
timestamp: July 27, 2020, 01:14:44 pm
content: HI,you are wrong - see that screen-shot:"Atmel Studio 7" win 10 OS.Regards

author: Syntax Error
author_rank: Frequent Contributor
timestamp: July 27, 2020, 01:43:55 pm
content: Your AVRDude string looks okay. Plus your USBTiny is supported by default.Seehttps://www.nongnu.org/avrdude/user-manual/avrdude_4.htmlRough guess, you could try altering the bitclock with the -B1 option if, you're running off the xtal and the programmer supports this.

author: wraper
author_rank: Unknown
timestamp: July 27, 2020, 01:56:47 pm
content: Quote from: FlyingDutch on July 27, 2020, 01:14:44 pmExcept it has nothing to do with USBtiny. You can integrate and use avrdude from Atmel Studio. But then it becomes just GUI for avrdude.

author: gmc
author_rank: Regular Contributor
timestamp: July 27, 2020, 02:34:34 pm
content: Tried a few things and managed to get it working.Found a post where someone said connect a Arduino configured with a port at 1Mhz to the xtal1 pin.Removed the xtal, connected the 1Mhz clock and avrdude then recognised the 32u4. Programmed the Caterina-promicro16.hex file from Sparkfun.After that reinstalled the 16Mhz xtal and USBTiny now detects it 100% of the time.Have since flashed the Arduino Leonardo bootloader from Arduino IDE and everything is working fine.I think the initial fix was the 1Mhz clock. Saw some other post when someone said the 32u4 comes preconfigured for a 8MHz clock?

author: wraper
author_rank: Unknown
timestamp: July 27, 2020, 02:44:12 pm
content: Quote from: gmc on July 27, 2020, 02:34:34 pmYou probably got some dodgy 32u4 which was already programmed.Quote

author: gmc
author_rank: Regular Contributor
timestamp: July 27, 2020, 03:05:43 pm
content: Thanks. Could well be. Fleabay special.Happy its sorted now and know what to look for should it happen again.