Go Down

Topic: #include <avr/interrupt.h> not found (Read 4289 times) previous topic - next topic

elevine

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

Code: [Select]
  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:
Code: [Select]
#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.

Coding Badly


http://arduino.cc/en/Main/arduinoBoardDue

Quote
Microcontroller    AT91SAM3X8E


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

Code: [Select]
#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.

elevine

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

And what would be the correct filename to include?

Coding Badly


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

Go Up