Go Down

### Topic: 5x5 led matrix with 2 74hc595 (Read 3439 times)previous topic - next topic

#### samjack

##### Nov 03, 2012, 10:13 pm
Hello, i made a led matrix 5x5 leds.
i want to use 2 74hc595 shift-registers (i have some 74hc165 here to)

is it possible to help me out how to control the rows and collums with the registers, i'm a noob.
i want use follow code for it, but its for a 8x8. (in attachment)
is it also possible to make the lines for the letters as B00001, in the code its like 0x00, 0x22 etc

#### guix

#1
##### Nov 04, 2012, 07:52 pmLast Edit: Nov 04, 2012, 07:53 pm by guix Reason: 1
Hello,

I'm not sure you can control 25 LEDs with 2 8bits shift registers, so I will even not try to answer this, maybe someone else can

As for converting hex to binary, it isn't hard and you don't even need a calculator, look how it's simple to do it manually:

Exemple for letter 'A':
Code: [Select]
`B00000000,    // ________   AB00011000,    // ___XX___B00100100,    // __X__X__B00100100,    // __X__X__B00111100,    // __XXXX__B00100100,    // __X__X__B00100100,    // __X__X__B00000000     // ________`

0 = _
1 = X

#### Grumpy_Mike

#2
##### Nov 04, 2012, 08:15 pm
Quote
(i have some 74hc165 here

The problem with those is that they have no data latch and so you will get intermediate logic states on the outputs while shifting out. This will look like ghosting on supposedly unlit LEDs.

Before any one can tell you what code to use you have to know what way you are going to wire things up, do you have that information?
This is the sort of thing you have to do to multiplex a matrix:-
http://www.thebox.myzen.co.uk/Workshop/LED_Matrix.html
the same principle applies no matter how big it is.

#### samjack

#3
##### Nov 06, 2012, 09:01 pm

but with the positive side to resistor to the 74hc595
and the negative side to npn like this

the base to resistor to 74hc595 and collector to negative side of the leds and emiter to ground.

#4
##### Nov 06, 2012, 09:54 pm
So you have this matrix.
You connect the Anodes to the output of 1 shift register.
You connect the transistor bases to the output of the other shift register.

You shift out the anode data, you turn on one transistor, wait 2mS, turn it off
You shift out the next anode data, you turn on the next transistor, wait 2mS, turn it off
repeat 3 more times.

If you keep the anode data as 5 bytes of data (or a small array), you can have a function that updates the matrix every 2 mS, and a different function that updates the 5 bytes every 100mS.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

#### samjack

#5
##### Nov 08, 2012, 06:49 pm
the electrical scheme is right what you made. how do i integrate the above project in it? or is it not possible?

#6
##### Nov 08, 2012, 07:50 pm
Easily possible.
Shift data into anod shift register, shift B00000001 into the cathode shift register
After 5mS:
Shift data into anod shift register, shift B00000010 into the cathode shift register
After 5mS:
Shift data into anod shift register, shift B00000100 into the cathode shift register
After 5mS:
Shift data into anod shift register, shift B00001000 into the cathode shift register
After 5mS:
Shift data into anod shift register, shift B00010000 into the cathode shift register
After5mS:
Repeat from the top.
Use millis() to check the time going by. During the 5mS between pairs for shifts, do other stuff, like check for serial data, manipulate the data to be shifted into the anode shift register, etc.

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

#### samjack

#7
##### Nov 08, 2012, 10:08 pm
i dont understand at all :s

#### Grumpy_Mike

#8
##### Nov 09, 2012, 01:06 pm
Then read this, it tells you what you are trying to do.

http://www.thebox.myzen.co.uk/Workshop/LED_Matrix.html

After reading it go back and try and understand what Crossroads is telling you.

Go Up