MPL PATI PWM measure

MPL PATI PWM measure (not recommended)


Simulink® Real-Time™ Library of Drivers No Longer Recommended for Use.

To open this library, type xpcobsoletelib in the Command Window.

Scaling Input to Output

I/O Module Input

Block Output Data Type


0–5 volts


Counts of current time base

General Description

This block measures the full cycle period or high or low time in an input waveform with the PTA module in the time processor units (TPUs). To use the TPUs, you must condition the TPU inputs with a voltage of 0–5 volts. The inputs also must have a reasonably fast rise or fall time; otherwise, false triggering can occur. The inputs use TTL level transitions. See the MPC555 documentation from Freescale™ Semiconductor at 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 selected.


To execute a model using this block, you must first write MPL boot code on the EEPROM using the MPL PATI EEPROM Write block. To flash the EEPROM with the boot code, add the EEPROM Write block to an empty model, then build and execute that model. You can then execute the actual model. See MPL PATI EEPROM Write block for further information.

Block Parameters


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 changes the order that individual timers are serviced. See the MPC555 TPU documentation for more information.


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.


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 (-1 means sample time is inherited).

PCI slot

If only one board of this type is in the target computer, enter -1 to locate the board.

If two or more boards of this type are in the target computer, 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:

tg = slrt;
getPCIInfo(tg, 'installed')

See Also

External Websites

Was this topic helpful?