PLL and Timers

cancel
Showing results for 
Search instead for 
Did you mean: 

PLL and Timers

376 Views
harshitha_chiga
Contributor II

@

Hii,

I want to know how PLL and Timers are interrelated?

This is my PLL code and Timer code that has an interrupt which produces a 10ms delay

static void PLL_Init(unsigned char synr, unsigned char refdv, unsigned char postdiv)
{
PLLCTL = 0B00000001; // CME=0,PLLON=0,FM1=0,FM2=0,FSTWKP=0,PRE=0,PCE=0,SCME=1
CLKSEL = 0B00000011; // PLLSEL=0,PSTP=0,PLLWAI=0,RTIWAI=1,COPWAI=1
SYNR = synr; // Set the multiplier register
REFDV = refdv; // Set the divider register
POSTDIV = postdiv; // Set the post divider register
PLLCTL_PLLON = 1; // Enable the Phase Lock Loop
while(!CRGFLG_LOCK); // Wait till the PLL VCO is within tolerance
CLKSEL_PLLSEL = 1; // Select clock source from PLLCLK
//ECLKCTL_NECLK=0; // Enable the BusClk output at ECLK pin
}

They have configured many things i want to know how they are related to each other, why PLL is required for timers

#

Tags (1)
7 Replies

76 Views
RadekS
NXP Employee
NXP Employee

Hi Harshitha,

All the TIM/ECT/PIT timers at S12XE are by gated from bus clock.

By default after reset, the bus clock = oscillator clock / 2.

The PLL may be used for increasing (decreasing) bus clock frequency.

 

See attached PLL calculator for S12XE.


I hope it helps you

Have a great day,
Radek

76 Views
harshitha_chiga
Contributor II

Hi Radek,

Thank you very much your document helped me a lot

Thanks 

Harshitha

0 Kudos

76 Views
harshitha_chiga
Contributor II

Hi Diana,

I am using Timer Module

Thanks and Regards

Harshitha

0 Kudos

76 Views
harshitha_chiga
Contributor II

Hi Diana,

 

I am using S12XEP100 as micro-controller and timer HCS12 

 

Thanks and Regards,

Harshitha

0 Kudos

76 Views
dianabatrlova
NXP TechSupport
NXP TechSupport

Hi Harshitha,

 

Thank you for your feedback.

The S12XE family includes, for example, periodic interrupt timer (PIT), enhanced capture timer (ECT),

standard timer module (TIM).

Which one do you use?

Best regards,

Diana

76 Views
harshitha_chiga
Contributor II

Hi Diana,

I am using S12XEP100 as micro-controller and i am not sure about specific timer.

Thanks and Regards,

Harshitha

0 Kudos

76 Views
dianabatrlova
NXP TechSupport
NXP TechSupport

Hi Harshitha,

Could you tell me which MCU and which timer do you use?

Thank you.

Best regards,

Diana

0 Kudos