Arduino Due sketch compiling problems

Hey there,

I recently bought an Arduino Due for a project that needs copious amounts of RAM and flash memory and when I went to compile the sketch for it and the IDE instantly returned an error saying:

fatal error: avr/io.h: No such file or directory
compilation terminated.

It also does this for avr/pgmspace.h too, and when I upload the trimmed-down version of the code onto my UNO, I get no error. I'm using version 1.5.2 of the IDE.

I've only had my UNO for a few weeks, and my Due for a day, so I'm pretty new to all this, and if the problem is super-obvious, you'll know why I couldn't figure it out.

Thanks for reading and thanks even more if you can help!

I think you don't have to include those files at all.
Or do you use specific avr gcc functions ?

The sketch doesn't work without them, on an UNO that is. Is it different on a Due?

Or do you use specific avr gcc functions ?

I've go no clue what that means. That's how new I am to all this.

The code I'm trying to get to work is the PCMAudio Library, to play sounds from flash memory.

I think that library will not work with the Arduino Due.
http://playground.arduino.cc/Code/PCMAudio
If you want to use the PCMaudio, use an Arduino Uno.
The code is made compatible with the Arduino Mega, but the Arduino Due is something else.

The PCMAudio library uses code like this: "TCCR2A |= _BV(WGM21) | _BV(WGM20);". That is directly writing the registers of the avr chips ("avr" are the microcontroller family made by Atmel used in most Arduino boards). But the Arduino Due uses a ARM microcontroller with other registers.

Ooh, okay. Thanks for your help Krodal.

Is there any way to get more program memory on an Arduino UNO? 256K+ instead of 32K?

Yes, the Arduino Mega 2560 is still the same "avr" family.
http://arduino.cc/en/Main/arduinoBoardMega2560

You could add a SD card shield, if you need to store and retrieve lots of data.
Or an ethernet shield with SD card socket included.

Awesome, thanks. I might start a new thread later, I need some help with generating tones of varying pitch and waveform.

I might start a new thread later

If you do, and it is in this section, don't forget to read the sticky at the top first, where it says "POST YOUR CODE!"

Clym5:
I recently bought an Arduino Due for a project that needs copious amounts of RAM and flash memory and when I went to compile the sketch for it and the IDE instantly returned an error saying:

Pity you didn't post the sketch, eh?

Read this before posting a programming question

Is there any way to get more program memory on an Arduino UNO? 256K+ instead of 32K?

No. The Uno has an Atmega328P processor in it, and the "32" in its name says it has 32 Kb of program memory.