Setup Example - Panasonic MN101L Series User Manual

Lsi
Table of Contents

Advertisement

Chapter 9
16-bit Timer
9.3.2

Setup Example

Timer Operation Setup Example
Here is an example that the periodic interrupt of Timer 7 is generated every 1000 cycles (250 µs) with selecting
HCLK/2 (at f
HCLK
Step
Setting
1
Disable the timer counter
2
Disable the interrupt
3
Set the timer mode register
4
Set the interrupt cycle
5
6
Set the interrupt level
7
Enable the interrupt
8
Enable the timer counter
IX - 24
16-bit Timer
= 8 MHz) as a clock source. The setup procedure and its description are shown below.
Register
TM7MD1.TM7EN = 0
TM7ICR.TM7IE = 0
TM7MD2.TM7BCR = 1
TM7MD1.TM7CK1-0 = 00
TM7MD1.TM7PS1-0 = 01
TM7PR1 = 0x03E7
TM7ICR.TM7LV1-0
TM7ICR.TM7IE = 1
TM7MD1.TM7EN = 1
Description
Disable the timer count operation.
Disable the timer interrupt.
Select the TM7BC clear source.
Select the clock source.
Set the cycle of timer interrupt.
Setup value: 1000 - 1 = 999 (0x03E7)
Refer to [3.1.3 Maskable Interrupt Control Register Setup].
Enable the timer count operation.

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mn101lr05dMn101lr04dMn101lr03dMn101lr02d

Table of Contents