Pages: [1]   Go Down
Author Topic: Arduino Due sketch compiling problems  (Read 1054 times)
0 Members and 1 Guest are viewing this topic.
New Zealand
Offline Offline
Newbie
*
Karma: 1
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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!
« Last Edit: February 09, 2013, 06:15:58 am by Clym5 » Logged

Offline Offline
Edison Member
*
Karma: 9
Posts: 1016
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

New Zealand
Offline Offline
Newbie
*
Karma: 1
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Edison Member
*
Karma: 9
Posts: 1016
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

New Zealand
Offline Offline
Newbie
*
Karma: 1
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ooh, okay. Thanks for your help Krodal.

Is there any way to get more program memory on an Arduino UNO? 256K+ instead of 32K?
« Last Edit: February 09, 2013, 08:09:14 am by Clym5 » Logged

Offline Offline
Edison Member
*
Karma: 9
Posts: 1016
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: February 09, 2013, 08:50:28 am by Krodal » Logged

New Zealand
Offline Offline
Newbie
*
Karma: 1
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1]   Go Up
Jump to: