HOLT HI-3110 User Manual page 19

Hide thumbs Also See for HI-3110:
Table of Contents

Advertisement

MCU Clock and SPI Frequency
The Freescale MC9S12XDT512 (MCU) uses a 4MHz crystal for operation and the built-in PLL is used to
multiply this by 20 to achieve an 80MHz system clock. This system clock is divided by two for a 40MHz
Bus Clock which is used internally for the MCU peripherals.
The PLL is programmed to multiply by 20 by this line:
SYNR = 9;
The SPI frequency is set by this line of code:
SPI0BR = SPI_5MHZ;
Timer Interrupt and timings
A 100us Timer0 interrupt supports basic timings. A number of predefined constants are provided to
allow some common delays passed into the Delay100us() function:
#define K_1MS
#define K_10MS 100
#define K_100MS
#define K_1SEC
Usage: Delay100us(K_1SEC); // delay for one second
A one second interrupt handler in the TIMER_ISR is provided. Any code placed here will automatically
get executed every second.
if (!count100us)
{
count100us = K_1SEC;
if(ON==g_ledFlashBool)
LED8 ^= TOGGLE;
}
19
AN-175
// 80Mhz PLL system clock
// SPI CLK = 5MHz (see
// "peripherals.c"
10
1000
10000
// 1 second scheduler
for other rates)
// Flash the
// Alive 1 second blink
Holt Integrated Circuits

Advertisement

Table of Contents
loading

Table of Contents