Design Review Request - RGB Sign

Hi all,

I created a sign with my initials, a two-layer PCB with an Atmega32u4, an IR remote receiver, and addressable LEDs. Power traces are 0.5mm, signal traces 0.3mm, and parts on the front and back copper. Bootloading will be through USBasp, and Arduino to program it. I created a prototype on a breadboard and already ordered the board, however upon assembly I couldn’t bootload it since the 10k pull-up resistor wasn’t originally connected to C24, so this version has that change. I realize that I should start checking my schematic vs. my pcb one by one for each connection point, though it takes awhile stuff like this can be avoided from doing so.

I just want to make sure that the board will work this time and will properly upload the code, let me know what you guys think. Thank you!

DR_SIGN_REDO - Copy.pdf (760.1 KB)

It is the task for DRC. If you update PCB from schematic and DRC not complains that means that your PCB is consistent with the schematic.

1 Like

That is true but even with no errors from the DRC it seems that the PCB still could not bootload. The schematic I have not changed but I realized the order I connected my traces was not exact to the schematic, so I checked the schematic vs. the PCB so that each part is one to one.

This was my original layout for the ICSP header.

Will the updated version now work? Also, this was the error I was getting from Arduino:

Arduino: 1.8.19 (Windows Store 1.8.57.0) (Windows 10), Board: "Arduino Leonardo"

C:\Users\ricci\Documents\ArduinoData\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude -CC:\Users\ricci\Documents\ArduinoData\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf -v -patmega32u4 -cusbasp -Pusb -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 "C:\Users\ricci\Documents\ArduinoData\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"



         Using Port                    : usb

         Using Programmer              : usbasp

         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 : usbasp

         Description     : USBasp, http://www.fischl.de/usbasp/



avrdude: auto set sck period (because given equals null)

avrdude: error: program enable: target doesn't answer. 1 

avrdude: initialization failed, rc=-1

         Double check connections and try again, or use -F to override

         this check.





avrdude done.  Thank you.



Error while burning bootloader.



This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

At the top right of the DRC panel there is a test “Test for parity between PCB and schematic” if you have this checked it is as simple as it says, it will alert you to any disparity between the two.
:mouse:

1 Like

Never realized that, I just checked it and there aren’t any errors so it should be fine I guess, I just wasn’t sure if it was because of a poor layout. How sensitive are the MISO, MOSI, SCK, and RESET lines for ICSP? I have several traces running underneath them via power and signal for the RGB LEDs.

1 Like

I use the Atmel Atmega328p-AU all the time and have no problems with those lines, just follow the rules as I can’t remember them off the top of my head :woozy_face:I wouldn’t describe them as ‘sensitive’ at all and again I have a few projects that use WS2812 LEDs plus OLEDs and a bunch of sensors like the MAX range of thermometers and had zero problems with board layout in terms of crosstalk I mean. But screwed the board up in other ways :rofl: plenty of times.
:mouse:

1 Like

Weird how it failed to bootload then, I even reinstalled my crystal to make sure I didn’t put it upside down but still no result.

Crystals can go anyway but must have the correct load capacitors. Are you using the Arduino IDE and trying to install a bootloader or are you trying to upload your code and what are you using as a programmer ? I always use an Arduino as the programmer and set the programmer to " Arduino as ISP"
:mouse:

1 Like

I used the same capacitor load crystals on a previous board 8pF, and I’m using USBasp as my programmer, the arduino IDE as my code, I bootloaded a different board to make sure it wasn’t my programmer

8 pF is a bit low, 22 pF is more typical. Is there any way you can check if the oscillator is running? Measured voltages at various points? Looked for dry joints or solder bridges?

1 Like

I’m assuming I can check that with my oscilloscope? However, I ended up ripping one of the traces off accidentally trying to solder on a wire since I thought I had something wrong with the reset line connection, so I’m going to have to solder another board with the extra parts I have. I checked my voltages, and they all seem to be fine. I’m getting 5V where I’m supposed to along with 3.3V.

And you call it fine?

Capacitance needed to run at specified frequency is specified by quartz.
The max capacitance at which generator will run depends on generator.
So too high capacitance can make generator not running, but too low will only shift frequency a little (hundreds ppm, I think).
In most applications actual frequency is not so critical. For example serial communication (RS232, RS485) should run even if actual frequencies at both sides differ 0.5% (5000 ppm).

check :
0) SLOW the programmer down to say 100kHz and it wont matter much how long the ICSP lines are
if yoru programmer is set to default for say 1 or 2 MHz, then it will only tolerate a few inches of cable.

  1. status of the Boot pins (on the small pinout chips, they are multiplexed) . that’d stop it.
  2. reset line high ?
  3. fuses correctly programmed (if so) so the BOD isnt holding the device in reset at the sys Vdd.
  4. clock running - scope on output of crystal oscillator if external crystal, default might be internal RC oscillator.
  5. I always put 33 ohm resistors in series with all JTAG//ICSP pins to dampen oscillatory behaviour,.
1 Like

Yes, and load capacitances are typically 15-22 pF for MHz and above crystals and about 10 pF for 32 kHz crystals. But easy enough to check if it there is a clock signal first. Also some MCUs have the capicitances on chip and only require the crystal.

The ATMEGA 328 datasheet recommends 12-22 pF. https://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-7810-Automotive-Microcontrollers-ATmega328P_Datasheet.pdf

Hmm, many ways to skin this cat. As others have said 22pf is the recommended load caps for this device, and you can program another board with no problem then you have an issue with your new board. Yes no need to solder any wires on just check on your scope that the crystal is oscillating. This chip is used on the Leonardo ? and if you see 5v where you should see 3.3v is probably your issue and its not uncommon for people to forget that some chips are ‘Tolerant’ of 5v but use 3.3v generally. I personally dont use a bootloader I use SPI (mosi, miso, etc) and you don’t need pullups or series resistors. Programming these devices as just the naked chips for use on your own projects is covered in exquisite detail by Nick Gammon I suggest checking your crystal and go to Nick’s site and you should be able to sort this out ! like I say my area is the 32P-AU but all the same stuff applies. Here you maybe will be able to describe the actual process you use in steps I can understand :nerd_face:
:mouse:

How do I slow the programmer down? The reset line is high, when uploading it drops low for a fraction of a second but then stops.

I don’t see any signal on the clock line. MISO, MOSI, SCK also show nothing on the scope. I feel that something may be wrong with my traces in terms of how close they are to each other…

Tried 22pF caps, but didn’t do anything. I used 8pF caps on my last design and it worked, so I do think that I put the traces too close to each other on the header, otherwise, it just doesn’t make any sense.

How close your traces are together will make no difference…
I dont know which programmer you have , but ALL programmers permit you to slow down the clock speed. That may be the problem.
if the reset goes low momentaryily then stops, it is trying to talk, what is the clock speed on the SCK clock lline ?
on MOSI/MISO, does it look like a bus fight ?

  • do any lines look like a bus fight ?
    also, is your programmer set up for the same Vdd as your circuit to program ? (I usually have a pin with a 33 ohm resistor in it on the head with Vdd, as the prgrammer needs to have a Vdd reference.
1 Like

I’m using the USB ASP programmer, how do I check the clock speed? It is currently set to 3.3V which is what the ICSP header is at in terms of voltage from my LDO regulator. The programmer works on a failed clock project I had, with the same setup.

The lines don’t appear to do anything, since upon bootloading it fails instantaneously:

Arduino: 1.8.19 (Windows Store 1.8.57.0) (Windows 10), Board: "Arduino Leonardo"

C:\Users\ricci\Documents\ArduinoData\packages\arduino\tools\avrdude\6.3.0-arduino17/bin/avrdude -CC:\Users\ricci\Documents\ArduinoData\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf -v -patmega32u4 -cusbasp -Pusb -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 "C:\Users\ricci\Documents\ArduinoData\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"



         Using Port                    : usb

         Using Programmer              : usbasp

         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 : usbasp

         Description     : USBasp, http://www.fischl.de/usbasp/



avrdude: auto set sck period (because given equals null)

avrdude: error: program enable: target doesn't answer. 1 

avrdude: initialization failed, rc=-1

         Double check connections and try again, or use -F to override

         this check.





avrdude done.  Thank you.



Error while burning bootloader.


I guess the simplest way is to eliminate stuff so perhaps go to your IDE and set for ‘Internal 8Mhz’ then you can disregard the crystal, usual programming set up is 9600 baud check your on the right ‘COM’ port. You have checked and double checked the wiring and the validity of the PCB traces, any possibility of a dead chip ? can you test the programming set up on another board ? this sort of set up is supposed to be very easy and very tolerant to things and it usually is so start from first principles and try looking on YouTube for more tutorials or read Nick’s stuff very carefully and this can only be very simple don’t look for something obscure the Arduino ecosystem has matured so try back there, the solution is simple I’m sure so chin up ! :grinning:
:mouse: