Author Topic: SAM3X8E oscillator problems  (Read 652 times)

0 Members and 1 Guest are viewing this topic.

Offline Aleksander SpyraTopic starter

  • Newbie
  • Posts: 2
  • Country: pl
SAM3X8E oscillator problems
« on: November 29, 2020, 07:04:34 pm »
Hi there!

I have recently designed a campervan module. I based it off an Arduino Due, but I had to move to a custom board to utilise all the available pins of the SAM3X8E. I based the design on Due schematics, stripped the mega16u2 and the native USB port and added all the functionality I needed.

The assembled board has arrived. I have checked the power supply and programmed a simple blink program using SWD. The upload was succesful, but the LED wasn't blinking.
After double checking pin naming etc, the board is still not running the program.
As the chip was programmed correctly, I suspect the external 12MHz oscillator. I borrowed an oscilloscope and captured the XIN waveform (identical on both boards).

The amplitude is only around 300mV and looks like a sine.
Here is the info I collected:

My oscillator schematic: https://drive.google.com/file/d/1vwSKC3EPUPUz45JPSo4B4OVt-c6gcqXz/view?usp=sharing
DUE oscillator schematic: https://www.arduino.cc/en/uploads/Main/arduino-Due-schematic.pdf
Datasheet of the oscillator I used: https://datasheet.lcsc.com/szlcsc/Yangxing-Tech-X322512MSB4SI_C9002.pdf
My top layer:

 - here I made an error, the ground fill shouldn't connect to the crystal
My bottom layer:

SAM3X8E datasheet (page 1397): https://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-11057-32-bit-Cortex-M3-Microcontroller-SAM3X-SAM3A_Datasheet.pdf

I have tried desoldering the load capacitors (I calculated 33pF instead on Due's 22pF), the waveform didn't change. I also tried to change the VDDPLL ferrite bead to one desolder from a faulty Due board. I've also swapped the crystal to the one from Due.

I cannot find my error. Maybe you can see whats wrong?
« Last Edit: November 29, 2020, 07:26:21 pm by Aleksander Spyra »
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11725
  • Country: us
    • Personal site
Re: SAM3X8E oscillator problems
« Reply #1 on: November 29, 2020, 07:41:41 pm »
This is a correct behaviour for the crystal oscillator. Perfect, actually.

Look for some other reason, but enough of your code runs to configure and enable the oscillator, which is good. Now debug the rest.
Alex
 
The following users thanked this post: Aleksander Spyra

Offline Aleksander SpyraTopic starter

  • Newbie
  • Posts: 2
  • Country: pl
Re: SAM3X8E oscillator problems
« Reply #2 on: November 29, 2020, 08:13:53 pm »
Good to know! I wanted to check with a Due board, but the one I have is fried and I'm waiting for another to arrive.
I wonder if the lack of USB circuitry can bother the Arduino startup code, as there really isn't much that can go wrong with a blink sketch. Or maybe the way I program it (PlatformIO + STLink) may be problematic... When the new Due arrives, I'll be able to try programming it the same way - this way I will be 100% sure it is not a hardware problem.

Thanks!
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11725
  • Country: us
    • Personal site
Re: SAM3X8E oscillator problems
« Reply #3 on: November 29, 2020, 08:29:35 pm »
I have no idea about Arduino and its dependencies.

But if the oscillator runs at all, your programming method is probably fine.
Alex
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf