I've been struggling for a few days and haven't managed to turn up a lot on the internet. I'm looking to READ from the PWM output of an RC receiver through one of the GPIO's on the RPi. I've read other questions where it's not suitable for "serious" PWM but I'm not looking to use it as an output. Looking at the WiringPi library, I've found functions that allow me to write out PWM, but I'm having a hard time getting anything off the GPIOs, even with generic reads. It feels like I should be able to do something like this tutorial here, but I've not had any luck. Am I just trying to do something that's beyond what any libraries have provided at this point or is there something stupid simple I'm missing before I have to dig down into writing assembly code to interface with the thing?
Obtaining hard real-time capabilities in Linux, down to sub-millisecond resolution, is possible. To do that, a patch or a set of patches must be applied to the kernel sources. To cite a few, one can use Ingo Molnar's RT-Preempt Patch, Xenomai, RTAI or ADEOS. You can find more information here, here and here.
It's not possible. In order to do this, you need accurate timing, which isn't possible on Linux.
Your best bet is to work out how to do this on a separate micro and communicate with the Raspberry Pi over SPI or I2C. There may even be an existing IC for this.
You can follow this tutuorial: https://www.sparkfun.com/tutorials/348 and than the only thing todo is write this data via usb to your raspberry pi. Happy coding :)
My understanding of reading PWM signals for non-realtime systems has been to treat them as analog voltages (that's right, run it through an RC circuit and then read the voltage using an analog-digital converter/ADC).
More engineering work, sure, but cheaper than bolting on an Arduino to do the realtime chore of reading PWM pulses with a pin change interrupt: http://www.benripley.com/diy/arduino/three-ways-to-read-a-pwm-signal-with-arduino/