AN2372 Freescale Semiconductor / Motorola, AN2372 Datasheet - Page 13

no-image

AN2372

Manufacturer Part Number
AN2372
Description
Using the Output Compare TPU Function (OC) with the MPC500Family
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Example A
The ITC function is initialized in the single shot mode with links by setting the host sequence field bits to
%10. CHANNEL_CONTROL is set to detect falling edges. START_LINK_CHANNEL is set to two, and
LINK_CHANNEL_COUNT is set to one. The BANK_ADDRESS increment is not needed, so it points to
an unimplemented location in the parameter RAM. MAX_COUNT is set to 0x10. Thus, after 0x10 falling
edges are counted, ITC generates a link to the OC function on channel 2.
Load parameter RAM as shown.
The OC function is initialized in the continuous pulse mode by setting the host service request bits to %11.
After it receives a link from channel 1, the OC function generates a continuous 50% duty cycle square wave
with a frequency equal to twice that of the PWM square wave from channel 0. The parameters are initialized
as follows:
CHANNEL_CONTROL is configured as an output channel. It is set to capture and match TCR1, to force
the initial pin level low, and to force the pin level low on a match.
RATIO is set to 0x80. This corresponds to the fraction 0x80/0xFF, or approximately 1/2. The TPU
multiplies 1/2 by the value pointed to by REF_ADDR2. In this case, REF_ADDR2 points to an address
which contains the value 0x2000. Thus, the output pulse will have a pulse width of (1/2) * 0x2000 = 0x1000.
REF_ADDR1 points to a reference value used whenever a link is received that is not the first link after
initialization. In this example, it is a don't care value since only one link is received after initialization.
REF_ADDR2 points to a value that is scaled by RATIO to form the value OFFSET whenever a link is
received. In this example, it points to an unused parameter RAM location that contains the value 0x2000.
REF_ADDR3 points to a reference value used when the first link is received after initialization. In this
example, it points to the ITC parameter FINAL_TRANS_TIME.
Load the parameter RAM location 0x3041FE with the value 0x2000. This location is chosen because
channel 15 is not used in this example.
Load parameter RAM as shown.
13
0x30410A
0x304100
0x304102
0x304104
0x304106
0x304108
0x30411A
0x304110
0x304112
0x304114
0x304116
0x304118
X
X
X
X
X
X
0
0
0
0
0
0
X
X
X
X
X
X
0
0
1
0
0
0
Freescale Semiconductor, Inc.
X
X
X
X
X
X
0
1
0
0
1
0
For More Information On This Product,
Using the Output Compare TPU Function
T a b l e 5 . P W M C h a n n e l P a r a m e t e r R A M
T a b l e 6 . I T C C h a n n e l P a r a m e t e r R A M
X
X
X
X
X
X
0
0
0
0
0
0
Go to: www.freescale.com
X
X
X
X
X
X
0
0
0
0
0
0
X
X
X
X
X
X
0
0
0
0
0
0
0
X
0
0
X
X
0
0
0
X
X
X
X
X
X
X
X
X
0
0
0
0
1
0
1
X
0
0
X
X
0
0
0
X
X
X
X
X
X
X
X
X
0
0
0
0
0
0
X
X
X
X
X
X
0
0
0
0
0
0
X
X
X
X
X
X
1
0
0
0
0
1
X
X
X
X
X
X
0
0
0
1
1
0
0
X
0
0
X
X
0
1
0
X
X
X
MOTOROLA
1
X
0
0
X
X
1
1
0
X
X
X
X
X
X
X
X
X
0
0
0
1
0
0

Related parts for AN2372