Hi
Can the pic receive pwm from a source that normally drives a servo, like an RC Gyro? Is there a way that, something like this, can be done?
Thanks
servo pwm input
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Hello
Yes the PIC can receive the PWM signal as long as its frequency is not too high. The easiest way to monitor it would be to start the tmr0 running
Then wait until the pulse goes high.
Once it goes high you would collect the value in the tmr0 register
Then restart the timer
and monitor how long the pulse was low using the same method.
Yes the PIC can receive the PWM signal as long as its frequency is not too high. The easiest way to monitor it would be to start the tmr0 running
Code: Select all
tmr0 = 0;
Code: Select all
while (porta & 0x01 == 1);
Code: Select all
FCV_MYVAR = tmr0;
Code: Select all
tmr0 = 0;
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel