AN2372 Freescale Semiconductor / Motorola, AN2372 Datasheet - Page 14

no-image

AN2372

Manufacturer Part Number
AN2372
Description
Using the Output Compare TPU Function (OC) with the MPC500Family
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Example B
8.1.3
8.2
8.2.1
This example uses OC with the PPWA function to divide the input frequency to the PPWA channel by four.
The PPWA function repeatedly accumulates sixteen input periods and then generates a link to the OC
function. The OC function scales the accumulated period and then generates the scaled output waveform.
The PPWA function is on channel 0, and the OC function is on channel 3. Both waveforms produce a 50%
duty cycle.
8.2.2
The PPWA function is assigned to channel 0 so that it has higher priority than the OC function. It is set up
for mode 1, to accumulate 16-bit periods and generate links. The PPWA parameters are initialized as
follows:
START_LINK_CHANNEL is set to 3, the number of the channel running the OC function.
LINK_CHANNEL_COUNT is set to 1, since there is one channel in the link block.
CHANNEL_CONTROL is set to 0x310B. This sets the TBS field to capture and match TCR1, the PAC field
to detect falling edge for period accumulate, and the PSC field to "do not force any state".
MAX_CNT is the number of periods per accumulation. In this case it is sixteen.
ACCUM_RATE determines how often ACCUM is updated during accumulations. Since a running
accumulation is not desired, this parameter is set to the slowest rate possible, 0xFF.
14
0X30412A
0x304120
0x304122
0x304124
0x304126
0x304128
Example B
Output Waveforms
Description
Initialization
X
X
X
0
1
1
X
X
0
0
1
Freescale Semiconductor, Inc.
X
X
X
0
0
1
For More Information On This Product,
Using the Output Compare TPU Function
T a b l e 7 . O C C h a n n e l P a r a m e t e r R A M
X
X
X
0
0
1
Go to: www.freescale.com
X
X
X
0
0
1
X
X
X
0
0
1
0
X
0
1
X
X
X
X
X
0
0
0
1
X
0
0
X
X
X
X
X
0
0
0
X
X
X
0
0
0
X
X
X
0
0
1
X
X
X
1
0
1
0
X
0
0
X
X
MOTOROLA
1
X
0
0
X
X
X
X
X
0
0
0

Related parts for AN2372