Offline
Newbie
Karma: 0
Posts: 20
|
 |
« on: December 08, 2012, 04:07:41 am » |
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 
|
|
|
|
|
Logged
|
|
|
|
|
United Kingdom
Offline
Faraday Member
Karma: 131
Posts: 4674
|
 |
« Reply #1 on: December 08, 2012, 04:30:53 am » |
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. http://www.eschertech.com
|
|
|
|
Anaheim CA.
Offline
Edison Member
Karma: 31
Posts: 2304
Experienced old Whitebeard with a Full head of Hair...
|
 |
« Reply #2 on: December 08, 2012, 06:43:03 am » |
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: 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
|
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
|
|
|
|
Manchester (England England)
Online
Brattain Member
Karma: 277
Posts: 25497
Solder is electric glue
|
 |
« Reply #3 on: December 08, 2012, 05:36:19 pm » |
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
Brattain Member
Karma: 245
Posts: 16516
Available for Design & Build services
|
 |
« Reply #4 on: December 08, 2012, 07:27:00 pm » |
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
|
|
|
|
|
Cape Town South Africa
Offline
Edison Member
Karma: 17
Posts: 1104
A newbie with loads of posts, and still so much to learn !
|
 |
« Reply #5 on: December 09, 2012, 03:48:07 pm » |
Do you use the LedControl library with the MAX7219s Crossroads ?
|
|
|
|
|
Logged
|
We live in the era of the smart phones and stupid people.
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 245
Posts: 16516
Available for Design & Build services
|
 |
« Reply #6 on: December 09, 2012, 04:57:15 pm » |
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
|
|
|
|
|
Cape Town South Africa
Offline
Edison Member
Karma: 17
Posts: 1104
A newbie with loads of posts, and still so much to learn !
|
 |
« Reply #7 on: December 09, 2012, 05:39:19 pm » |
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
|
We live in the era of the smart phones and stupid people.
|
|
|
|
Global Moderator
Boston area, metrowest
Offline
Brattain Member
Karma: 245
Posts: 16516
Available for Design & Build services
|
 |
« Reply #8 on: December 09, 2012, 06:39:54 pm » |
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
|
|
|
|
|
|