What is the purpose of the PPM encoder in APM2? Why didn't we use directly the PWM signal produced by the receiver and enter it to the microcontroller ATMEGA2560?
Working with the PPM signal is better than the PWM? if so why didn't we take the signal directly from the frequency demodulator in the receiver which it is a PPM signal and let ATMEGA2560 work as PPM decoder so the response will be faster?
yes the 328 chip get hot. RC inputs are not detected by mission planner or in the CLI test. Although when i connect servos to the channels of rc receiver they move on the rc tx inputs.
Try disconnecting all RC inputs and see if it still gets hot. If so then it has been damaged and needs to be replaced.
As we know the rc reciever has a built in ppm signal why we didn't take it directly to atmega2560 without using another ppm encoder?
Many RC receivers does not have a output pin for the internal PPM signal, and most 2.4ghz systems does not even have a internal PPM signal any longer.
I am developing my own quadcopter, so I first started by buying an Arduino Uno + MPU9250 (IMU and mag) + GPS. I tested it and it went well. Since I my goal is to work with code and not hardware, I bought an APM 2.8 board so I would have everything already connected and working, and then focus only on programming it with Arduino IDE.
I've managed to communicate the AT2560 with all sensors without much problems.
I have a HITEC Minima 6S receiver which gives outputs as PWM signal. No problem there. As you know each PWM channel must be connected on the APM inputs, which are then routed to the AT32U2, which encodes the PWM signals in one PPM signal.
That PPM signal is routed to PIN PL1/ICP5 (Arduino PIN 48) as you can see on the APM schematics attached (don't mind the blue rectangles there). I have already read this PPM signal using pulseIn() function on Arduino IDE. But as you may know pulseIn() takes up to 20ms to get all PPM channels (to long for a quadcopter). So the correct way of reading the signal should be with interrupts. But this is not an interrupt pin...
Finally my question. How does Arducopter read the PPM signal on that pin without losing 20ms? Is that PPM signal also routed to a different pin with interruptions? I have tried reading Arducopter code but I can't seems to understand it very well.
I have also tried routing my receiver PWM signals to A0-A15 but I think those pins are not intented for that use. In fact, I was only able to read a PWM signal on pin A8.
Hope I was clear enough. Any help is welcome.
ICP5 is Input Capture Pin 5. Meaning it has an input capture interrupt that is tied to hardware Timer 5. So every time you have a signal change on the ICP5 pin (rising or falling edge depending on setup), you get a interrupt call that already contains the exact timer 5 value for when the pin change happened. This makes for a very efficient and accurate way of reading PPM/PWM signals, and is exactly what the ICP inputs where designed to do.
Se page 140 (17.6 Input Capture Unit) in the ATmega 2560 manual for details.
This is the answer is was looking for.