In the IDE when I select which board I'm using, every other board compiles without any issues. When I select the Arduino Due (Programming Port) for my board selection, I now get a compiling error "fatal error: avr/io.h: No such file or directory compilation terminated." Is this a bug? Why would changing the board type have any influence on including certain libraries?

This is urgent so any immediate help or advice would be greatly appreciated.

In the IDE when I select which board I'm using, every other board compiles without any issues. When I select the Arduino Due (Programming Port) for my board selection, I now get a compiling error "fatal error: avr/io.h: No such file or directory compilation terminated." Is this a bug? Why would changing the board type have any influence on including certain libraries?

This is urgent so any immediate help or advice would be greatly appreciated.

Same problem.I wish to use an ISR(TIMER2_OVF_vect) perfectly running with Arduino Uno, but when I try to compile with Arduino Due all the variables such as TCCR2A,CS22, TCCR2B etc generate the error ""was not declared in this scope".

Where can I find the equivalent Interrupts Service Routine for the Arduino Due ? orWhich library have I to include for the scope ?

The fact that the same names of the registers as in the UNO don't work is not at all a bug, because there is a totally different structure behind the SAM3X8E chip for the DUE with many Timer Counter channels having different functionalities.

Thanks a lot !I am a beginner, then I have to study how to use the new counters, registers and timers.It will be a great help if you can explain the equivalence between the Arduino Uno variables and the one to use in Arduino Due.These are the "not declared variables" that I would use in Arduino Due (with equivalents):

TCCR2ATCCR2BCS20CS21CS22TIMSK2TOIE2TCNT2

The sketch is from Michael Blank and it is intended to command a Rail Model Train in DCC (Digital Control).This is the part of the sketch that generates the errors://--------------------------------------------------------------------------------------------------------------------------------//Setup Timer2.//Configures the 8-Bit Timer2 to generate an interrupt at the specified frequency.//Returns the time load value which must be loaded into TCNT2 inside your ISR routine.void SetupTimer2(){

//load the timer for its first cycle TCNT2=0x8D; // 58usec pulse length

}

//Timer2 overflow interrupt vector handlerISR(TIMER2_OVF_vect) { //Capture the current timer value TCTN2. This is how much error we have //due to interrupt latency and the work in this function //Reload the timer and correct for latency.

Things like TCCRx are called registers. Those expressions are pointers to the registers in an AVR core. Not the SAM3X8E core. The SAM3X8E has registers, just with different names and different locations. Its as if I was giving you driving directions. You may be asking me how to get to the local drug store, so I say drive straight and take the third right. Then, when you go to a different town, you follow the same directions but end up at a different store. This town has its own directions, just like the SAM3X8E has its own registers at different locations. Consult the SAM3X8E for register names. I advise looking at the Due libraries included with the IDE, since they include some nice functions for setting up things like timers.