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.
It may very well be possible something changed in 4 years. APM2.x is not supported anymore, so the Ardupilot team most likely removed the no longer needed files. A quick search for “ArduPPM” or “PPM_Encoder.h” brought up this: