How to get around cog lock up with pulsin (BS2 Functions)
Daniel Lloyd-Wood
Posts: 14
Hello,
I'm using the PULSIN command (from Martin Hebel's BS2 Functions on obex) to read servo pulses from a receiver. It works really well except that the cog running PULSIN will lock up if there is no input signal when PULSIN is called. The receiver needs to be able to be turned on/off independently of the propeller so they're not always going to be in synch i.e there isn't always going to be a signal. I need some way to prevent/handle this lock up to make things a bit more robust. Is there any way around this?
Thanks,
Dan
I'm using the PULSIN command (from Martin Hebel's BS2 Functions on obex) to read servo pulses from a receiver. It works really well except that the cog running PULSIN will lock up if there is no input signal when PULSIN is called. The receiver needs to be able to be turned on/off independently of the propeller so they're not always going to be in synch i.e there isn't always going to be a signal. I need some way to prevent/handle this lock up to make things a bit more robust. Is there any way around this?
Thanks,
Dan
Comments
A pulse needs to be present when started but you can remove the pulse without anything hanging. If the input has no pull down, you may get erratic readings when no pulse is being sent.
Rich H
This works OK in SPIN if your timing is not too tight. If it is then use PASM to do the same thing.
Sam
·
Lawson
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Lunch cures all problems! have you had lunch?
Dan