TPU3 Rectangular Wave

Configure Time Processor Unit (TPU3) channel for Rectangular Wave Output (RECTW)

Library

Target Support Package FM5/ MPC555 Driver Library/ Time Processor Unit (TPU3)

Description

This block is provided as an example along with the demo model mpc555rt_tpu_emu. The rectangular wave function is not part of the standard ROM mask of TPU functions but can be downloaded to DPTRAM and used by the TPU in emulation mode.

The TPU3 Rectangular Wave block outputs a rectangular wave with a specified high time and specified wave period. Pulses always begin with a rising edge, and TCR1 is used as the timebase. You can either control the high-time and waveform period registers directly, or enter the desired (ideal) periods and the mask will solve for the best values for the period registers.

If you select the option Use input port to vary HIGH_TIME_RECTW and PERIOD_RECTW, two inputs appear. You can use these to vary the high-time and waveform period. The rest of the parameters in the mask are used as initial values. Input 1 (top) is the high time and input 2 is the period. Inputs must be 16 bit values in the range 0 <= x <= 32768 (0x8000).

The TPU Rectangular Wave block uses TCR1 as a timebase for creating the output waveform. By changing the speed of the TCR1 clock, the range of available waveform periods changes. See Time Processor Unit (TPU3) Configuration Parameters for more information on settings for the TCR1 clock.

Refer to Section 17, "Time Processor Unit 3," in the MPC555 User's Manual for further information.

Dialog Box

On the Channel Setup tab:

TPU Module

Select TPU module A, B or C; each has 16 channels. Note that the MPC555 only has modules A and B. MPC565 and MPC566 also have module C. An error will be thrown if you select C and your target processor does not support this.

TPU channel number

Choose 0-15

Channel priority

Choose Low, Medium, or High

The host CPU makes a channel active by assigning it one of the three priorities. You choose the order in which channels are serviced by setting the channel number and assigned priority. The order in which channels are serviced is determined by assigned priority first, followed by channel number (lowest number first).

Sample time

The default is -1. This setting specifies that the block inherits its sample time from the block connected to its input (inheritance) (unless it is in a triggered subsystem). It makes no sense to sample faster than your input is changing, so normally you leave this at the default.

On the Waveform Setup tab:

Edit period registers manually

If you select this check box, you can manually set the High-time register and Waveform period register parameters.

Ideal high-time (H)

You can enter an ideal high-time period (in seconds). From this the high-time register is calculated and appears in the High-time register (HIGH_TIME_RECTW) edit box. The actual waveform period is also calculated and displayed, see below.

Waveform ideal period (T)

Enter the waveform period you want by typing in this edit box. From this the waveform period register is calculated and appears in the Waveform period register (PERIOD_RECTW) edit box. The actual waveform period is also calculated and displayed, see below.

High-time register (HIGH_TIME_RECTW)

You can enter a value for the high-time register here ( 0<= x <= 32768 (0x8000)) only if you select Edit period registers manually. The actual high-time period is calculated and displayed in the actual high-time period field.

Waveform period register (PERIOD_RECTW)

You can enter a value for the period register here ( 0<= x <= 32768 (0x8000)) only if you select Edit period registers manually. The actual waveform period is calculated and displayed in the actual period field.

Actual high-time

Information field. You might find this information useful because actual and ideal high-time period are not always the same — the ideal period you enter may not always be possible.

Waveform actual period

Information field. You might find this information useful because actual and ideal waveform period are not always the same — the ideal period you enter may not always be possible.

Use input port to vary HIGH_TIME_RECTW and PERIOD_RECTW

Select this box to use input ports to control the high-time and waveform period registers. Two input ports appear on the block (the top input is high-time).

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS