PMON ch
PMOFF ch
Purpose

PMON enables Pulse Measurement Function at channel #ch, whereas PMOFF disables the channel. After enabling the channel, you may then use the functions PULSEWIDTH(ch) and PULSEPERIOD(ch) to obtain the width and period of the input pulses arriving at the pulse measurement input pin. You must call PMON once during initialization to enable the pulse measurement hardware. Otherwise the two functions will only return 0. You should avoid repeatedly executing PMON function, otherwise the pulse measurement hardware will be reset repeatedly as well, and accurate measurement cannot be obtained.

If you no longer need to measure the pulse-width or period for a particular channel which has been PMON before, you should disable it using PMOFF to save CPU time because pulse measurement is interrupt driven and consumes CPU time.

Examples PMON 1 : PMOFF 5
See Also PULSEWIDTH( ), PUSEPERIOD( )

backbutton.gif (507 bytes)  Basic to TBASIC Reference Manual