Go Down

### Topic: Matrix problem (Read 5755 times)previous topic - next topic

#### Paul__B

#15
##### Mar 25, 2019, 10:04 pm
I've been reviewing the code....
Now that in itself shows great enthusiasm!

I think the multiplexing is done by column-by-column.
In which case, no risk of damage.

I take my hat off to the coder. Knowing so little, to have battled doggedly on to get anything working at all shows impressive determination. Bravo!
Have to agree.

Now if the rows were the cathodes, then substituting the right-hand 74HC595 with a TPIC6A595 and multiplexing by row using the 1k resistors could produce a workable display.

But only as an exercise.  For any serious purpose, I have advised in #9.

#### bogdan666

#16
##### Mar 26, 2019, 07:35 am
so i have to start from scratch... great, can you help me make at least one character so at least i have a foundation ?

#### PaulRB

#17
##### Mar 26, 2019, 06:08 pmLast Edit: Mar 26, 2019, 06:20 pm by PaulRB
You do not want to alter your matrix. I guess a lot of time went into building it. Would you consider cutting your matrix in half, so 2 x 8x8? Then you could use max7219 chips and one of the popular Arduino libraries for use with the max chip such as LEDControl or Parola.

If you truly want to continue with your current design, you could remove the series resistors on the columns and instead have 8 x 750R series resistors on the rows. But this would always be dim, as only 4mA will flow through each led with a duty cycle of 1/16, or 1/24 if you extend your matrix.

A better solution would be to scan the matrix row-by-row instead of the column-by-column used now. This would be brighter because the duty cycle would be only 1/8. Also, you could use a UDN2980 chip to boost the current available from the '595 driving the rows. You would keep the series resistors on the columns but you could reduce them to 750R.

#### bogdan666

#18
##### Mar 27, 2019, 07:23 am
Well, the easiest solution for me is to put resistors on the rows, and we can modify the code for row scanning, i will not extend the matrix, besides i have some red leds, even at 4mA they are bright enough for the experiment, i will keep the 1k for now and do some measurements after this is working properly.

#### PaulRB

#19
##### Mar 27, 2019, 08:14 amLast Edit: Mar 27, 2019, 08:18 am by PaulRB
No. For row scanning, the resistors should be on the columns. For column scanning, the resistors should be on the rows. This is one of the problems with your current circuit: you are column scanning but the resistors are on the columns.

Whenever LEDs are connected in parallel, each led should have it's own series resistor. When scanning the matrix column-by-column, you are lighting a column of up to 8 LEDs at a time, so for each led to have its own series resistor, those resistors must be on the rows. When scanning the matrix by row-by-row, a row of up to 16 LEDs could be lit in parallel, so the resistors must be on the columns.

In terms of brightness, it will make no difference whether you scan by row or by column. You hit the same limitation either way: the 35mA limit of a '595 pin. If scanning by column, that 35mA can be shared between 8 LEDs, so around 4mA each. But the duty cycle is 1/16, so the average led current is 0.25mA. if scanning by row, the 35mA is shared by up to 16 LEDs, so only around 2mA per led. But the duty cycle is 1/8, so the average current is also 0.25mA.

#### bogdan666

#20
##### Mar 27, 2019, 09:35 amLast Edit: Mar 27, 2019, 09:36 am by bogdan666
ooh, now i understand, so i leave the matrix just like it is, with the resistors on each column,  and we modify the code so we can do row scanning.
le: i was wondering why people choose different position for their resistors, now i know, thank you.

#### PaulRB

#21
##### Mar 27, 2019, 10:18 am
One change to the circuit I would suggest would be to chain the '595 driving the rows to the other two '595s. i.e. the Serial Out of the second '595 driving the columns is connected to the Serial In of the '595 driving the rows. All three '595s can share the same clock and latch lines. Then, you can connect all three '595s to the SPI pins on the Arduino. This should make the circuit less likely to flicker and make the best of the inevitably low brightness.

#### bogdan666

#22
##### Mar 27, 2019, 11:11 am
ok, that is an easy change i can make, only 2 wires to move, so after this the 3rd 595 will be the one driving my rows, consider it done, since it takes 5 minutes.

#### Grumpy_Mike

#23
##### Mar 27, 2019, 11:14 am
i was wondering why people choose different position for their resistors, now i know

#### bogdan666

#24
##### Mar 27, 2019, 11:20 am

"The other point is that current through the LED must be limited some how. The simplest way of doing this is with a series resistor. However, the resistor must be in the line that only takes the  current for one LED"

this is what they say, it got me a bit confused, i did not understood this at first, English is not my first language, maybe that played a part in there as well, sorry, i am still on the learning path of all this.

#### PaulRB

#25
##### Mar 27, 2019, 05:08 pm
only 2 wires to move, so after this the 3rd 595 will be the one driving my rows
But do you understand what I meant when I said the SPI pins? They are particular pins on the Arduino. Which pins depends on which type of Arduino. But they are almost always marked "MOSI" and "SCK". You can't just use any pins. This is because the Arduino has a dedicated circuit on the chip itself which is designed to send data at high speed to chips like the '595, and that circuit is connected to only those pins.

#### PaulRB

#26
##### Mar 27, 2019, 05:13 pm
i did not understood this at first, English is not my first language
In my opinion, you English is very good. Using "understood" instead of "understand" there was the first mistake I have noticed.

#### bogdan666

#27
##### Mar 27, 2019, 10:18 pm
mosi 11 miso 12 and sck 13 yes, however i don't know what they stand for, or if it makes any difference which i connect to which.

#### Grumpy_Mike

#28
##### Mar 27, 2019, 10:42 pm
Quote
mosi 11 miso 12 and sck 13 yes, however i don't know what they stand for
Master out slave in
Master in slave out
Serial clock

They tell you what direction the data goes in.
So MOSI is an output pin for an Arduino acting as a master device and an input for a shift register acting as a slave device.

They tell you what way round things should be wired.

#### bogdan666

#29
##### Mar 28, 2019, 06:29 am
ok,that makes sense, except for the latch pin of the 595, does that has a special output as well ?

Go Up