Question about pulsin...

vttom

Senior Member
Suppose somewhere in my program I have the command:

pulsin 3, 0, w0

which means time the width of a low-going pulse at pin 3 and store the results in word variable w0.


What would happen if pin 3 is already low at the time this command is executed? Will it begin timing immediately, or will it wait for the signal to go back to 1 and back to 0 before starting?
 

MartinM57

Moderator
The latter (see Manual 2 where it seems quite clear) - and if it doesn't do it within the timeout period (see manual 2) then you will get 0 returned
 

hippy

Ex-Staff (retired)
As MartinM57 says. The PULSIN measures a pulse so it needs two transitions; one to the level specified to start measuring and another transition the opposite way to stop. No start transition and it will timout with zero, stop transition too long to arrive and it will also timeout with zero.
 
Top