Why? PWM/PPM 6 Channel RC Receiver

Greetings,

I have seen a LOT of solutions using interrupts that quite frankly confuse me, because I have an Arduino Mega and don't always see them as being interchangeable, so let me try asking something a little different...

In my case I have an RC Receiver that is outputting PWM, which others have said is really PPM, but it is 6 discrete outputs, not a single multiplexed signal.

If I wrote a program to set a pin as an Input and use PulseIn to read it, why isn't that a good solution? More importantly, how do I figure out which pins on the Arduino are being used for other things and cannot be used as an input, when the pinout maps say they should be able to be used as such?

I have 6 inputs I am trying to use which are digital inputs on pins 24 through 29. The entire bank of pins on the end of the Arduino Mega are pins 22 through 53, and they all say they are digital inputs.

However, no matter which 6 of these pins I use, I can only get a signal value on 3 of them. Can anybody explain in a somewhat simple way why this is? In my current test case, I can get input on 24, 26, & 28, but not 25, 27, & 29. No matter where I put the inputs, only half work. I even tried another receiver, so I don't believe that is where the problem is. This is really confusing to me - thanks in advance for any answers!

My most recent code is enclosed. I have a Robogalia accelerometer/gyro shield plugged into the Mega, but none of that code is active.

Thanks

DoCubeInputOnly.txt (2.34 KB)

All Mega R3 pins can be used as inputs.
Not all pins of the Atmega2560 are brought out to header pins.
If you want access to all pins, you need a board like this one I just started offering:

I am a complete novice and I am trying to control a mega with a four channel radio control. I have tried to use interrupts but have got completely baffled!
If you have success I would be very grateful to have a copy of your code I do not think I will be capable of producing my own.
I have built a robotic mower for mowing steep banks and hope eventually to guide it by GPS, but initially I will use radio control to develop the mechanics.

Thanks

I found the problem - it was not with the pins. I was not waiting long enough on the input read - I had it set to 20000 microseconds from a different project and when I cut/pasted I did not change the value. I also changed it to read only one of the inputs per loop ; either way is fine.

I too found the interrupt driven reading confusing, and although I understand the concept and why it is better, I did not have the time to pour over the code and figure it out - in most cases the code is so old that it does not work without some sort of modification because some library or another has changed.

At any rate, here is the modified code to read 6 inputs and it works. The more you do in your main loop though, the worse it will be and you will need to use interrupt driven inputs.

DoCubeInputOnly.txt (2.7 KB)