AN2372 Freescale Semiconductor / Motorola, AN2372 Datasheet - Page 4

no-image

AN2372

Manufacturer Part Number
AN2372
Description
Using the Output Compare TPU Function (OC) with the MPC500Family
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Continuous Pulse Mode
Each time a match event occurs, the pin state changes, a new REF_TIME is calculated by adding the
parameters OFFSET and REF_TIME, and an interrupt request is issued to the host. As shown in Figure 2,
the first rising edge occurs after the first link following initialization at the reference time pointed to by
REF_ADDR. The pulse width is equal to the value in OFFSET, which the TPU calculates as (REF_ADDR2)
* RATIO. OC then continuously generates this pulse in a 50% duty cycle waveform until the next link is
received. When the new link is received, the TPU re-calculates OFFSET, using the cur- rent values in
RATIO and the parameter pointed to by REF_ADDR2. The new pulse period then takes effect at the next
rising edge.
If the OFFSET is less than or equal to zero, initialization for this mode is performed without intervention
by the CPU, and the channel is configured as specified in CHANNEL_CONTROL. The pin remains in the
state specified by CHANNEL_CONTROL until the first link service request is received. At this point
operation continues as described above. Clearing OFFSET to zero can be done by action of a PPWA
function on another channel that is providing the input values to which this OC function is synchronized, if
the input signal slows to the extent that the input is presumed to be stopped.
The maximum usable value for any comparison with a TCR in the TPU is limited to 0x8000 more than the
TCR value at the time that the match register is loaded. The TPU sees any value greater than TCR + 0x8000
as a time in the past and immediately generates a match. Figure 3 illustrates this principle, assuming the
TCR is at 0x2800 when the offset calculation is made, and the comparison value is written into the match
register. Any value greater than 0xA800 causes a greater-than comparison, resulting in an immediate match
event.
4
FIRST LINK OUT OF INITIALIZATION
REF_TIME = (REF_ADDR3)
OFFSET = (REF_ADDR2) * RATIO
REF_TIME = (REF_TIME) + OFFSET
Freescale Semiconductor, Inc.
Figure 2. Continuous Pulse Mode Diagram
For More Information On This Product,
Using the Output Compare TPU Function
Go to: www.freescale.com
REF_TIME = (REF_ADDR1)
LINK RECEIVED, CALCULATE NEW OFFSET
NEW OFFSET USED
MOTOROLA

Related parts for AN2372