English
Language : 

Z8F1680SH020SG Datasheet, PDF (129/412 Pages) Zilog, Inc. – High-Performance 8-Bit Microcontrollers
Z8 Encore! XP® F1680 Series
Product Specification
104
– Configure the timer for DEMODULATION Mode. Setting the mode also involves
writing to the TMODEHI bit in the TxCTL0 Register
– Set the prescale value
– Set the TPOL bit to set the Capture edge (rising or falling) for the Timer Input.
This setting applies only if the TPOLHI bit in the TxCTL2 Register is not set
2. Write to the Timer Control 2 Register to:
– Choose the timer clock source
– Set the TPOLHI bit if the Capture is required on both edges of the input signal
3. Write to the Timer Control 0 Register to set the timer interrupt configuration field
TICONFIG.
4. Write to the Timer High and Low Byte registers to set the starting count value (typi-
cally 0001H).
5. Write to the Timer Reload High and Low Byte registers to set the reload value.
6. Clear the Timer TxPWM0 and TxPWM1 High and Low Byte registers to 0000H.
7. If required, enable the noise filter and set the noise filter control by writing to the rele-
vant bits in the Noise Filter Control Register.
8. If required, enable the timer interrupt and set the timer interrupt priority by writing to
the relevant interrupt registers. By default, the timer interrupt will be generated for
both input capture and reload events. If required, configure the timer interrupt to be
generated only at the input Capture event or the Reload event by setting TICONFIG
field of the Timer Control 0 Register.
9. Configure the associated GPIO port pin for the Timer Input alternate function.
10. Write to the Timer Control 1 Register to enable the timer. Counting will start on the
occurrence of the first external input transition.
In DEMODULATION Mode, the elapsed time from timer start to Capture event can be
calculated using the following equation:
Capture Elapsed Time (s) = ---C----a---p---t-u---r--e----V-----a--l--u---e---------S---t--a--r--t----V----a---l-u---e------------P---r--e---s--c---a--l--e-
Timer Clock Frequency (Hz)
PS025015-1212
PRELIMINARY
Timers