|
TMP93CW46A Datasheet, PDF (103/242 Pages) Toshiba Semiconductor – CMOS 16-Bit Microcontroller | |||
|
◁ |
Example: Generating 1/5 duty 50 kHz pulse (at fc = 20 MHz)
TMP93CW46A
20 µs
* Clock condition
System clock:
Clock gear:
Prescaler clock:
High frequency (fc)
1 (fc)
fFPH
Calculate the value to be set for timer register.
To obtain the frequency 50 kHz, the pulse cycle t should be: t = 1/50 kHz = 20 µs.
Given ÏT1 = 0.4 µs (at 20 MHz),
20 µs ÷ 0.4 µs = 50
Consequently, to set the timer register 1 (TREG1) to TREG1 = 50 = 32H
and then duty to 1/5, t à 1/5 = 20 µs à 1/5 = 4 µs
4 µs ÷ 0.4 µs = 10
Therefore, set timer register 0 to TREG0 = 10 = 0AH.
TRUN
TMOD
TREG0
TREG1
TFFCR
76543210
ââ X â â â â 0 0
â1 0 X X X X 0 1
â0 0 0 0 1 0 1 0
â0 0 1 1 0 0 1 0
ââ â â 1 0 1 1 X
P7CR
P7FC
TRUN
âX X X X â â 1 â
âX X X X â â 1 X
â1 X â â â â 1 1
X: Donât care, â: No change
Stop timer 0, and clear it to â0â.
Set the 8-bit PPG mode, and select ÏT1 as input clock.
Write â0AHâ.
Write â32Hâ.
Sets TFF1 and enable the inversion and double buffer
enable.
Writing â10â provides negative logic pulse.
Set P71 as the TO1 pin.
Start timer 0 and timer 1 counting.
93CW46A-101
2004-02-10
|
▷ |