Reading PWM on BBB?

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Billwaa
 
Posts: 10
Joined: Wed Apr 16, 2014 11:10 pm

Reading PWM on BBB?

Post by Billwaa »

Hi,

I am developing a flight controller for my quadcopter with the BBB in Python.
Just wondering, if there is a way to take in PWM signal from the RC receiver directly on the BBB.
Right now, I have it hooked up to an Arduino Micro and relay the info over by Uart.
But that got somewhat of a delay over and add extra weight. Perhaps I2C will be faster?

Thanks!

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Reading PWM on BBB?

Post by adafruit_support_mike »

You'll probably need some kind of external hardware.

The RasPi and BBB are Linux computers, and Linux is a time-slicing operating system. Each process gets a certain amount of time on the CPU (usually 10ms), then the OS interrupts it, stores all its data to memory, loads in the data for another process, and lets that one execute for 10ms.

That strategy works for batch processing applications that don't have any reason to care if there's been a gap between one step and another, and for human-speed applications like word processors where the code swaps in and out a few times between keystrokes.

For hardware IO, it's not so good. Most external hardware designed to work with a time-slicing OS does exactly what you're doing: it uses another processor to handle the real-time signals, then stores everything in a buffer that can be passed to the relevant process during its next time slice.

If you need to save grams, you might want to look at the Teensy (it really is: https://www.adafruit.com/products/199) or programming a bare microcontroller.

Locked
Please be positive and constructive with your questions and comments.

Return to “Beagle Bone & Adafruit Beagle Bone products”