atmega32u4 external clock not working

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello everybody!

 

I'm working on a project where I have two different prototypes (exactly same board), and one of them works the other doesn't.

I'm using an atmega32u4 with 16MHz external crystal. I have attached the PCB layout too.

 

 

- external crystal is at 16MHz, 22pF without 1M resistor.

- fuses are at: E:FF H:D2 L:DE (I need eeprom preservation, no jtag, no watchdog, isp programming)

 

The 16MHz doesn't oscillate, but everything works with the internal 8MHz oscillator.

I have tried the following:

- changing out the 16MHz oscillator

- changing the caps to new 22pF caps

- adding 1M

- changing the startup time with fuses

- resoldering everything, checking for cold joints

- create a shorter gnd trace

 

My way of testing the board is to init everything and send debug data through UART.

 

I have 100nF caps between vcc and gnd.

I'm not using USB.

 

Keep in mind that one of my boards works and the other doesn't. Every component is the same.

 

Feel free to ask questions about the setup.

Thanks!

 

Code is everything, code is life :D
 

Last Edited: Sun. Feb 9, 2020 - 09:27 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I see the uC and the Xtal pads, but it wasn't clear to me where the Xtal caps connect to ground.

 

Please post a complete and accurate schematic of your project to help spot any oversights.

 

Given that one board works, my first guess would be that you might not be setting the Fuses correctly for the external Xtal.

Make sure your read the Fuse settings on the working board, a then use those for the second board.

Depending upon your program for reading and writing the Fuses, make sure you press on the WRITE button to actually write the Fuse data tot he Fuses.

 

Make sure you have ALL of the Vcc, AVcc, and Ground pins, and any other power supply pins needed for the USB section, even if you are not using it, connected, and that each pair has its own by-pass cap, (0.1 uF).

 

An omission there could easily cause flaky operation.

 

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DocJC wrote:

I see the uC and the Xtal pads, but it wasn't clear to me where the Xtal caps connect to ground.

I think the OP does not have "thermal relieve"  connections. So the cpas have to be soldered to a solid ground plane.

I do miss the 2 VSS connections on the XTAL capas too. But upon further checking there are more pads missing.

Now tip to the OP, never ever make a pad connection like that. It is a recipe for failure. Always ensure there is thermal relieve on pad you have to solder.

in that respect I think that one of your capacitors on the non working board actually looks like it is attached to ground, but effectively is not. re solder all the ground connections and double check visually that the connections are actually OK.

 

Also a thing one better not does is put vias in pads. Again these act as thermal relieve and as such make soldering a part much harder and is prone to be a trouble cause. Not to mention that if you ever do this with an automatic assembly line the solder paste will disappear in the via making the solder connections badly giving potentially defects in the field.  Unless of coarse you have made the PCB with filled vias, but then they become very expensive.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

 

thanks for the reply. I do have GND connected, it is just not correctly shown in the picture.

https://i.imgur.com/rKLaZlc.png

 

Here you can see the GND connection, and yes I agree it can be a problem with the reflow will fix that too.

 

Any suggestions to try and fix?

Code is everything, code is life :D
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Normally thermal relieve settings are a design rule thing, so you have to look in your cad program if you find it there, or else check the documentation. Most likely place would be in the rules that are part of the places.

On your current PCB you are stuck with this. Just take a magnifier and closely inspect if the solder is actually touching both the capacitor and the PCB. when in doubt, just re-heat the pad with a soldering iron for a number of seconds. 

 

Also I think the 22pf capacitors are on the high side. Check the specification of the crystal as to what load capacitance is required.

A simple formula is Cx = 2 * ( CL - Cstray )

were CX is the external capacitance you have to add.

Cl is the load capacitance specified by the crystal manufacturer

Cstray is the stray capacitance of the processor pin ( most likely 0.5pf, but check datasheet on that) PLUS the stray capacitance of the tracks on the PCB. now for this last parameter we usually take between 2,5pF and 3,5pF. But in the end you have to check at what capacitance value you are going to end anyway so that number is less important with respect to precission.

 

edit:

as a note also check the datasheet of the processor if it has limitations on the allowed capacitance of the crystal.

 

 

 

Last Edited: Tue. Feb 11, 2020 - 07:56 AM