Hi,
Here's a simple bit of code which I'm having trouble with...
PROBLEM 1
I am trying to read in the pulse from a radio control receiver, modify it, and then output it again to a servo. The trouble is that I get a rather unstable reading from the PULSIN command. It seems to vary by +/- 10 microseconds (despite getting a very clean and stable pulse from the receiver) and if I add in more code it seems to get worse.
Do I need a faster PICAXE chip? (I am running the PICAXE-18X with the internal resonator).
PROBLEM 2
Another slightly frustrating problem is that the pulse width is not being read accurately anyway. When the receiver channel is centred (and putting out a 150 microsecond pulse) I'm getting readings of about 163. I know I can fix it by adding...
...but I don't want to slow down the microprocessor.
Any guidance much appreciated.
Here's a simple bit of code which I'm having trouble with...
Code:
main:
pulsin 0,1,w1
servo 0,w1
goto main
I am trying to read in the pulse from a radio control receiver, modify it, and then output it again to a servo. The trouble is that I get a rather unstable reading from the PULSIN command. It seems to vary by +/- 10 microseconds (despite getting a very clean and stable pulse from the receiver) and if I add in more code it seems to get worse.
Do I need a faster PICAXE chip? (I am running the PICAXE-18X with the internal resonator).
PROBLEM 2
Another slightly frustrating problem is that the pulse width is not being read accurately anyway. When the receiver channel is centred (and putting out a 150 microsecond pulse) I'm getting readings of about 163. I know I can fix it by adding...
Code:
w1 = w1 - 13
Any guidance much appreciated.