TMP92CM22 2007-02-16 92CM22-116
Example: To generate 1/4 duty 62.5 kHz pulses (at fC= 40 MHz):
Calculate the value that should be set in the timer register.
To obtain a frequency of 62.5 kHz, the pulse cycle t should be: t = 1/62.5 kHz = 16 μs
φT1 (= (16/fc)s (at fC = 40MHz);
16 μs/(16/fc)s = 40
Therefore set TA1REG to 40 (28H)
The duty is to be set to 1/4: t × 1/4 = 16 μs × 1/4 = 4 μs
4 μs/(16/fc)s = 10
Therefore, set TA0REG = 10 = 0AH
7 6 5 4 3210
TA01RUN
0 X X X
0 0 0 Stop TMRA0 and TMRA1 and clear it to “0”.
TA01MOD 1 0 X X X X 0 1 Set the 8-bit PPG mode, and select φT1 as input clock.
TA0REG 0 0 0 0 1010 Write 0AH.
TA1REG 0 0 1 0 1000 Write 28H.
TA1FFCR X X X X 011X Set TA1FF and set inversion to enable.
Writing “10” provides negative logic pulse.
PCCR
X X X1
PCFC
X X X1
Set PC1 to TA1OUT pin.
TA01RUN
1 X X X
1 1 1 Start TMRA0 and TMRA1 counting.
X : Don’t care, : No change
16
μ
s