Go Down

Topic: Library for receiving the RC radio PPM signal (Read 271 times) previous topic - next topic



I wrote a library, wich can receive a PPM signal, and can handle the channels as You want. Recently I created the following functions:
- do nothing ( just receive the value )  :-)
- build a PWM signal from it for servos
- switch an output on and off depending on the channel value
- select two outputs depending on the channel value

The library does NOT use timer interrupt, only an external interrupt for PPM signal receiving.

Feel free to try it, comments are welcome!

p.s.: this is my first development in arduino ;-)



I have happily used my library in testing phase. After that I built a sketch wich using an another interrupt driven library too, and found a little time "glitching" in the PPM-PWM conversion.
I think this is when the another interrupt blocking the input interrupt. Is there a solution for setting priority between interrupts? Wich interrupt is prior, the input or the timer one?



Its probably the timer0 interrupt. Could test for this by temporarily disabling it.

I think interrupt priority is set in stone.

Have you considered using input capture instead?


Timer0 is always running, if it would be the case, the test also would done "glitching".
I'm sure, this is because of the additional library, wich is using Timer2 for it's functionality.

I would be happy if I would set input Interrupt as a priority for Timer2.

If it is not possible, the proper setting is impossible if other interrupt is used. The PPM signal is 2 ms wide, with resolution of 255.


Jul 27, 2016, 09:23 pm Last Edit: Jul 27, 2016, 09:23 pm by dlloyd
What I was suggesting is that you could try a test with timer0 interrupt turned off and see if the timing glitch goes away.
Code: [Select]
TIMSK0 = 0;  // for testing with timer0 disabled
I would think that using the input capture interrupt with pin 8 could provide an accurate solution that's immune to other interrupts.


I put the other library's interrupt routine's first line a sei() command, the result is much better, almost perfect!

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131