Author Topic: Need help checking my custom atmega32u4-based board  (Read 2571 times)

0 Members and 1 Guest are viewing this topic.

Offline kahdeg

  • Thread Starter
  • Posts: 5
Need help checking my custom atmega32u4-based board
« on: Sun, 22 May 2022, 04:06:41 »
Hi, i'm just starting to learn about designing and making custom keyboard.
What i was making is a mechanical numpad with per-key led.
Here is my diagram:

Attached is the pdf export of the pcb layout.
When i ordered the board from jlcpcb, i plugged the board in and windows reported unknown device.
After that, i scouted several post on avrfreak and stackexchange and tried to use another arduino (pro micro) as isp to try to upload the bootloader using arduino ide.

but avrdude reported signature = 0xffffff.

I checked the crystal and it seem similar with other schematic online but idk that much about electronic component.
Please help me check the diagram.

Code: [Select]
D:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avrdude -CD:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega32u4 -carduino -PCOM5 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0xcb:m -Uhfuse:w:0xd8:m -Ulfuse:w:0xff:m

avrdude: Version 6.3-20190619
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2014 Joerg Wunsch

         System wide configuration file is "D:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : COM5
         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.00s

avrdude: Device signature = 0xffffff (probably .avr8x_mega) (retrying)

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0xffffff (probably .avr8x_mega) (retrying)

Error while burning bootloader.
Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0xffffff (probably .avr8x_mega)
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

here is my arduino ide settings


the atmega chip:


the crystal:


the android isp wiring:

Offline Applet

  • Posts: 487
  • Location: Sweden
Re: Need help checking my custom atmega32u4-based board
« Reply #1 on: Mon, 23 May 2022, 08:05:46 »
Have you tried to flip the USB-C connector? You have only connected one of the USB-C pairs of the connector. Both need to be connected (DN2 and DP2 is not connected). Also, is the GND pins on the MCU not connected to GND?

Offline kahdeg

  • Thread Starter
  • Posts: 5
Re: Need help checking my custom atmega32u4-based board
« Reply #2 on: Mon, 23 May 2022, 08:34:08 »
 :-[
yes i have missed the gnd pin of the mcu, i will try to fix this manually.
for the data pin, tks for noticing that :-[

Offline Applet

  • Posts: 487
  • Location: Sweden
Re: Need help checking my custom atmega32u4-based board
« Reply #3 on: Mon, 23 May 2022, 08:50:44 »
We all make mistakes ;D For future boards, I'd recommend to also include a ESD protection IC, like the SRV05 for example.

Offline kahdeg

  • Thread Starter
  • Posts: 5
Re: Need help checking my custom atmega32u4-based board
« Reply #4 on: Mon, 23 May 2022, 10:58:30 »
Do you have any resources on this component?
After some google search, i understand that this component should sit between the input signal line like the data from usb-c and the d+ d- from the atmega chip.

Offline Applet

  • Posts: 487
  • Location: Sweden
Re: Need help checking my custom atmega32u4-based board
« Reply #5 on: Mon, 23 May 2022, 11:18:47 »
Best is to check the datasheet, there is an example implementation there. Note that the IC can be used to protect four I/Os, but you only need to connect two (DP and DN). This IC should be connected in parallel to the data-traces. There are plenty of other ESD protection IC's, just check the datasheet for the component you want to use and you'll likely have an example.

Offline kahdeg

  • Thread Starter
  • Posts: 5
Re: Need help checking my custom atmega32u4-based board
« Reply #6 on: Mon, 23 May 2022, 12:17:39 »
I referenced the data sheet of the srv05 on jlcpcb and this is my result :D
Could anyone please double check this schematic again. I have learned to respect the check net warning this time.

Offline Applet

  • Posts: 487
  • Location: Sweden
Re: Need help checking my custom atmega32u4-based board
« Reply #7 on: Mon, 23 May 2022, 13:16:25 »
This should work from what I can tell, but I don't follow why you have split up your VCC net like this. Why connect some of the VCC nets before fuse and some after to the MCU? You can use VCC, it does not matter that it's after the fuse. Generally, one 0.1uF (100nF) decoupling cap is recommended per VCC pin.

Offline kahdeg

  • Thread Starter
  • Posts: 5
Re: Need help checking my custom atmega32u4-based board
« Reply #8 on: Sat, 28 May 2022, 04:07:58 »
I just refactor the whole circuit so that everything that use vcc is behind fuse now.
mcu, power, usb and header

the key and led matrix

Offline Applet

  • Posts: 487
  • Location: Sweden
Re: Need help checking my custom atmega32u4-based board
« Reply #9 on: Sun, 29 May 2022, 04:46:14 »
Looks like pin 34 is not connected to VCC? You don't need to place the decoupling caps next to each pin in schematic, just make sure to place them correctly when doing the layout.