#include <avr/interrupt.h> not found

I’m trying to directly modify the timer 2 bits on the Arduino Due with something like this:

  pinMode(3, OUTPUT);
  pinMode(11, OUTPUT);
  TCCR2A = _BV(COM2A0) | _BV(COM2B1) | _BV(WGM21) | _BV(WGM20);
  TCCR2B = _BV(WGM22) | _BV(CS20);
  OCR2A = 29;
  OCR2B = 14;

However if I compile that code I get the error message “‘TCCR2A’ was not declared in this scope’”

So I tried adding the line: #include <avr/interrupt.h>

But this results in the error “fatal error: avr/interrupt.h: No such file or directory compilation terminated.” All the other forums I’ve read said that this library does not need to be manually added but I’m not sure how to check to see if it’s there or not.

Any help would be much appreciated.


Microcontroller AT91SAM3X8E

The microcontroller on the Due does not have TCCR2A, TCCR2B, OCR2A, or OCR2B registers.

#include <avr/interrupt.h>

…is only useful with an Atmel AVR processor (hence the “avr” in the path). The processor used on a Due is an “ARM” processor; a radically different beast.

Do you know what the corresponding timers and registers are for the Due ARM processor?

And what would be the correct filename to include?

No, I don't. Someone else will have to help.