EasyManua.ls Logo

Panasonic MN103S

Panasonic MN103S
552 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Chapter 9
16-bit Timer
Timer Output IX - 55
9.7.2 Setup Example
TImer Output Setup Example
The output pin (TM8AIO) using timer 8 outputs waveforms as shown below (repeating “L” output for 1ms and
“H” output for the next 1ms). IOCLK is selected as clock source to match the binary counter and the compare/
capture register for every 1 ms. The oscillator frequency is set to 10 MHz, 6 multiplication and IOCLK=MCLK/2.
A setup procedure with a description of each step is shown below.
Figure:9.7.2 Timer Output Setup Example
Setup Procedure Description
(1) Stop the counter
TM8MD(0x0000A200)
bp6: TMLDE=0
bp7: TMCNE=0
(1) Set the TMLDE flag and TMCNE flag of the timer 8
mode register (TM8MD) to “0” to stop the timer 8
counting.
(2) Set the repeating cycle
TM8CA(0x0000A208)=0x752F
(2) Set the repeating cycle to the timer 8 compare/capture A
register (TM8CA). The setting value is 29999 (0x752F)
due to 30000 counts.
(3) Select the count clock source
TM8MD(0x0000A200)
bp2-0: TMCK2-0=000
(3) Select the count clock source (IOCLK) by the TMCK2-0
flag of the TM8MD register.
(4) Select the timer up/down
TM8MD(0x0000A200)
bp9-8: TMUD1-0=00
(4) Select the timer up counting by the TMUD1-0 flag of the
TM8MD register.
(5) Set the timer counter clear enabled
TM8MD(0x0000A200)
bp11: TMCLE=1
(5) Set the TMCLE flag of the TM8MD register to “1” to
enable the clear operation of the TM8BC counter.
When the TM8CA register and the TM8BC counter
match, the TM8BC counter is cleared.
(6) Select the timer compare/capture A
operation mode
TM8MDA(0x0000A204)
bp7-6: TMAM1-0=00
(6) Set the function of the timer 8 compare/capture register
to the compare register (double buffer) by the TMAM1-
0 flag of the timer 8 compare/capture A mode register
(TM8MDA).
(7) Select the timer A pin polarity
TM8MDA(0x0000A204)
bp5: TMAEG=0
(7) Set the TMAEG flag of the TM8MDA register to “0” to set
the initial condition of the pin output to “L”. When the
initial condition of the pin output is set to “H”, set the
flag to “1”.
(8) Select the timer A output waveform
TM8MDA(0x0000A204)
bp1-0: TMAO1-0=11
(8) Set the timer A output waveform selection to the timer
output by the TMA01-0 flag of the TM8MDA register.
Output pin
(TM8AIO)
1ms 1ms

Table of Contents

Other manuals for Panasonic MN103S

Related product manuals