Step 3The control hardware
In order to save on pins I am using a shift register to control the columns. This way I can control an almost unlimited number of columns with just four microcontroller pins. It is possible to use only three if the Enable Output pin is tied directly to voltage. I have selected the HEF4794 LED driver with shift register. This is a better option than a standard 74HC595 as it can easily sink the current present when all 8 LEDs are on at one time.
On the high side (current source for the rows) I am using an mic2981. The schematic shows a UDN2981, I believe these two are interchangeable. This driver can source up to 500mA of current. Because we are only driving 1 row at a time this gives a lot of opportunity for expansion, up to 33 columns for this chip (more on that in the "modular concepts" step).
Building the Control Hardware
For this instructable I have just breadboarded this circuit. For a more permanent solution you will want to either etch your own circuit board or use prototyping board.
1. Row Driver
- Place the mic2981 (or UDN2981) in the breadboard
- Connect Pin 9 to Voltage (This is confusing in the schematic)
- Connect Pin 10 to Ground (This is confusing in the schematic)
- insert 3k3 resistors connecting to pins 1-8
- Connect from Port D of the ATmega8 (PD0-PD8) to the 8 resistors
- Connect the 8 row control wires of the LED matrix to pins 11-18 (note that I have connected the lowest row of LEDs to Pin 18 and the Highest row to Pin 11).
- Place the hef4794 in the breadboard
- Connect Pin 16 to voltage
- Connect Pin 8 to ground
- Connect 220 ohm resistors to Pins 4-7 and 11-14.
- Connect the 8 column control wires from the LED matrix to the 8 resistors you just connected.
- Connect Pin1 (Latch) to PC0 of the ATmega8
- Connect Pin2 (Data) to PC1 of the ATmega8
- Connect Pin3 (Clock) to PC2 of the ATmega8
- Connect Pin15 (Enable Output) to PC3 of the ATmega8
- Connect a 12MHz crystal and load capacitors as shown in the schematic
- Connect the programming header as shown in the schematic
- It is best to filter the voltage supplied to the ATmega8. Use a 0.1uf capacitor between Pin 7 & 8 of the ATmega8
- The reset pin should not be left floating as it can cause random resets. Use a resistor to connect it to voltage, anything about 1k should be good. I've used a 10k resistor in the schematic.
| « Previous Step | Download PDFView All Steps | Next Step » |













































http://www.sparkfun.com/tutorials/110