output pulses
LW
Posts: 8
I have a basic stamp 2 I wish to make it generate a pulse out on one pin I need it to be around 360 hz the complicated bit is I need it to not generate every 36 pulse. So 35 pulses then a missed pulse. Any ideas welcome. Lynton
Comments
Its always easier to get help if you show folks what you've attempted yourself.
Cheers,
Mike , would this accomplish the same given / assuming the 1 ms on / 2 ms off setup is OK for 35 pulses and than wait 3 ms
PAUSE 3
for the 36th pulse ?
Vaclav
I believe this will do what you want:
It creates the pulses by sending a stream of characters with SEROUT using inverted mode.You can adjust the width of the pulses by changing the $f0 to, say, $f8 for narrower pulses, or $e0 for wider ones. Because, as Mike points out, PAUSE is so coarse, the inter-burst gap has to be filled with something more precise. This entails using an extra pin for a PULSOUT which, on the BS2 has a resolution of 2 us.
It's always hard to predict exactly how much delay the PBASIC interpreter's overhead will add to the timing. This is one case where having a good scope helps, since you can twiddle the constants until everything comes out just right. Here's a trace from my scope, showing the OUTPIN output on channel one and the DUMMY output on channel two:
-Phil