geekhack
geekhack Projects => Making Stuff Together! => Topic started by: atlantapuzzler on Sun, 16 June 2019, 12:44:09
-
Hello Geekhack members,
Given my background in electronics and having access to components and other tools, I went ahead and printed several GH60 PCB's using the gerber files available on GitHub. The new boards look amazing. I populated 3 PCB's so far with a brand new ATMega32U4 along with all the Crystal, SMD Caps and Resistors. I also installed the reset button and it's pull up resistor. Per schematics, I installed a 6 pin headers on P1-P6. I am able to use AVRDude to flash the chip various hex files without any issues. I even experimented with flashing the bootloader with the Caterna boot loader used by the Pro Micro with the Arduino IDE. Flashing is always successful. However, when I plug the keyboard to the PC, it does not get detected by the computer and it never shows up on any COM port. I used the ATMega32U4 in many projects in the past, it is pretty easy to get it going. I am not sure what am I doing wrong.
Using an ISP, here is the avrdude output:
avrdude -C<path to conf>avrdude.conf -v -patmega32u4 -carduino -PCOM3 -b19200 -Uflash:w:<path to hex file>gh60_default.hex:i -Ulock:w:0x2F:m
avrdude: Version 6.3-20171130
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "<path to conf>avrdude.conf"
Using Port : COM3
Using Programmer : arduino
Overriding Baud Rate : 19200
AVR Part : ATmega32U4
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PA0
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 65 20 4 0 no 1024 4 0 9000 9000 0x00 0x00
flash 65 6 128 0 yes 32768 128 256 4500 4500 0x00 0x00
lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
Programmer Type : Arduino
Description : Arduino
Hardware Version: 2
Firmware Version: 1.18
Topcard : Unknown
Vtarget : 0.0 V
Varef : 0.0 V
Oscillator : Off
SCK period : 0.1 us
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.02s
avrdude: Device signature = 0x1e9587 (probably m32u4)
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as D8
avrdude: safemode: efuse reads as CB
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "<path to hex>\gh60_default.hex"
avrdude: writing flash (16978 bytes):
Writing | ################################################## | 100% 19.99s
avrdude: 16978 bytes of flash written
avrdude: verifying flash memory against <path to hex>\gh60_default.hex:
avrdude: load data flash data from input file <path to hex>\gh60_default.hex:
avrdude: input file <path to hex>\gh60_default.hex contains 16978 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 11.74s
avrdude: verifying ...
avrdude: 16978 bytes of flash verified
avrdude: reading input file "0x2F"
avrdude: writing lock (1 bytes):
Writing | ################################################## | 100% 0.04s
avrdude: 1 bytes of lock written
avrdude: verifying lock memory against 0x2F:
avrdude: load data lock data from input file 0x2F:
avrdude: input file 0x2F contains 1 bytes
avrdude: reading on-chip lock data:
Reading | ################################################## | 100% 0.02s
avrdude: verifying ...
avrdude: 1 bytes of lock verified
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as D8
avrdude: safemode: efuse reads as CB
avrdude: safemode: Fuses OK (E:CB, H:D8, L:FF)
avrdude done. Thank you.
-
If you got proper variant of the ATMega32U4 it should has bootloader(from Atmel) from the begining. You don't have to program with ISP programmer and avrdude.
The Atmel bootloader should appear as like this on Windows.
https://github.com/tmk/tmk_keyboard/wiki/Driver-install-on-Windows#device-name
Or you will see it on log like below under Linux. No device file for the Atmel bootloader is not created in general.
Jun 17 13:23:28 desk kernel: [2003193.461697] usb 3-3.2: USB disconnect, device number 34
Jun 17 13:23:29 desk kernel: [2003193.942872] usb 3-3.2: new full-speed USB device number 35 using xhci_hcd
Jun 17 13:23:29 desk kernel: [2003194.092542] usb 3-3.2: New USB device found, idVendor=03eb, idProduct=2ff4
Jun 17 13:23:29 desk kernel: [2003194.092546] usb 3-3.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Jun 17 13:23:29 desk kernel: [2003194.092549] usb 3-3.2: Product: ATm32U4DFU
Jun 17 13:23:29 desk kernel: [2003194.092552] usb 3-3.2: Manufacturer: ATMEL
Jun 17 13:23:29 desk kernel: [2003194.092554] usb 3-3.2: SerialNumber: 1.0.0
-
And You should consult with your xtal's datasheet for load capacitance and make sure you are using proper capacitor value for the xtal. Xtal won't oscillate with imporper capacitors.