Toshiba TMP92CM22FG TLCS-900/H1 Series Manual page 135

Toshiba original cmos 32-bit microcontroller
Table of Contents

Advertisement

3.8.4
Operation in Each Mode
(1) 16-bit interval timer mode
Generating interrupts at fixed intervals in this example, the interval time is set the
timer register TB0RG1H/L to generate the interrupt INTTB01.
← 0 0 X X − 0 X 0
TB0RUN
← X 1 0 0 X 0 0 0
INTETB0
← 1 1 0 0 0 0 1 1
TB0FFCR
← 0 0 1 0 0 1 * *
TB0MOD
← * * * * * * * *
TB0RG1
← 0 0 X X − 1 X 1
TB0RUN
X : Don't care, − : No change
(2) 16-bit event counter mode
In 16-bit timer mode as described in above, the timer can be used as an event counter
by selecting the external clock (TB1IN0 pin input) as the input clock.
Up counter counting up by rising edge of TB1IN0 pin input. And execution software
capture and reading capture value enable reading count value.
← 0 0 X X − 0 X 0
TB1RUN
← X X X X − − − 0
PDCR
← X X X X − − − 1
PDFC
← X 1 0 0 X 0 0 0
INTETB1
← 1 1 0 0 0 0 1 1
TB1FFCR
← 0 0 1 0 0 1 0 0
TB1MOD
← * * * * * * * *
TB1RG1
← 0 0 X X − 1 X 1
TB1RUN
X: Don't care, −: No change
Note: When used as an event counter, set the prescaler to "RUN" (TB1RUN<TB1PRUN> = "1").
7 6 5 4 3 2 1 0
(** = 01, 10, 11)
* * * * * * * *
7 6 5 4 3 2 1 0
* * * * * * * *
92CM22-133
Stop TMRB0.
Enable INTTB01 and set interrupt level 4. Disable
INTTB00.
Disable the trigger.
Set input clock to prescaler clock, and set capture function
to disable.
Set the interval time.
(16 bits)
Start TMRB0.
Stop TMRB1.
Set PD0 to TB1IN0 input mode.
Set INTTB11 to enable (Interrupt level4).
Set INTTB00 to disable.
Set trigger to disable.
Set input clock to TB1IN0 pin input.
Set number of count.
(16 bits)
Start TMRB1.
TMP92CM22
2007-02-16

Advertisement

Table of Contents
loading

This manual is also suitable for:

Tlcs-900/h1 series

Table of Contents