AN2372 Freescale Semiconductor / Motorola, AN2372 Datasheet - Page 12

no-image

AN2372

Manufacturer Part Number
AN2372
Description
Using the Output Compare TPU Function (OC) with the MPC500Family
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Changing Mode
7.2
The host sequence bits are used to select OC function operating mode. Change host sequence bit values only
when the function is stopped or disabled (channel priority bits = %00). Disabling the channel before
changing mode avoids conditions that cause indeterminate operation.
8
The following examples give an indication of the capabilities of the OC function. Each example includes a
description of the example, a diagram of the initial parameter RAM content, initial control bit settings, and
a diagram of the output waveform.
8.1
8.1.1
This example uses the OC function in the continuous mode to output a continuous square wave after a
certain number of input pulses have been counted. A pulse-width modulated square wave is initialized on
channel 0. Channel 0 is physically connected to channel 1, which is initialized with the input transition
counter (ITC) function. The ITC function is initialized for single-shot operation with links. This means that
it counts a certain number of pulses from channel 0, then generates a link and ceases channel activity.
Channel 2 is set up to run the OC function. Channel 2 receives the link from channel 1 and then generates
a continuous 50% duty cycle square wave with an output frequency that is twice the input frequency.
8.1.2
The PWM channel is set up to generate a 50% duty cycle square wave. It has a pulse hightime of 0x2000
TCR clock counts and a pulse period of 0x4000 TCR clock counts.
Load parameter RAM as shown.
12
S1 Init
S2 Offset_Cal (first link after Init)
S3 Offset_Compare
S4 Host Compare
S5 Ref_Time_Compare
0 < OFFSET = 0x7FFF
0x7FFF < OFFSET = 0
HSB = 0X
HSB = 1X
Changing Mode
Examples
Example A
State Number and Name
8.1.1 Description
Initialization
Freescale Semiconductor, Inc.
For More Information On This Product,
Using the Output Compare TPU Function
Go to: www.freescale.com
Table 4. OC State Timing
Max CPU Clock Cycles
40
10
14
18
10
6
4
RAM Accesses by TPU
2
7
4
4
5
2
2
MOTOROLA

Related parts for AN2372