retepsnikrep
Senior Member
A question about Pulsin.
We know Pulsin watches a pin for a pulse and times it's length giving a value in units. Great it's a useful command.
However if we issue a pulsin command a timer must be started somewhere, as it times out after a period if no pulse received. No problem with that.
Assuming this 'timer' is a word (0-65535) what happens in the following scenario?
1) Pulsin command issued.
2) Pulsin sits waiting for a pulse (internal timer ticking away?)
3) Just before the timeout kicks in a pulse appears.
4) Does the hidden timer now restart to measure the length of the incoming pulse with a full (0-65535) available or does it start timing from wherever the hidden timer had got to by this time, say 65500 etc.
Resulting in a strange result as incoming pulse may not have finished before Pulsin reaches 65535 etc.
I imagine it must be interrupt driven and restart timer when pulse start is detected.
We know Pulsin watches a pin for a pulse and times it's length giving a value in units. Great it's a useful command.
However if we issue a pulsin command a timer must be started somewhere, as it times out after a period if no pulse received. No problem with that.
Assuming this 'timer' is a word (0-65535) what happens in the following scenario?
1) Pulsin command issued.
2) Pulsin sits waiting for a pulse (internal timer ticking away?)
3) Just before the timeout kicks in a pulse appears.
4) Does the hidden timer now restart to measure the length of the incoming pulse with a full (0-65535) available or does it start timing from wherever the hidden timer had got to by this time, say 65500 etc.
Resulting in a strange result as incoming pulse may not have finished before Pulsin reaches 65535 etc.
I imagine it must be interrupt driven and restart timer when pulse start is detected.