PDA

View Full Version : Quick Arduino Question...



Azinman
04-06-2009, 11:04 PM
Hey quick question for all the Arduino / Freeduino / Boarduino users; is the Arduino Software compiler the only C based compiler that the Arduino / Freeduino / Boarduino boards can be programmed with? Thanks :D

lnxfergy
04-06-2009, 11:07 PM
Hey quick question for all the Arduino / Freeduino / Boarduino users; is the Arduino Software compiler the only C based compiler that the Arduino / Freeduino / Boarduino boards can be programmed with? Thanks :D

The arduino software is really just some extra libraries and makefiles for AVR-GCC (plus a GUI/IDE). You could use AVR-GCC outside of the Arduino environment, or even use Arduino makefiles directly without using the java GUI they provide.

As far as I know, AVR-GCC is the only free C compiler for AVR. Codevision is the major non-free one I know of, but the Arduino libraries wouldn't run on it...

I guess I'm not entirely sure what your question is, or what answer you were looking for....

-Fergs

Azinman
04-06-2009, 11:09 PM
Thanks for the reply! I was wondering in particular if the Freeduino Board could be programmed using the Code::Blocks C/C++ compiler. Heres a couple links if you need to check it out:
http://www.codeblocks.org/downloads/5 (http://www.codeblocks.org/downloads/5)
http://www.cprogramming.com/code_blocks/ (http://www.cprogramming.com/code_blocks/)
:)

Azinman
04-06-2009, 11:13 PM
Code::Blocks is a free compiler i found on www.cprogramming.com (http://www.cprogramming.com) that compiles C and C++ programs and has an AVR Project option that also asks you to select the processor to run it with. Another link is www.codeblocks.org (http://www.codeblocks.org) I am not sure if it will program the Freeduino though so I wanted to know before buying one.

jes1510
04-06-2009, 11:17 PM
If it will compile for an Atmega168 (or any of the any other Aduino chips) then it should work. You won't be able to use the Normal method of downloading code to the Arduino so you will need a programmer and AVRDude.

lnxfergy
04-06-2009, 11:26 PM
After a quick look, it appears to be using GCC, so it's probably also built on AVR-GCC... as jes said, if you can compile for ATMEGA168 (or some newer boards have the MEGA328), you're set.

Jes, correct me if I'm wrong, but doesn't arduino just have a stk500 emulation bootloader, and don't they just use AVRDUDE? I think you could probably just download the code using AVRDUDE by itself, no hardware programmer required.

-Fergs

Azinman
04-06-2009, 11:28 PM
Thanks, so the closest thing to AVRdude I found on a quick online search is WinAVR which seems to be a derivative of AVRDude. If you know of anything better please tell me :) By "programmer" you mean a compiler of sorts like Code::Blocks/AVR-GCC/CodeVision or am I understanding you wrong?

lnxfergy
04-06-2009, 11:31 PM
Although I guess I just have to say, why? The arduino environment isn't the greatest thing out there... but it is made specifically for that hardware... lots of libraries ready to go. AVR-GCC, under windows, can be setup using WINAVR, its an all-in-one package.. really easy to get started - and really standard, dozens of people that use it, you can get lots of help from people.

My guess is that it appears not too many people are using code::blocks for embedded development, so why go the hard way?

-Fergs

Azinman
04-06-2009, 11:34 PM
Okay. Oh btw I'm using the Freeduino from Solarbotics:
http://www.solarbotics.com/products/28920/
but there doesn't seem to be any huge differences so I think I'm all set from there. I just downloaded WinAVR so I will check it out...

lnxfergy
04-06-2009, 11:34 PM
Thanks, so the closest thing to AVRdude I found on a quick online search is WinAVR which seems to be a derivative of AVRDude. If you know of anything better please tell me :) By "programmer" you mean a compiler of sorts like Code::Blocks/AVR-GCC/CodeVision or am I understanding you wrong?

WinAVR = AVR-GCC (C/C++ compiler) + AVRDUDE (program that downloads code to the chip after compilation) + MAKE (used to put all that stuff together) + PROGRAMMERS NOTEPAD (nice little IDE, with some hotkeys already set up).

By programmer, he means a phyiscal piece of hardware used to interface between the computer and the chip for the sole purpose of allowing AVRDUDE to copy code onto the chip... but as I followed up, i don't think you need one, since the Freeduino has a bootloader (piece of code that acts like a hardware programmer for itself...)

-Fergs

lnxfergy
04-06-2009, 11:35 PM
Okay. Oh btw I'm using the Freeduino from Solarbotics:
http://www.solarbotics.com/products/28920/
but there doesn't seem to be any huge differences so I think I'm all set from there. I just downloaded WinAVR so I will check it out...


Any reason to not just use the Arduino software?

-Fergs

Azinman
04-06-2009, 11:38 PM
Hmmmmm good point I haven't really checked out a whole lot of other compilers as of yet; Code::Blocks was one of the first free compilers I found that was run off AVR-GCC so I went with that. Using the Arduino software isn't a huge problem, I'm just trying to keep my compiler options open just in case. :)

Azinman
04-06-2009, 11:44 PM
Okay so the Freeduino is a good AVR Board to start with ( I'm using this for my first robot programmed in C ) Just wanted to make sure of these things before I buy it ( 30$ for a Freeduino happens to be a handful of money for a 14-year-old without a decent-paying job like me :D ) Thanks for the replies I have to go soon but please feel free to list any free compilers or things I might need to have or use. :)

lnxfergy
04-06-2009, 11:48 PM
Okay so the Freeduino is a good AVR Board to start with ( I'm using this for my first robot programmed in C ) Just wanted to make sure of these things before I buy it ( 30$ for a Freeduino happens to be a handful of money for a 14-year-old without a decent-paying job like me :D ) Thanks for the replies I have to go soon but please feel free to list any free compilers or things I might need to have or use. :)

They all use the same compiler underneath - AVR-GCC. The only bonuses any environment can provide is a nice GUI and more libraries for interacting with common hardware. Also note that AVR-GCC is a full C compiler, but not quite a full C++ compiler (this is typical of embedded compilers, C++ has lots of overhead you don't want to use on a micro). In particular, the "class" keyword is defined, but there are no "new" or "delete" keywords - so memory management is still your ball game for dynamic class allocation.

-Fergs

jes1510
04-07-2009, 06:47 AM
D'oh! You are correct Fergs, the bootloader does emulate the STK500 programmer.