Step 38Build the controller: AVR board
This board is the brain of the LED cube. The main component is an Atmel AVR ATmega32.
This is an 8 bit microcontroller with 32 KB of program memory and 2 KB RAM. The ATmega32 has 32 GPIO (General Purpose IO) pins. Two of these will be used for serial communication (TX+RX). Three IO pins are used for ISP (In-circuit Serial Programming). This leaves us with 27 GPIO to drive the LED cube, buttons and status LEDs.
A group of 8 GPIO (8 bits, one byte) is called a port. The ATmega32 has 4 ports. PORTA, PORTB, PORTC and PORTD. On PORTC and PORTD some of the pins are used for TX/RX and ISP. On PORTA and PORTB, all the pins are available. We use these ports to drive the data bus of the latch array and layer select transistor array.
PORTA is connected to the data bus on the latch array.
Each pin on PORTC is connected to a pair of transistors that drive a ground layer.
The address selector on the latch array (74HC138) is connected to bit 0-2 on PORTB. Output enable (OE) is connected to PORTB bit 3.
In the first image, you see the AVR board right-side-up.
The large 40 pin PDIP (Plastic Dual Inline Package) chip in the center of the board is the ATmega32, the brainz! Just to the left of the ATmega, you see the crystal oscillator and it's two capacitors. On either side of the ATmega there is a 100nF filtering capacitor. One for GND/VCC and one for AVCC/GND.
In the top left corner, there is a two pin connectors and two filtering capacitors. One 10uF and one 100nF. The LED is just connected to VCC via a resistor, and indicates power on.
The large 16 pin connector directly above the ATmega connects to the latch array board via a ribbon cable. The pinout on this corresponds to the pinout on the other board.
The smaller 10 pin connector to the left, is a standard AVR ISP programming header. It has GND, VCC, RESET, SCK, MISO and MOSI, which are used for programming. Next to it, there is a jumper. When this is in place, the board can be powered from the programmer.
Caution: DO NOT power the board from the programmer when the actual LED cube is connected to the controller. This could possibly blow the programmer and even the USB port the programmer is connected to!
The second image shows the underside. Again all GND and VCC lines are soldered as traces on the protoboard or bare wire. We had some more left over straight metal wire, so we used this.
The orange wires connect the ATmega's RESET, SCK, MOSI and MISO pins to the ISP programming header.
The Green wires connect PORTA to the data bus.
The blue wires are the address select lines for the 74HC138 and output enable (OE) for the latch array.
1) Start by placing the 40 pin IC socket, the 10 pin ISP connector with a jumper next to it and the 16 pin data bus connector.
2) Solder in place the power connector, capacitors and power indicator LED.
3) Connect all the GND and VCC lines using solder traces or wire. Place a 100nF capacitor between each pair of GND/VCC pins on the ATmega.
4) Solder in the crystal and the two 22pF capacitors. Each capacitor is connected to a pin on the crystal and GND.
5) Run all the data bus, address select and OE wires, and the ISP wires.
Transistors, buttons and RS232 will be added in later steps.
At this time, the AVR board can be connected to an ISP programmer and the ATmega should be recognized.
| « 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)















I found this instructional that can be used as a reference to a complete wiring of the backside of the AVR board. It helped me a lot along with the Addendum instructional.
http://www.instructables.com/id/My-8x8x8-LED-Cube/
First of all i would like to thank you for this instructable. You did great work here and in the instructable for the 4x4 cube which i already built. But now to my Question.
In the Picture above it looks like you are connecting pin 40 of the atmega to pin 7 of the 16 pin data bus connector an so on. In your Eagle file it looks as it is the other way round, here pin 40 is connected to pin 14 of the connector. I think the Photo is right and the Eagle file should be updatet. Is this right?
Here you say "Each pin on PORTB is connected to a pair of transistors that drive a ground layer." But in the schematic you show the pins on PORTC connecting to the transistors.
I have updated the text in the Instructable.
Thank you for pointing that out!
In the Description you say "On PORTC and PORTD some of the pins are used for TX/RX and ISP." Shouldn't it be PORTB for ISP instead of PORTC?
i use avrdude first lower bits write successfully after the chip didn't respond (power on failed) i check the power and all is correctly work
can i use atmega16 for atmega32?
reply urgent.....
thank you
i use avrdude first lower bits write successfully after the chip didn't respond (power on failed) i check the power and all is correctly work.
please tell me how to set the fuse bits in extreme avr burner
can i use atmega16 for atmega32?
reply urgent.....
thank you
r1
r2
r19
I am having a hard time figuring out what resisters to use throughout this project. except the 64 100 ohms.
http://ledcalc.com/#calc
use
supply voltage as 5 v
Voltage Drop Across LED 3 (depends on what type of led )
Desired LED Current 20 mA
Thanks.
Thanks!
Witch one would be better?
Look at step 31 - it should run @ 14.7462Mhz
Can I use this instead of the bare ATmega32 IC?
http://www.pjrc.com/store/teensypp_pins.html
- this seems like it would simplify thinsg greatly, since it already provides a method to program it (usm connector)., seems to be compatible with the atmega32, and seems to actually have a few more GPIO pins (Porta through PortF)