APM 2.6 INTERRUPTS HELP!!

how can i use apm 2.6 interrupts? every code i try doesnt work!

If anyone has some information that could help me that would be great!

What are apm 2.6 interrupts?

What code have you tried ?

If you help us we may be able to help you.

...R

APM 2.6 using Atmel's ATMEGA2560(like arduino mega) and ATMEGA32U-2 chips for processing and usb functions respectively.

arduino mega interrupts pins:

Board int.0 int.1 int.2 int.3 int.4 int.5 Mega2560 2 3 21 20 19 18

the problem is that the interrupt pins not directly connected to the ATMEGA2560, They pass through the ATMEGA32U-2 that Responsible for the operation of USB and the INTERRUPTS PINS.|500x297

This is the reason that the code does not work. please help!

srrs4: APM 2.6 using Atmel's ...

I would love to help if I could. But you still have not explained what APM 2.6 is If it is a piece of hardware post a link to its datasheet.

This is the reason that the code does not work.

What code?

Post the code so we can see what you are talking about.

...R

WHAT APM IS - ArduPilot (also ArduPilotMega - APM) is an open source unmanned aerial vehicle (UAV) platform, able to control autonomous multicopters, fixed-wing aircraft, traditional helicopters and ground rovers.

DATASHEET LINK-http://i.imgur.com/hZ5XlJS.png

I am in the process of building a quadcopter, everything went well, all the sensors worked, the engines and radio. After a while I noticed that I do not find PID tuning, so I began to investigate, I saw that the minimum controller speed for reading the information from the sensors, radio, PID and send the engines, is 50 Hz, but my speed is 14 Hz. After some tests, I saw that the main cause slowness is reading the information from the receiver. When the controller did not try to read the information from the receiver I reached a speed of 200 Hz. The function I used for reading the information from the receiver is PulseIn and is too slow. After some more investigation I realized I needed to use INTERRUPTS PINS. And the board has a special controller for that (according to the DATASHEET).

The solution to this is to use onboard controller ATMEGA32U2 that connected to INTERRUPT PINS. From what I gathered the controller would process the information from the receiver to the background and send it to the ATMEGA2560.

And even the most simple code does not work for me.

int pin = 27;//apm 2.6 indicator led
volatile int state = LOW;

void setup()
{
  pinMode(pin, OUTPUT);
  attachInterrupt(0, blink, CHANGE);
}

void loop()
{
  digitalWrite(pin, state);
}

void blink()
{
  state = !state;
}

How do I get the information from the ATMEGA32U-2? how it connects to the ATMEGA2560?

srrs4:
WHAT APM IS - ArduPilot (also ArduPilotMega - APM) is an open source unmanned aerial vehicle (UAV) platform,

Thank you.

I wish you had put “ArduPilot” in your title, because I’m afraid I don’t know anything about it.

If you modify your original Post you can change the title and you may get the attention of someone who can help.

…R

OK THANKS