Documentation

MPL PATI PWM measure

MPL PATI PWM measure

Library

Simulink® Real-Time™ Library for MPL

Scaling Input to Output

I/O Module 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 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.

    Note:   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 before executing the actual model. See MPL PATI EEPROM Write block for further information.

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 changes 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 (-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?