Freescale Semiconductor Demonstration Board for MC9RS08KA2 von Freescale DEMO9RS08KA2 DEMO9RS08KA2 Ficha De Dados

Códigos do produto
DEMO9RS08KA2
Página de 136
Modulo Timer (RS08MTIMV1) 
MC9RS08KA2 Series Data Sheet, Rev. 4
96
 
Freescale Semiconductor
 
 
 
11.4.1
MTIM Operation Example
This section shows an example of the MTIM operation as the counter reaches a matching value from the 
modulo register.
Figure 11-7. MTIM Counter Overflow Example
In the example of 
, the selected clock source could be any of the four possible choices. The 
prescaler is set to PS = %0010 or divide-by-4. The modulo value in the MTIMMOD register is set to $AA. 
When the counter, MTIMCNT, reaches the modulo value of $AA, the counter overflows to $00 and 
continues counting. The timer overflow flag, TOF, sets when the counter value changes from $AA to $00. 
An MTIM overflow interrupt is generated when TOF is set, if TOIE = 1.
selected 
clock source
MTIMCNT
MTIM clock
(PS=%0010)
MTIMMOD:
$AA
$A7
$A8
$A9
$AA
$00
$01
TOF