I bought a couple of 8x8 led matrices on ebay. I tested them with a resistor and a 5v power supply. I managed to find out the right connection to led up every dot. Works fine!
So the next step was to make drive it with the arduino. I ordered two 74c595 chips. One for the anode, and one for the cathode.
A couple of resistors in between.
It didn't work, so i broke it down. I decided to set up 4 leds with the same idea. One side to the resistors and the 74ch595 and other side to another 74ch595.
So when i set the first bit of the 74ch595 to 1(+5V) and the first bit of the other 74ch595 to 0(0V) then the led must lit.
Otherway around it stays off.
my code:
// simple 4 led setup.
// 2x 74ch595, 1 for anode, 1 for kathode
// use to test with troubles with 8x8led matrix common anode.
// 4 pins of the 74ch595 are used (A0-A3)
int latchrow = 12; //pin 11 74ch595
int latchcol = 10; //pin 11 74ch595
int clockPin = 9; //pin 12 74ch595
int datarow = 11; //pin 14 74ch595
int datacol = 8;//pin 14 74ch595
byte ledcol = B00001111;
byte ledrow = B00001101;
void setup() {
//set pins to output so you can control the shift register
pinMode(latchrow, OUTPUT);
pinMode(latchcol, OUTPUT);
pinMode(clockPin, OUTPUT);
pinMode(datarow, OUTPUT);
pinMode(datacol, OUTPUT);
}
void loop() {
digitalWrite(latchrow, LOW);
shiftOut(datarow, clockPin, MSBFIRST, ledrow);
digitalWrite(latchrow, HIGH);
digitalWrite(latchcol, LOW);
// shift the bits out:
shiftOut(datacol, clockPin, MSBFIRST, ledcol);
// turn on the output so the LEDs can light up:
digitalWrite(latchcol, HIGH);
}
You can not drive a matrix with just shift registers you need at least one side to go through a driver first because the shift register can not supply enough current.
TPIC6B595s and TPIC6C595s have been recommended by various people on this board, they are basically the same as the 595 but allow current levels sufficient to drive almost any small LED display. I have them, they work great. I would get a few of those if you have a few bucks to spend. Adafruit sells the B version:
Digikey sells A, B, and C versions. The A allows the highest current and has like 5 pins to ground to support the sinks, B has 3, A has one. All are better choices than a CMOS or TTL 595 which is for logic levels.
The 74HC595 can drive +/- 25mA on an output, which should be fine for driving a single LED. The single 4-pin RGB varieties on eBay etc. pull about 20mA.
So if you are using your 595s in a row/column time-multiplexed scan matrix kind of thing where 1 LED at the intersection is on at a time, it should work.
If you are driving an entire row/column of leds through a pin or all at once or something, you will need one of those more expensive, higher-output chips.