Go Down

Topic: Arduino Due sketch compiling problems (Read 1 time) previous topic - next topic

Clym5

Feb 09, 2013, 11:43 am Last Edit: Feb 09, 2013, 12:15 pm by Clym5 Reason: 1
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:

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

Krodal

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

Clym5

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

Quote
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.

Krodal

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.
http://arduino.cc/en/Main/ArduinoBoardDue

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.

Clym5

#4
Feb 09, 2013, 02:06 pm Last Edit: Feb 09, 2013, 02:09 pm by Clym5 Reason: 1
Ooh, okay. Thanks for your help Krodal.

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

Krodal

#5
Feb 09, 2013, 02:14 pm Last Edit: Feb 09, 2013, 02:50 pm by Krodal Reason: 1
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.

Clym5

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

PaulS

Quote
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!"

Nick Gammon


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


Quote
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.
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

Go Up