S12XDP/XEQ Self Clock Mode

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S12XDP/XEQ Self Clock Mode

865 Views
andradetj
Contributor I

I use the S12XDP512 and S12XEQ512 and I'm having many problems with clock locking in the field, when my device is already running.

 

I use a 4MHz crystal and pll to reach pllclk = 80MHZ and busclk = fpll / 2

 

S12XEQ512 config:

CRGINT = 0b00000010;

PLLCTL = 0b11001001;
REFDV = 0x40;
SYNR = 0x49;
POSTDIV = 0;
CLKSEL = 0b11000000;

 

S12XDP512 config:

CRGINT = 0b01000010;

PLLCTL = 0b11101001;

REFDV = 0;
SYNR = 9;

CLKSEL = 0b11000000;

 

My application works but in some cases there is a clock error and it goes into self clock mode.
  I configured the MCU to generate an interrupt in which I wait for the clock to stabilize:
  While (! CRGFLG_LOCK) {}
  CLKSEL_PLLSEL = 1;

 

In some cases this happens sporadically and the interruption is enough to resume normal operation.   But in other cases this happens very often, disrupting the operation of my application (e.g. messing with baudrates and serial communication).
 
I use the Full Swing Pierce Oscillator for the crystal circuit, but I do not have a pulldown resistor on the PE7 port to configure the MCU to use this oscillator circuit.
  I noticed that after booting it is always with /XCLKS = 0.

 

Shouldn't the problem only happen in the clock Initialization (not locking the clock) or can it happen in the middle of the operation too, after the initial lock?
What is the difference between the controlled pierce oscillator loop and the full swing pierce oscillator, in terms of Voltage noise and EMI tolerance?
Is there any other situation that can cause clock loss? Because it happens only in 10% of my equipment and I do not see any pattern that could cause the loss of the clock.
  
   Thank you.

Labels (1)
Tags (2)
0 Kudos
5 Replies

640 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi

If you want to use Full Swing Pierce Oscillator you have to make sure that XCLKS = 0. Since the oscillator is selected at reset state and there is a weak pull-up by default. You need to use a strong pull-down on that pin.

The Full Swing Oscillator is more stable and EMI-tolerant. But it can also generate more noise depending on configuration and its waveform.

Regards

Dan

0 Kudos

640 Views
andradetj
Contributor I

I understand that I must have XCLKS = 0 to use the full swing, but since I don't have it in my PCB it is starting the MCU with XCLKS = 1, yet it is able to lock the clock and, most of the time, it works fine, but sometimes it goes into self clock mode.

Shouldn't the problem only happen in the clock Initialization (not locking the clock)? or with the wrong oscillator selected it may be unstable and goes to SCM in a noisy environment?

0 Kudos

640 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

Apparently, you can run Loop Control Oscillator with Full Swing hardware configuration most of the time. There are many things to consider and it is difficult to say why it behaves this way.

Daniel

0 Kudos

640 Views
andradetj
Contributor I

Ok,

One more question, using the S12XEQ512 I can read the XCLKS bit in the CLKSEL register to confirm the oscillator configuration, but this bit doesn't exist on S12XDP512 . There is any other way to see the oscillator configuration on the S12XDP512 ?

Thank you

0 Kudos

640 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi

I'm afraid it is not possible on S12XDP512

Daniel

0 Kudos