Skip to Main Content Skip to Search
Product Documentation

MPL PATI PWM measure - MPL PATI PWM measure

Library

xPC Target Library for MPL

Scaling Input to Output

Hardware Input

Block Output Data Type

Scaling

0 to 5 volts

Double

Counts of current time base

General Description

This block uses the PTA module in the time processor units (TPUs) on the board to measure full cycle period or high or low time in an input waveform. To use the TPUs, you must condition the TPU inputs with a voltage between 0 and 5 volts. The inputs also must have a reasonably fast rise or fall time; otherwise, false triggering might occur. The inputs use TTL level transitions. See the MPC555 documentation from Freescale Semiconductor at (http://www.freescale.com) for more information on the PTA module. This block outputs the number of counts of the input time base (default 20 MHz, configurable in the MPL PATI Timebase Setup block) that meet the mode chosen.

Block Parameters

Channel

From the list, select a channel from 1 to 32. This board has two TPUs. Channels 1 through 16 are on the first TPU, channels 17 through 32 are on the second TPU. The channel you select works with the time base parameter.

Channel priority

From the list, select Low, Medium, or High priority. This has a small effect on the order that individual timers are serviced. See the MPC555 TPU documentation for more information.

Mode

From the list, select

  • Total High Time — For measuring pulse widths

  • Total Low Time — For measuring pulse widths

  • Between Rising Edges — For period measurements

  • Between Falling Edges — For period measurements

Number of periods to count

Enter the number of periods to count. To measure every cycle separately, enter a value of 1 (default). To get higher precision by averaging, enter a higher value, then divide the block output by this value. For example, to gain a period with a precision of 0.1 count, enter a value of 10 for this count, then divide the block output by 10.

Timebase

From the list, select TCR1 or TCR2. This depends on the MPL PATI Timebase Setup settings. If you do not use the MPL PATI Timebase Setup block, the TCR1 time base defaults to 1.25 MHz.

Sample time

Enter the base sample time or a multiple of the base sample time.

PCI slot

If only one board of this type is in the target PC, enter

-1 

to automatically locate the board.

If two or more boards of this type are in the target PC, enter the bus number and the PCI slot number of the board associated with this driver block. Use the format [BusNumber, SlotNumber]. To determine the bus number and the PCI slot number, type

getxpcpci

See Also

MPL PATI Timebase Setup

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

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