Setup Example - Panasonic MN101L Series User Manual

Lsi
Table of Contents

Advertisement

Chapter 9
16-bit Timer
9.4.2

Setup Example

Event Count Setup Example
Here is an example that, using timer 7, detecting the falling edge of the TM7IOA input 5 times generates the first
interrupt only, and subsequent interrupts are generated every 4 detections.
The setup procedure and its description are shown below.
Step
Setting
1
Disable the timer counter
2
Disable the interrupt
3
Select the event input
4
Set the timer mode register
5
6
Set the interrupt cycle
7
Set the timer mode register
8
9
Set the interrupt level
10
Enable the interrupt
11
Enable the timer counter
IX - 28
16-bit Event Count
Register
TM7MD1.TM7EN = 0
TM7ICR.TM7IE = 0
TMIOSEL1.TM7IOSEL1-0 = 00
P0DIR.P0DIR4 = 0
TM7MD1.TM7CK1-0 = 01
TM7MD1.TM7PS1-0 = 00
TM7PR1 = 0x0003
TM7MD2.TM7BCR = 1
TM7MD1.TM7CK1-0 = 10
TM7MD1.TM7PS1-0 = 00
TM7ICR.TM7LV1-0
TM7ICR.TM7IE = 1
TM7MD1.TM7EN = 1
Description
Disable the timer count operation.
Disable the timer interrupt.
Select the event clock input pin.
[Chapter 7 I/O Port]
Select SYSCLK as the clock source.
Set the interrupt generation cycle.
Select the TM7BC clear source.
Select TM7IO input as the count clock source.
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