Using the Internal Clock Source (ICS) for the QE Microcontrollers
QE128 Quick Reference User Guide, Rev. 1.0
Freescale Semiconductor
5-3
ICSSC = (*(unsigned char*far)0xFFAE) | 0x00; /* Initialize ICSSC register from a non volatile
memory */
ICSTRM = *(unsigned char*far)0xFFAF; // Initialize ICSTRM register from a non volatile memory
#endif FBI
}
This is the main function, above are the described called functions, and the interrupts are all enabled. The
ICS_configuration function configures the MCU in the selected clock mode. The clock frequency can be
seen on the PTE0 pin.
void main(void) {
MCU_Init(); // Function that initializes the MCU
GPIO_Init(); // Function that initializes the Ports of the MCU
ICS_Init(); // Function that initializes the ICS module
EnableInterrupts; // interrupts are enabled
for(;;) {
PTED_PTED0 ^= 1; // Toggle PTE0
Delay ();
} // loop forever
// please make sure that you never leave this function
}
The Bus frequency can be checked in the True-Time Simulator window of CodeWarrior. Once the program
is downloaded to the MCU, the simulator window opens, look at the command window and notice the
MCU bus frequency change. See
Figure 5-1
, for detailed information.