Hi,
I'm working on the MCF51QE128 micro and it is found that the micro when set to derive its Bus clock from the external crystal of 32.768 KHz the FLL derives an clock frequency in terms of decimal values (as per the reference manual which is Okay). But the problem or issue we are facing currently is that, when the FLL derived clock has been used to derive the counter values for the hardware timers there is an variation in the timing of the hardware timer interrupt's for the same count value from one hardware board to the another hardware board (Crystals and Software are similar on both boards). For e.g. say if the counter is configured to interrupt every 2 ms it would interrupt at 1.880ms. The behavior seems to be weird because the interrupts occur at 2 ms in one board with the same driver and configurations but 1.880 ms on an another board. Please provide some insights to this issue.
Thanks Balu.
With an external crystal of 32.768 KHz the bus clock that you can get is 4.194304 MHz,
And here is the configuration
/*lint -restore Enable MISRA rule (11.3) checking. */
/* ICSC1: CLKS=0,RDIV=0,IREFS=0,IRCLKEN=1,IREFSTEN=0 */
ICSC1 = 0x02; /* Initialization of the ICS control register 1 */
/* ICSC2: BDIV=1,RANGE=0,HGO=0,LP=0,EREFS=1,ERCLKEN=1,EREFSTEN=0 */
ICSC2 = 0x46; /* Initialization of the ICS control register 2 */
while(ICSSC_OSCINIT == 0) { /* Wait until the initialization of the external crystal oscillator is completed */
}
/* ICSSC: DRST_DRS=0,DMX32=0 */
ICSSC= 0x00U); /* Initialization of the ICS status and control */
while((ICSSC & 0xC0) != 0x00) { /* Wait until the FLL switches to Low range DCO mode */
}
I hope this will help you.
Can you please share your clock configuration,
Are you sure that you are running using the external clock?
Vicente
Hi Pedro,
Please find the clock configuration as listed below.
ICSC1 = 0b00000100;
ICSC2 = 0b01000111;
ICSTRM = *(unsigned char*far)0xFFAF;
ICSSC = (*(unsigned char*far)0xFFAE) | 0x60;
I am sure that the external clock has been used as a reference as i can see the system RTC is always in sync with the reference real time clock (say any, GPS synched or internet clock) with above configuration. On the other note the RTC starts drifting when i use the internal clock.
Looking forward for your immediate assistance on this front.
Thanks and Regards,
Balu V
You have
ICSC1 = 0b00000100;
That set the IREFS
This is use the internal clock
Please let me know the mode that you want to run? FEE? the bus clock that you want?
Also check that the capacitor on the board are not damage.
Regards