AnsweredAssumed Answered

PPL and PIT Confusion

Question asked by Ray Hall on Mar 21, 2015
Latest reply on Mar 24, 2015 by Ray Hall

I am confused with the PPL and PIT calculations.

 

I am using the S12XE PPL Calculator (ver 1.03)

 

1. Is the "Oscillator" the external 16 mHz crystal I am using.

2. Is the "Bus frequency" the frequency all timers are based on.

3. What is the "VCO frequency" and when do I use it.

4. What is the "REFCLK frequency" and when do I use it.

 

When using the PPL calculator to set the bus frequency to 20 mHz. This gives me 0x44 0x81 0x01 with my 16 mHz crystal ?

 

Now the PIT timer settings. I look at  example code and it has this example,

 

//fbus 8MHz

//period = (PITMTLD+1)*(PITLD+1)/fbus

//period = (19999+1)*(199+1)/8MHz = 500ms

 

This is confusing. I calculate the result as 0.5 not 500.

So does this formula give you the time in seconds or mSec.

 

I want the PIT timer to interrupt every 10 mSec. Using the same formula,

 

//fbus 20MHz

//period = (PITMTLD+1)*(PITLD+1)/fbus

//period = (4999+1)*(39+1)/20MHz = 0.01

 

if the 0.01 is seconds then 0.01 is the 10 mSec I require. The problem is the timer interrupts much faster then this.

 

Sorry for the silly questions. I just am new to the Freescale S12XE jargon and methods.

 

Ray.

Outcomes