AnsweredAssumed Answered

ICG With External Oscilattor

Question asked by David Boyd on May 28, 2013
Latest reply on May 29, 2013 by David Boyd

Hi,

I'm using an 9S08AC128 with an external 4.000MHz canned oscillator, and require a bus clock of 16.000MHz.  I've assumed I will need to switch to FEE mode, with N=16 and R=2.

 

To test my overall project I have a 32.000MHz oscillator attached, creating a 16.000MHz bus clock.

ICG_Init               mov #%01010000,rICGC1

                            mov #%00000000,rICGC2

                            rts

The above code works fine.  I have a timer generating a 1Hz signal that flashes a LED and it's quite accurate as you would expect. Now it's time to swap over to the 4.000MHz oscillator.

 

Page 201 of the Reference Manual provides an example that generates a bus clock of 20 MHz from a 4MHz crystal. The code example is:

ICG_Init     mov #%01111000,rICGC1

                            mov #%00110000,rICGC2 ;N=10, R=1

                            rts

 

When I run this code I get a bus clock substantially below 20 MHz (visible by a very slow flashing LED). My plan was to then change ICGC2 to N=16 and R=2 to generate my 16.000MHz bus clock.

 

Curiously page 202 of the same Reference Manual gives a different value for ICGC1 than the previous page for the same example, and I suspect that's a typo.

 

Any suggestions about what I have overlooked? 

 

David


Outcomes