C3: Prepping for serious dev

Published August 27, 2011
Advertisement
The next real step forward was to begin working on the networking and time keeping. But those steps were the beginning of what is to become a real software project. Still small to medium sized compared to PC projects. But it will have a level of complexity that Ardunio projects don't usually achieve. What this means is the Arduino IDE would be wholly unsuited for developing it. I ran into this a bit with the Robot project. Towards the end of development as some complexity emerged with the socket communications, it got fairly difficult to manage in the Ardunio IDE.

My solution was to fall back to my trusty C++ IDE Code::Blocks.
code_blocks_logo.jpg
I love this IDE, so light weight, cross-platform, and infinitely configurable. C::B has some high level support for AVR projects (that's the architecture of the micro-controller that the Arduino uses), but it's really a thin veneer. All of the guts, GCC-AVR and others, must be setup on your own.

This...
Took...
Awhile...

I was following spotty tutorials written for much older versions of every piece of software in the chain. I had to extract AVR-libc and the Arduino Core lib from the Arduino IDE, get headers, do all sorts of fun stuff that Arduino clearly never intended for you to do. But in the end, I got it all compiling, burning, and running from within C::B. I even got C::B auto-resetting the hardware prior to burning! (Something none of the tutorials managed to do!)

I'll tell you, when I got my own code without any of the Arduino auto-magical trickery running on that chip:

int main()
{
init();

while(1)
{
// Insert celebration here
}
}


That was a gooooood day.

So with everything ready to go, all set for serious software development, I began looking into the networking. Dusted off my old networking WiFi shield (Arduino speak for daughter board) and began loading up all the libraries. I got a basic web server test running, and then went on to compile in more feature in the library. And all of a sudden, cla-thunk! My program wouldn't upload. Scrolled through the build log and found "Memory out of range". Crap... opened up the /bin directory of my project and saw the .elf file's size at 33KiB. The Arduino only has 32KiB of program memory...

After playing with stripping & size optimization options, and weighing if I really needed those library features that had pushed me over the limit. I concluded that I needed a new micro-controller with more memory. Luckily Arduino's come in several flavors! After a quick look-see, I decided on the new Arduino Mega 2560. It's based off of the newest Arduino, the Uno, has 8 times the program memory, and MANY more I/O pins. But other than that, it's identical to my current one. Which means it can be a slot in replacement, and I don't have to change any of my plans :)
arduino_mega2560.jpg

So I'm waiting on that to be delivered before I can continue.

That's all!
Previous Entry C3: First steps
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement
Advertisement