What Is My Exact P(E)CLOCK? DG256.

View: New views
2 Messages — Rating Filter:   Alert me  

What Is My Exact P(E)CLOCK? DG256.

by jmeyer-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm rocking a Freescale MC9S12DG256B with a crystal oscillator of 16MHz.

What is my exact P CLOCK or E CLOCK supposed to be? I assume it's 8MHz, but my clock algorith is off one second for every minute. I need an accuracy of on minute per day. Is it more like 8.192 MHz?

Please help.

Re: What Is My Exact P(E)CLOCK? DG256.

by melstav :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

--- In 68HC12@..., jmeyer@... wrote:
>
> I'm rocking a Freescale MC9S12DG256B with a crystal oscillator of 16MHz.
>
> What is my exact P CLOCK or E CLOCK supposed to be? I assume it's 8MHz, but my clock algorith is off one second for every minute. I need an accuracy of on minute per day. Is it more like 8.192 MHz?
>
> Please help.
>

Your P Clock and E Clock will be exactly 1/(2^n) of the frequency of your system oscillator. The value of n will vary depending on what you set the related configuration registers to. If your system oscillator is exactly 16.000MHz and your P Clock is "about" 8 MHz, then it should be *exactly* 8.000 MHz.

If your algorithm is giving you bad results, either you're not using a 16.000 MHz crystal, or your algorithm is bad.

I'd suggest getting familiar with the