Design Review Request - RGB Sign

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:

The chip I had placed on by JCLPCB, also how do I change the clock to the internal 8Mhz, COM port is detected and the traces seem fine. The other board I tested on was a clock I tried to make and it works fine, never have an issue bootloading. I also tried making a solder joint for J1 on my USBasp in order to slow down the SCK line, but that didn’t work either.

Here’s a picture of the back of the board for context.

As regards too the clock speed I set up that within ‘tools’ in the Arduino IDE what you are using right ? but I am running out of ideas now because I can’t replicate any of this at home. Did you check for the clock running and reset condition ? I think it’s time to use a dedicated forum, any of the Atmel/Arduino forums will probably walk you through a set of steps instead of clutching at straws like I’m doing :woozy_face: for instance I have never used USBC is that set up correctly ? is that even relevant ? so not sure what more I can do.
:mouse:

1 Like

You board looks really nice!

I just finished a project that uses those same multi-color LED (Neo Pixel, WS2812, WS2811 and SK6812 LED/drivers) and when I went to have the boards made the manufacturing house told me the datasheet recommends those parts be baked at 60 degrees C for at least 24 hrs prior to relow oven soldering them. This bakes off any moisture that can damage the parts when they are soldered in the reflow process. This added time and cost to the board maufactuirng as I had to upgrade from the basic standard PCB assembly process to the Advanced PCB assembly process. I dont know if this would apply to hand solder too. I didn’t know about this when I was designing my project and it would have influences which LED I used. I thought I’d pass that along as info…

1 Like

I am using the Arduino IDE, the RESET line is high and gets pulled low when I hit “burn bootloader”. The programmer is set to USBasp, the board is set to Arduino Leonardo, Clock on the scope did not show any output despite changing crystals, and changing caps from 8pF to 22pF. Already asked this question on the Arduino form but nobody seemed to answer, along with r/embedded on Reddit. This is just kind of frustrating cause like you said it’s a simple process and should work. Also, USBC did work on my digital clock board, its simply tied to D+ and D- on the Atmega32U4. what Atmel forum would you recommend?

Thank you! I just can’t seem to get it to bootload, its a really cool project but I can’t actually upload my code right now.

Oh ok, How to run without a crystal is in the datasheet of the chip somewhere. Is that a 8 or 16 MHz oscillator ? and is it a resonator or a crystal I haven’t used that package. Ok, first thing is to establish the clock is running at the PIN on the IC if it isn’t then you start there if it is then good. In the meantime a site I used regularly is ’ AVR Freaks’ type that into google they are the AVR/Atmel guy’s go check that out.
:mouse:

Gotcha, here’s the digikey link: TSX-3225 16.0000MF18X-AC6 EPSON | Crystals, Oscillators, Resonators | DigiKey and its a 16MhZ crystal, I tried checking pins 1 and 3 on my scope, on the clock board which works the signal would rise to around 3v (can’t remember exactly) but on the bad board it stays at 0. Also when probing the good board with a scope, probing the clock makes it fail to bootload or upload code, so it seems pretty sensitive. That’s only when I probe it though.

Ok does the good board use the same crystal ? According to the data sheet the load caps can anything from7pf up so it isn’t that. The good board will probably not work when probed because the probe itself will load it up so don’t worry about that you need to get the clock oscillating on pins 1/3 so check voltages are all present at the chip then check the integrity of al components around your crystal as this must be the problem.
:mouse:

1 Like