Measuring pulse width with PWMPAL
dcecar
Posts: 1
Hi All,
I would like to measure a width of an RC Servo receiver pulse with the basic stamp, but I dont want to use PULSEIN. The reason for this is I need to keep BS2 bussy with other things. Can this pulse measurement be done in the background? I do have a PWMPAL and I thought it would be easy to have this done with PWMPAL but i wasnt able to find an appnote that did this.
Many thanks
Dejan
·
I would like to measure a width of an RC Servo receiver pulse with the basic stamp, but I dont want to use PULSEIN. The reason for this is I need to keep BS2 bussy with other things. Can this pulse measurement be done in the background? I do have a PWMPAL and I thought it would be easy to have this done with PWMPAL but i wasnt able to find an appnote that did this.
Many thanks
Dejan
·
Comments
In your case, because the receiver pulse can occur at any time, the Stamp is tied waiting to measure it. Only the PULSIN statement can do the job because the Stamp is not fast enough to accurately measure the pulse width using its Basic. The only workable Stamp solution is to move the measurement task to a co-processor or to other external hardware. Other microcontrollers like the SX and the Propeller can do this kind of thing easily by using interrupts (the SX) or by having multiple processors (the Propeller).