Go Down

Topic: PinChangeInt within a custom library (Read 935 times) previous topic - next topic

DuaneB

#5
Aug 04, 2012, 04:38 pm Last Edit: Aug 04, 2012, 08:07 pm by DuaneB Reason: 1
Hi,
   Do you have some diodes and breadboard to prototype a very simple 'channel multiplexer' ?

   To make a small and fast library I wanted to read all channels through a single pin, as my receivers do not provide a raw output, I wanted to do this by routing all of the channels through diodes to INT0. The diodes are there to stop all of the channels that are low from sinking the channel which is high. This worked for Spectrum receivers, but not for Futaba.

The Spectrum receivers have a small gap between one channel pulse ending and the next starting, with Futaba, the change over is too fast for the Arduino to detect on a single pin.

The solution is very simple, route consecutive pulses to alternating pins, as a result I have a small and fast library that is able to read six RC Channels using just two pins. It also generates upto six output channels, in the next version I will provide upto 9 output channels.

Let me know if you are willing and ready to get your hands dirty and I will provide a link with more details.

Duane B

rcarduino.blogspot.com




fuzzball27

I'll need to buy more diodes (As of now I have 2 haha). I'm using a 4ch Tx with a 6ch Rx, but I'm assuming you're using interrupts for timing so that shouldn't cause any problems right?
fuzzball27 >>-->

DuaneB

Should be fine, do you have some high value resistors as well I am using two 1M resistors but you can probably use anything down to about 10K ?

I put up a short intro to the RCArduino multiplexer here - its crazy simple, just a diode for each channel and a large value resistor to dissipate the charge that gets trapped between the diodes and the input pin if it has nowhere to go, the resistor give it somewhere to go without upsetting anything else.

I need to update the picture to include the resistor, but the circuit is basically as simple as it gets -

http://rcarduino.blogspot.com/2012/08/multiplexing-rc-channels-with-arduino.html

I moved the first test system onto a strip board Arduino which is going in a car tomorrow - its running on the bench next to me at the moment - I don't want to say anything more about it or it will curse my road testing tomorrow.

What make and model are your transmitter and receiver so that I can include the channel order in the library documentation ?

Duane.

rcarduino.blogspot.com

fuzzball27

fuzzball27 >>-->

DuaneB

Hi,

That looks fine, really cheap too.

Let me know when you have your diodes and I will post a diagram for the multiplexer. Its best if you build the circuit on breadboard first to check the that the channel pulse order is the same as the order they are printed on the receiver.

Duane B

Go Up