|
TMP91CW28 Datasheet, PDF (114/286 Pages) Toshiba Semiconductor – Original CMOS 16-Bit Microcontroller | |||
|
◁ |
TMP91CW28
Example: Generating a 50 kHz square wave with a 25% duty cycle (fc = 10 MHz)
20 μs
* Clocking conditions:
High-speed clock gear: Ã 1 (fc)
Prescaler clock:
fFPH
The time constant values to be loaded into the TA0REG and TA1REG are
determined as follows:
A 50 kHz waveform has a period of 20 μs.
When ÏT1 = ((23/fc)s) at 10 MHz) is used as the timer clock source, the TA1REG
should be loaded with:
20 μs ÷ (23/fc)s = 25
With a 25% duty cycle, the high pulse width is calculated as 20 µs à 1/4 = 5 µs. Thus,
the TA0REG should be loaded with:
5 μs ÷ (23/fc)s â 6 = 06H
TA01RUN
TA01MOD
TA0REG
TA1REG
TA1FFCR
76543210
â0 X X X â 0 0 0
â1 0 X XX X 0 1
â0 0 0 0 0 1 1 0
â0 0 0 1 1 0 0 1
âX X X X 0 1 1 X
P7CR
P7FC
TA01RUN
âX X â â â â 1 â
âX X â â X â 1 X
â1 X X X â 1 1 1
X: Donât care, â: No change
Stops and clears the TMRA0 and the TMRA1.
Selects 8-bit PPG mode and ÏT1 as the clock source.
Writes 06H.
Writes 19H.
Sets the TA1FF to 1 and enables toggling.
If these bits are set to 10, a low-going pulse is generated.
Configures P71 as the TA1OUT output pin.
Starts the TMRA0 and the TMRA1.
91CW28-112
2006-03-24
|
▷ |