Instructables

LED Cube 8x8x8

FeaturedContest Winner

Step 49: Software: Introduction

Picture of Software: Introduction
The software is written in C and compiled with the open source compiler avr-gcc. This is the main reason we use Atmel AVR micro controllers. The PIC series from Microchip is also a nice choice, but most of the C compilers cost money, and the free versions have limitations on code size.

The AVR route is much more hassle free. Just apt-get install the avr-gcc compiler, and you're in business.

The software on the AVR consists of two main components, the cube interrupt routine and effect code for making fancy animations.

When we finally finished soldering, we thought this would be the easy part. But it turns out that making animations in monochrome at low resolutions is harder than it sounds.

If the display had a higher resolution and more colors, we could have used sin() and cos() functions and all that to make fancy eye candy. With two colors (on and off) and low resolution, we have to use a lot of if() and for() to make anything meaningful.

In the next few steps, we will take you on a tour of some of the animations we made and how they work. Our goal is to give you an understanding of how you can make animations, and inspire you to create your own! If you do, please post a video in the comments!
 
Remove these adsRemove these ads by Signing Up
jtovar932 years ago
Hi,

I have been loking at this tutorial and I am wondering if the microcontroller has to have the same numbers/ letters written on it...

In other words, would either of these microcontrollers work?

http://www.ebay.com/itm/1pcs-ATMEGA32A-PU-MCU-32K-FLASH-16MHZ-40-PDIP-ATMEGA32-/250891976699?pt=LH_DefaultDomain_0&hash=item3a6a53bffb

http://www.ebay.com/itm/1PCS-ATmega32A-PU-ATMEL-Brand-New-Original-/320854374464?pt=LH_DefaultDomain_0&hash=item4ab4693840

http://www.ebay.com/itm/1p-Original-ATMEL-ATMEGA32A-PU-ATMEGA32A-DIP-40-IC-NEW-CK19-/260901363057?pt=LH_DefaultDomain_0&hash=item3cbeeedd71

http://www.ebay.com/itm/New-1x-ATMEGA32A-PU-MCU-AVR-8-bit-32K-Flash-16MHz-Microcontroller-/230678624274?pt=LH_DefaultDomain_0&hash=item35b5847812
Yes, any of these should work. If AvrDude gripes, just use the -F flag to write to it anyway. You can also edit the table that tells avrdude what device should have what device ID, but I forget which file you have to edit. I did it to mine and then once it was done, forgot about it...LOL.
digitaldgs1 year ago
If you are having trouble with the link, just save the file, find the .tmp file and rename it to ledcube_8x8x8-v0.1.2.tar.gz that it should be.
sjowett2 years ago
Hi There I've got the ATMega 324A PU 1106 and unfortunately am having some issues. Using avrdude it reports that the register name does not match (aparently the register is 0x1e9515) I've forced avrdude with the -F command and everything looks ok but the 2 status LED's do not flash. (what is the flash rate of the 2 leds?) Does anybody know what the difference between a 'P' and an 'A' version. After some searching I'm struggling to find any easy to read info on this subject. Anyway I guess I'll go out and try find an 'old' AT mega32 16PU as in the photo above! Any advice would be appreciated - great instructable!
pawarotti2 years ago
cannot download the filele cube_8x8x8-v0.1.2.tar.gz, can someone post the another linc?
please help!
tarPancake2 years ago
when i compile the custom code, all i get is the 2 flashing led's the cube never boots into avr mode. if i program the cube with the main.hex and main.eep from step 48, everything works fine. I think that there may be something in the code not letting it return 1 in the bootwait function. is there anyone that can confirm or send me a zipped up version of the file above with the correct code?

hmmmm.... when i compile in linux, all is good :)

I am thinking that my winavr setup is bad. maybe crlf? lf? cr?

anyway, dual booted into linux, edited the source and compiled first time no errors and programmed the chip with no problems either.
chaserled2 years ago
(removed by author or community request)
sorry this image more better
2-13-2012 11-59-40 AM.png
sorry my bad
2-13-2012 12-04-09 PM.bmp
chaserled2 years ago
Hi triumphtotty i was follow the intruction to burn fuse by usbtiny ,the process was suucessful but when i remove the jumper from the usbtiny it said the fuse was change! so when i install the jumper back it be come find look at this image
chaserled2 years ago
(removed by author or community request)
Hi.  You need to burn the fuses to tell the ATmega32 to use the external crystal.  A new ATmega32 is set to run at 1MHz using its internal clock.  You don't need to compile the code to program the ATmega.  Just download the text.hex file first from around Step46 and use avrdude from the command line.  You are using the same programmer as Chr's, so the commands are exactly as in this Instructable.  Set the fuse bits carefully as in Step 45, then upload the test.hex and run it.
i did now the cube run test one by one led and the next step i want to play around with the software but i did not sure how to set up the usb convert to serial 9 pin cable and i still try to find the way to make it work if u can help me i really appreciate i use crywin on win7 so how i support to setup the usb convert to 9pin serial port
alahamm2 years ago
What´s this "ledcube_8x8x8-v0.1.2.tar.gz" for?
No explanation on that.
chaserled2 years ago
Hi Chr can u help me how to identify the programmer, this is my programmer http://www.ebay.com/itm/New-Development-Board-Kit-ATMEL-AVR-Atmega16-Mega16-/270745443529?_trksid=p5197.m7&_trkparms=algo%3DLVI%26itu%3DUCI%26otn%3D4%26po%3DLVI%26ps%3D63%26clkid%3D5728950572093077102
i'm have troubdle to detect it please help
emcniece3 years ago
Is anyone else having trouble downloading this file? All I get following the link is a .tmp file...
i have the same problem,i don't know why,may be the source file is a .temp file
Oh, they probably did it to get around something. Download it and rename the extension to .tar.gz, or just save it with the .tar.gz extension... it'll open just fine.
you have to save as the file format unless u use mozilla then it should come out right
hi friend
i have a ardino bord for atmaga328.
can i use for this is ie atmaga3216pu.
lpaulson873 years ago
I ended up purchasing a ATMEGA324P-20PU-ND (20Mhz rather than 16Mhz) will this give me problems?

Since it  works with an external crystal frequency there should be no problem.
I have not the data sheet.
There should be some specs for operating frequency range with Your Atmega..

Here it is:

http://www.atmel.com/dyn/resources/prod_documents/8011S.pdf

There states that it is operational from zero to 20 MHz ! :)

Good Luck!
Makes sense, thanks.
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!