I'm trying to program a bootloader into my ATMega32u4. It's on a custom PCB, And here are the schematic files:
and here's the full avrdude log:
>>>: avrdude -c usbasp -p m32u4 -P usb -b 115200 -B 20.96 -F -v -v -v -v -V
avrdude: Version 7.1
Copyright the AVRDUDE authors;
see https://github.com/avrdudes/avrdude/blob/main/AUTHORS
System wide configuration file is C:\Users\Administrator\Documents\avrdude\avrdude.conf
Using Port : usb
Using Programmer : usbasp
Overriding Baud Rate : 115200
Setting bit clk period : 21.0
avrdude: usbasp_open("usb")
avrdude: seen device from vendor >www.fischl.de<
avrdude: seen product >USBasp<
AVR Part : ATmega32U4
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PA0
RESET disposition : possible i/o
RETRY pulse : SCK
Serial program mode : yes
Parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page Polled
Memory Type Alias Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 65 20 4 0 no 1024 4 0 9000 9000 0x00 0x00
Block Poll Page Polled
Memory Type Alias Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
flash 65 6 128 0 yes 32768 128 256 4500 4500 0x00 0x00
Block Poll Page Polled
Memory Type Alias Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
lfuse 0 0 0 0 no 1 1 0 9000 9000 0x00 0x00
Block Poll Page Polled
Memory Type Alias Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
hfuse 0 0 0 0 no 1 1 0 9000 9000 0x00 0x00
Block Poll Page Polled
Memory Type Alias Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
efuse 0 0 0 0 no 1 1 0 9000 9000 0x00 0x00
Block Poll Page Polled
Memory Type Alias Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
lock 0 0 0 0 no 1 1 0 9000 9000 0x00 0x00
Block Poll Page Polled
Memory Type Alias Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
signature 0 0 0 0 no 3 1 0 0 0 0x00 0x00
Block Poll Page Polled
Memory Type Alias Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
calibration 0 0 0 0 no 1 1 0 0 0 0x00 0x00
Programmer Type : usbasp
Description : USBasp, http://www.fischl.de/usbasp/
avrdude: usbasp_initialize()
avrdude: usbasp_transmit("USBASP_FUNC_GETCAPABILITIES", 0x00, 0x00, 0x00, 0x00)
avrdude: usbasp_spi_set_sck_period(2.096e-05)
avrdude: try to set SCK period to 2.096e-05 s (= 47709 Hz)
avrdude: connected USBasp is not cabable of 3 MHz SCK
avrdude: set SCK frequency to 32000 Hz
avrdude: usbasp_transmit("USBASP_FUNC_SETISPSCK", 0x07, 0x00, 0x00, 0x00)
avrdude usbasp_spi_set_sck_period() [usbasp.c:971] error: cannot set sck period; please check for usbasp firmware update
avrdude: usbasp_transmit("USBASP_FUNC_CONNECT", 0x00, 0x00, 0x00, 0x00)
avrdude: usbasp_program_enable()
avrdude: usbasp_transmit("USBASP_FUNC_ENABLEPROG", 0x00, 0x00, 0x00, 0x00)
<= [01]
avrdude usbasp_spi_program_enable() [usbasp.c:726] error: program enable: target does not answer (0x01)
avrdude main() [main.c:1246] error: initialization failed, rc=-1
- double check the connections and try again
- use -B to set lower ISP clock frequency, e.g. -B 125kHz
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x000000 (retrying)
avrdude: device signature = 0x000000 (retrying)
avrdude: device signature = 0x000000
avrdude main() [main.c:1349] error: Yikes! Invalid device signature.
avrdude main() [main.c:1365] warning: expected signature for ATmega32U4 is 1E 95 87
avrdude: usbasp_close()
avrdude: usbasp_transmit("USBASP_FUNC_DISCONNECT", 0x00, 0x00, 0x00, 0x00)
avrdude done. Thank you.
I've tried using an Arduino Uno and an usbasp programmer(this one: https://www.amazon.com/dp/B07NZ59VK2?psc=1&ref=ppx_yo2ov_dt_b_product_details), I removed D4 & U4, and I checked the voltage on the processor power pins. All of them are 3.3V. I've also double-checked my double-checking of the wiring between the programmer and the target device. All to no avail. I just need to program the bootloader onto the device so I can get it running with USB.
Thanks.