3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

LED Cube 8x8x8

Step 38Build the controller: AVR board

Build the controller: AVR board
«
  • IMG_1526.JPG
  • IMG_1527.JPG
  • IMG_5971.JPG
  • IMG_5978.JPG
Braaaaainzz!!!

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 StepDownload PDFView All StepsNext Step »
18 comments
May 13, 2012. 3:01 AMinnercitydk says:
Awesome instructional Chr!

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/
Nov 20, 2011. 11:19 AMCynastor says:
Hello.
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?
Mar 9, 2012. 12:33 PMjwestenberg says:
I have the same problem, have you got an answer yet?
Jan 9, 2011. 6:25 PMmcpattrsn says:
Correct me if I'm not reading this correctly.

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.
Jan 12, 2012. 3:35 AMfluetke says:
Please correct me if I'm wrong.

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?
Sep 16, 2011. 7:44 AMvijirvy says:
hello sir,i have one problem that is ground layer(0-7) from main board is not getting what is the reason ? how many pins in pull up resistor? reply me
Sep 15, 2011. 6:05 AMvijirvy says:
hi , i tried this project almost i done but setting the fuse bit i have some problem
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
Jan 10, 2011. 5:11 AMjoymonkey says:
If we're going to use an Arduino with this Instructable, how much of the AVR board would we actually need to make? I'm wondering if I can cut down on my components list and soldering time.
Sep 15, 2011. 6:08 AMvijirvy says:
hi , i tried this project almost i done but setting the fuse bit i have some problem
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
Mar 16, 2011. 4:36 PMMrGentlemen says:
what is the Value of R2 in the AVR-Shematic?
May 21, 2011. 10:30 AMnavyaj says:
also r65,r66,r67 if your remember
May 21, 2011. 10:29 AMnavyaj says:
did u ever find out the resister values? if so what are the other values u used on the board?
r1
r2
r19

I am having a hard time figuring out what resisters to use throughout this project. except the 64 100 ohms.

May 21, 2011. 10:32 PMfebinjohn says:
simply use 150 or 220 ohm resistor it will do the job
May 22, 2011. 11:26 AMnavyaj says:
At all the locations mentioned?
May 22, 2011. 9:22 PMfebinjohn says:
yep in digital world 100 or 200 doesn't mater much if want exact calculation use

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
Jan 13, 2011. 3:37 AMDheed says:
This is my first time that i see something about electronics and i don't know anything about it...so Could you post an image of the backside of this controler at the end?
Thanks.
Mar 8, 2011. 6:43 PMsbrown7792 says:
I second this. I have been looking at the pictures and schematics side by side, and sometimes they don't match perfectly. It'd be great if we could get a couple high-res front, back, and maybe some angle shots of both of the completely finished boards. Some of the boards in the current pictures aren't quite completed, so I feel like they may not have been the final version.
Thanks!
Feb 19, 2011. 8:46 AMMasterDion says:
Where is the schematic of the avr? I build the cube but it doesn't work. Now i wonne check the PCBs. But now the schematic is gone.
Jan 21, 2011. 6:03 PMMrGentlemen says:
Did i need to use an ATmega32 with 16Mhz or 8Mhz?
Witch one would be better?
Jan 30, 2011. 10:19 AMKen R says:
8Mhz is a no go I think, if you want to use RS232 without error correction.
Look at step 31 - it should run @ 14.7462Mhz
Jan 13, 2011. 12:33 AMmtylerjr says:
This is the first instructable Ive really gotten excited about. I apologize if I ask too many "Can I substitute this...." questions.. but here is another.

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)


Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
651
Followers
7
Author:chr
I like microcontrollers and LEDs :D