Go Down

Topic: 8x8led matrix troubles with 2x 74CH595 (Read 2173 times) previous topic - next topic

mdunk

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:
Code: [Select]
// 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);
}


more info here.
http://marceldunk.blogspot.com/2012/09/4-leds-with-2-74ch595.html


Sorry for the bad english......


grtx,

Marcel


funkyguy4000

Does this code work?
I would recommend taking a good look at this.  http://arduino.cc/en/Tutorial/ShiftOut
Accelerate to 88 miles per hour.

Grumpy_Mike

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.

mdunk

Hi Mike,

thanks for youre comment. I thought about that, but i saw a lot of tuto's on the internet that hasn't used them.
Look at this one: http://www.youtube.com/watch?v=wXvs0CrRPIw&feature=fvsr

but when i do use one, wich is the best one to use?

by the way:
i did mention to get the 4 leds working now with two 74hc595's!  FINALY..
What a great evening!!!

Now i'm going to replace the 8x8 matrix to test some things.

thanks.

Grumpy_Mike

Quote
but i saw a lot of tuto's on the internet that hasn't used them.

Thatis because they are written by idiots who don't know what they are doing. You will damage your chips doing this.

Nick Gammon

I have a page about driving them with a MAX7219 here.

http://www.gammon.com.au/forum/?id=11516
Please post technical questions on the forum, not by personal message. Thanks!

More info:
http://www.gammon.com.au/electronics

JoeN

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:

https://www.adafruit.com/products/457

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.
I have only come here seeking knowledge. Things they would not teach me of in college.

mad_ned

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.

Go Up