Step 48Program the AVR with real code
For the most part, the process is the same as in the previous programming step. But in addition you have to program the EEPROM memory. The LED cube has a basic bitmap font stored in EEPROM, along with some other data.
Firmware is programmed using the same procedure as with the test code.
Firmware:
- avrdude -c usbtiny -p m32 -B 1 -U flash:w:main.hex
EEPROM:
- avrdude -c usbtiny -p m32 -B 1 -U eeprom:w:main.eep
-U eeprom:w:main.eep specifies that we are accessing EEPROM memory, in write mode. Avr-gcc puts all the EEPROM data in main.eep.
If you don't want to play around with the code, your LED cube is finished at this point. But we recommend that you spend some time on the software side of things as well. That's at least as much fun as the hardware!
If you download the binary files, you have to change the filenames in the commands to the name of the files you downloaded. If you compile from source the name is main.hex and main.eep.
| « Previous Step | Download PDFView All Steps | Next Step » |



































































































![Hard Wired LED Cube: [No Programming]](http://img.instructables.com/files/deriv/FTD/SF1T/GO8DC8KW/FTDSF1TGO8DC8KW.SQUARE.jpg)















What I have noticed is that the sequences / patterns do not fully match the original video as shown by CHR. Have you noticed this also or have I missed something?
His video seems to have some really attractive complex waves which are missing on mine. Perhaps the code has been modified, just wanted your results to compare?
Thanks
Have you had a look at triumphtotty's recent posts. He's managed to get the waves working on the ATMEGA32
I've uploaded a copy of his files for someone else on the site who was having problems getting them to run.
Worth a look they look great.
case 20
I guess I'll have to use a real editor now. With CHR's software I was able to use Notepad on the C source files and Makefile (changed it to makefile.txt) but there don't appear to be line breaks in your that Notepad can recognize.
Bruce
http://www.youtube.com/watch?v=6EifBi-9aas&context=C42f8adaADvjVQa1PpcFMOyS89wGmxL5aNEnXBz-jWfaPVXeLR1QI=
And on for my Arduino-controlled 5 meter long LED strip.
http://www.youtube.com/watch?v=vrOuTZaDviQ
You can then easily edit the C source files using WINAVR's programmer's notepad and compile to your hearts content
Make sure you update effect.c (i've posted an update that uses all the layers (0-7)
Thanks again to Triumphtotty for his work on this
First though I've just found a column of 8 leds that are not lighting at all, everything else around ok, nothing obvious so far like a loose connection - further investigation required. If i'm right it's unlikely to be a transistor but maybe on the 74HC574 side of things - strange -
otherwise it's great to have the cube up and running.
Thanks for your feedback and help
The cube fully functional now, I'll post a couple of pics tomorrow
I've just got to congratulate CHR for publishing such a great project - its kept me happy for weeks!
Cheers
Can you do me a favour and confirm that pin1 on (Roel's AVR board) SV3 goes to layer 0 or does it connect to layer 7 (cathode layer select) on the cube?
pin 1 layer 0
pin 2 layer 1
pin 3 layer 2
pin 4 layer 3
etc
or
pin 1 layer 7
pin 2 layer 6
pin 3 layer 5
etc
I'm trying not to get the cube upside down and I'd rather get it right first time without having to re-do my ribbon cable the other way round
Cheers
I am hoping to follow in your footsteps. I have been sent the boards and have started the assembly.
Have you noticed the MAX232 T1IN and R1OUT are reversed on the ATMEGA32 RXD and TXD connection?
If you have any time saving words of wisdom to share it would be appreciated!
Important: the AVR programming cable must be plugged in backwards- at least with the ribbon cable I purchased. Use your ohmmeter to check.
There is no reset button. I added one.
There is no power-on led. I added one.
You can also see in the picture where I added a power connector for my 5v wall-wart cable.
As you can see, I used pre-terminated colored wires to run to the Ledcube base rather than the messy process of terminating 72 wires myself.
It is close to impossible to insert the 64 bottom leads of the ledcube into the base simultaneously. I did it by tilting the cube and doing one row at a time.
Thanks for the info especially the tip on the AVR programming cable.
I'm only on layer 3 of my LED cube so I've still got a lot to do, but it's nice to know the programming is done.
I think Roel has perhaps redesigned the boards slightly as mine has a reset button, and a power on led
Out of interest what values did you use for
AVR Board
R2 - I'm planning - 10K from posts I've read
R3-R18 - i was planning 220 ohm
R20-R28 - 4K7 Ohm
Mux Board
64 x 100 ohm based on 3.0V forward voltage, 20ma LEDS
I will have to take a closer look at the schematic, I don't doubt Bruceallen as his boards are working.
R2 10k
R3-18 220 ohm but my transistors are not driving the full load properly. Needs investigation. May need to be lower.
r20-28 4700
Mux board: 100 ohm.
i dont; suppose you have an updated schematic of the mux board you could send me. A reset button sounds like a good idea.
So the reset on my board doesn't do much then I guess?
Have you managed to get your hands on any new code for animations either on ATMEGA or PC via rs232?
I've got my rs232 working after installing Ubuntu, it's great to see the waves in action!
I've finished soldering my cube together - what a task
I've programmed the ATMEGA
Just need to connect the cathode layers / anodes to the cube.
I've still got plenty to do before I can test my setup
I remember you saying that the R3-R18 value of 220 ohms may be too high as the transistors were not driving the full load, now I see why!!!!
I've just checked the board with my ohmeter and T1 base should go to R3, Emitter to GND and Collector to SV3 pin 8
I will make sure I double check when putting my pn2222a's in
Amazed that the LED cube was being driven at all.
Thanks for the heads up!
So the schematic isn't wrong with Reset button ? And can you post the working schematic ? I saw my friend make Led cube 8x8x8 with less device than here. So if can modify the schematic to use less device ?
THank you for any helps
Do you have the schematic and PCB of Croy9000 designed ? He designed the PCB very nice.