Pages: [1]   Go Down
Author Topic: LED matrix, How to use fewer pins?  (Read 910 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, I am planning on making a display with a few 8x8 (or any other size, doesnt really matter) led matrixes. Are there any tricks to use less pins? Does anyone know of a good tutorial on how to work with these displays? I need to use the least amount of pins as possible.

Thanks for the help smiley
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 224
Posts: 6619
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

An 8x8 LED matrix has 8 anode lines and 8 cathode lines. I'll call the cathode lines columns and the anode lines rows. One way of driving it is to pull one of the column lines low, and pull the row lines corresponding to the LEDs you want lit in the column high. After a while, switch to the next cathode line and repeat. Do this fast enough and the eye can't see any flickering.

You need to use transistors or other drivers on the column lines, because you will be lighting up to 8 LEDs in a column at a time. You can drive the rows from Arduino pins, each one through a series resistor, if 20mA is enough for the LEDs.

So in its simplest form, you need 16 pins (8 for the columns and 8 for the rows). To reduce this, first use a demultiplexer on the column lines. A 3-to-8 demultiplexer such as the 74HC238 lets you select which of the 8 column lines you drive using just 3 pins instead of 8. So that's 11 pins now.

To reduce the pin count further, use an 8-bit shift register to drive the row lines. You need 3 pins to drive the shift register. So that's 6 pins in total.

To drive multiple 8x8 displays, you can connect the column lines in parallel. You can also daisy-chain the shift registers. So, with 6 pins, you can drive any (reasonable) number of 8x8 displays.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Anaheim CA.
Offline Offline
Faraday Member
**
Karma: 47
Posts: 2892
...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What does Google say? He (or She) has far more information than the sum of all the Arduino users... Try there First and then bring the questions you have after your search here for more 'selective' answers. Your question is open ended and until it is better bound, unanswerable as there are too many variables... including but not limited to "How Big is this thing" which you declined to accurately state.
I Quote:
Quote
display with a few 8x8 (or any other size, doesnt really matter) led matrixes.
.
Size Does Matter... A Lot... so start looking at what has been done and pick your 'ultimate project first... then come ask how to make it. You'll get much better answers.

Bob
Logged

--> WA7EMS <--
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

Manchester (England England)
Online Online
Brattain Member
*****
Karma: 627
Posts: 34229
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Are there any tricks to use less pins?
Yes lots.
When you say pins I am assuming you mean arduino I/O pins. Port expanders are easy to get more outputs as are shift registers. You can also get chips that will do the matrix scanning for you using only 5 pins. Or even charlyplexing chips.
But if you don't say what you want we can't tell you what to use.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 538
Posts: 27115
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Drive each 8x8 with a MAX7219 and daisy chain them. Hard to get fewer pins than that: SCK, MOSI, SS (MISO committed but not used).
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1217
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Do you use the LedControl library with the MAX7219s  Crossroads ?
Logged

With my mobile phone I can call people and talk to them -  how smart can you get ?

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 538
Posts: 27115
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I do not.
I use SPI.transfer() for everything, nice & fast. I have not used the equivalent of shiftout(), which is what LED library does, in over 2 years now.
A lot of times I use direct port manipulation even to control the SS line.

Couple of transfers in void setup to initialize it (them),
then blink without delay kind of routine to make updates.

Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Cape Town South Africa
Offline Offline
Edison Member
*
Karma: 19
Posts: 1217
A newbie with loads of posts, and still so much to learn !
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I am thinking of using SPI more,  I am busy reading up on multiplexing, and I think if I want to get the next data into the shift registers as quick as possible ready for the next row ?
Logged

With my mobile phone I can call people and talk to them -  how smart can you get ?

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 538
Posts: 27115
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

SPI will definetely get it there faster and take less clock cycles of processing to do it.
Make sure to put decoupling cap on each shift register.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1]   Go Up
Jump to: