NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
NerdKits Newsletter Archives » NerdKits Newsletter #12 - New Customer Projects, avr-size, and more!
April 08, 2010
This newsletter was released on April 8th, 2010.
Hi! This is the twelth edition of the NerdKits Newsletter which we publish ~monthly to keep you and the world up to date with everything going on at NerdKits.
In this issue:
PAYPAL X DEVELOPER CHALLENGE RESULTS
If you read through the last newsletter, you would have noticed we were in the process of launching Buckits. Buckits was a self-serve group discount engine that we hoped would help spread the word about NerdKits. As part of our launch, we submitted the application to the PayPal Developer X Competition, and asked for your votes. Unfortunately, we did not move on past the community voting part of the competition. We had a tremendous response and many encouraging comments from the community, and we would like to thank everyone who took the time to vote for us. We truly value your continued support of all the crazy things we decide to do here at NerdKits!
NERDKITS CUSTOMER PROJECTS
Zor's RC Helicopter
User Zor has been working on controlling a small RC helicopter from his computer, using a NerdKit! He's posted initial results and a video:
Hopefully he'll post some more videos as work continues!
Our "iPhone-Controlled R/C Car" video tutorial might be useful for anyone trying a similar experiment:
Luis Cruz's Musical Instrument
Luis Cruz has been hard at work on his projects. We really liked his latest project: a musical keyboard built using simple pushbuttons and PWM. You can see it in action in this video he posted. It's a great example of putting different concepts together to make a really neat project.
This is a cool new angle on our "Make Music with a Microcontroller" video tutorial, which is one of the first video tutorials we released back in 2007:
He's also been publishing more details about his Embedded Entertainment System, which we first mentioned in our February newsletter. In his latest game, he makes a Pong-like game, again using an accelerometer, IR-based remotes, and TV and audio output -- all running on a few of our microcontrollers:
Luis Cruz is a high school student in Honduras, and his NerdKits-based work has recently inspired articles in at least two local newspapers. He's been a NerdKits customer for more than a year, and has been quickly developing his electronics and programming skills. Check out his website, where he's working to post more details about his projects:
Joel's Software Mods to the SPI Multi Panel LED Array
In early March, Joel set out on a mission to modify the Multi Panel SPI LED Array code to be able to command each pixel individually, instead of sending characters and having the arrays render them. After a lot of work and a few bumps along the way he published his result in this forum post:
http://www.nerdkits.com/forum/thread/569/ (scroll down for photos!)
He also published a Perl script to send data out to his array one pixel at a time. In his example, he demonstrates a smiley.
In that same thread, Joel took his project one step further and built a 300 pixel array out of purple LEDs. His array certainly looks much better than any of the ones we made here!
Post your Projects
Take a few quick photos, or make a YouTube video, and post your project to our forums! It helps everyone learn, tickles the imagination, and is an easy way to show off your work to a supportive community of fellow tinkerers.
HELPFUL FORUM MEMBER AWARD
This month, we would like to award the Helpful Forum Member Award to user bretm. In addition to being a prolific poster in general, always keeping the community up to date with what he is doing, bretm is always willing to jump in and help people when they are stuck. On more than occasion, we have been the process of responding to a forum post only to find bretm has already jumped in with the right suggestion. It is users like bretm and many others that make the NerdKits community what it is and make it possible to provide an unmatched learning experience when it comes to microcontrollers. On behalf of the NerdKits staff and the NerdKits community, thanks!
USEFUL TIP OF THE MONTH: AVR-SIZE
This month, we thought we would pioneer a new segment in our newsletter aimed at bringing you useful tidbits of information about microcontroller programming that you might not know about. Sometimes, a useful tool to be aware of is the avr-size tool that is included as part of binutils. It is installed by default by WinAVR and with the toolchain on all the other platforms too. avr-size can be useful for quickly determining if your code is too big to fit on the MCU.
For the most part, when writing simple programs, this won't be a problem, but once you start getting into more complicated systems, or you start importing other libraries, you can quickly run into space limitations with your microcontroller's flash memory space, where your compiled program is stored.
Let's use the initialload program which you have all compiled as an example. To find out how much space your code will take, first compile the code. You can just run
which will run just the initialload.hex target. This compiles the code without attempting to upload it to the chip.
If you list the files in that directory, you will see initialload.hex now exists. The hex file is the file that avrdude takes and uploads to your chip. This hex file is the one you need to run through avr-size to see how big it will be on the chip.
gives the result:
The results are in bytes, so this program will take 7,802 bytes in the chip, or almost 8KB of flash. The ATmega168 has 16K of flash memory (although 2KB are used for the bootloader, leaving 14KB = 14336 bytes for your program), so this program will fit just fine. If you need more space, the ATmega328P we offer has 32KB of flash memory (again with 2KB used for the bootloader, leaving 30KB = 30720 bytes for your program), which can be useful in some circumstances.
If you are of the curious nature (which we suspect most of our customers are!) you are probably wondering why that is so large. After all, initialload.c is only a few dozen lines of code. The bloat in code size comes from all the libraries we link by default in our Makefile. The libraries to write code to the LCD, uart communication, floating point math libraries, and printf string formatting, all add up. If you are ever working within a tight code space constraint, you may have to think about which libraries to not include to save some space!
If you have other tips that you'd recommend for future newsletters, please let us know!
Thank you for taking the time to read this, and for being such great customers. Make sure you tell your friends and neighbors about NerdKits so we can keep the world's DIY spirit alive!
Humberto & Mike
Sorry, this thread is closed. No further replies are permitted.