Timer Module (TIM16B2CV3)
MC9S12VRP Family Reference Manual Rev. 1.3
356
NXP Semiconductors
By enabling the PRNT bit of the TSCR1 register, the performance of the timer can be enhanced. In this
case, it is possible to set additional prescaler settings for the main timer counter in the present timer by
using PTPSR[7:0] bits of PTPSR register generating divide by 1, 2, 3, 4,....20, 21, 22, 23,......255, or 256.
11.4.2
Input Capture
Clearing the I/O (input/output) select bit, IOSx, configures channel x as an input capture channel. The
input capture function captures the time at which an external event occurs. When an active edge occurs on
the pin of an input capture channel, the timer transfers the value in the timer counter into the timer channel
registers, TCx.
The minimum pulse width for the input capture input is greater than two Bus clocks.
An input capture on channel x sets the CxF flag. The CxI bit enables the CxF flag to generate interrupt
requests. Timer module must stay enabled (TEN bit of TSCR1 register must be set to one) while clearing
CxF (writing one to CxF).
11.4.3
Output Compare
Setting the I/O select bit, IOSx, configures channel x when available as an output compare channel. The
output compare function can generate a periodic pulse with a programmable polarity, duration, and
frequency. When the timer counter reaches the value in the channel registers of an output compare channel,
the timer can set, clear, or toggle the channel pin if the corresponding OCPDx bit is set to zero. An output
compare on channel x sets the CxF flag. The CxI bit enables the CxF flag to generate interrupt requests.
Timer module must stay enabled (TEN bit of TSCR1 register must be set to one) while clearing CxF
(writing one to CxF).
The output mode and level bits, OMx and OLx, select set, clear, toggle on output compare. Clearing both
OMx and OLx results in no output compare action on the output compare channel pin.
Setting a force output compare bit, FOCx, causes an output compare on channel x. A forced output
compare does not set the channel flag.
Writing to the timer port bit of an output compare pin does not affect the pin state. The value written is
stored in an internal latch. When the pin becomes available for general-purpose output, the last value
written to the bit appears at the pin.
11.4.3.1
OC Channel Initialization
The internal register whose output drives OCx can be programmed before the timer drives OCx. The
desired state can be programmed to this internal register by writing a one to CFORCx bit with TIOSx,
OCPDx and TEN bits set to one.
Set OCx: Write a 1 to FOCx while TEN=1, IOSx=1, OMx=1, OLx=1 and OCPDx=1
Clear OCx: Write a 1 to FOCx while TEN=1, IOSx=1, OMx=1, OLx=0 and OCPDx=1
Summary of Contents for MC9S12VRP64
Page 16: ...MC9S12VRP Family Reference Manual Rev 1 3 16 NXP Semiconductors ...
Page 46: ...Device Overview S12VRP Series MC9S12VRP Family Reference Manual Rev 1 3 46 NXP Semiconductors ...
Page 236: ...S12S Debug Module S12DBGV2 MC9S12VRP Family Reference Manual Rev 1 3 236 NXP Semiconductors ...
Page 244: ...Interrupt Module S12SINTV1 MC9S12VRP Family Reference Manual Rev 1 3 244 NXP Semiconductors ...
Page 358: ...Timer Module TIM16B2CV3 MC9S12VRP Family Reference Manual Rev 1 3 358 NXP Semiconductors ...
Page 436: ...Supply Voltage Sensor BATSV2 MC9S12VRP Family Reference Manual Rev 1 3 436 NXP Semiconductors ...
Page 528: ...NVM Electrical Parameters MC9S12VRP Family Reference Manual Rev 1 3 528 NXP Semiconductors ...
Page 530: ...Package Information MC9S12VRP Family Reference Manual Rev 1 3 530 NXP Semiconductors ...
Page 531: ...Package Information MC9S12VRP Family Reference Manual Rev 1 3 NXP Semiconductors 531 ...
Page 532: ...Package Information MC9S12VRP Family Reference Manual Rev 1 3 532 NXP Semiconductors ...