Connecting 8x8 matrices to a 12x16 driver - Page 1
Forum section: electronics / projects

author: danners430
author_rank: Regular Contributor
timestamp: February 04, 2019, 06:47:02 pm
content: Hey folks,I've got 3 8x8 LED dot matrix displays which I need to drive. The obvious way is to use the MAX7219 driver for each of them, but seeing as I have a total of 52 matrices, that gets very expensive, very quickly... The solution I stumbled upon is the IS31FL3733, which seems ideal. It's a 12x16 driver, so a total of 192 nodes, which of course is the same as my 3 matrices.The problem I've come across is how to connect them up - I can easily connect matrix 1 & 2 to columns 1-8 & 9-16 respectively, but that leaves matrix 3 spanned across all 16 columns, and it of course only has 8 inputs...I attach a photo below of the dilemma...The only solution I've been able to think of, and I'm not sure if it would work, is to connect CS1 to CS9, CS2 to CS10 etc. at matrix 3, using diodes to prevent "backflow" into the other matrices... would this work?Cheers for the help guys

author: Rolo
author_rank: Regular Contributor
timestamp: February 05, 2019, 05:55:57 am
content: Did you look at the Holtek HT16K33? This is I2C and can drive up to 8x16 leds in a matrix. Cheaper as the MAX7219. Adafruit uses it in their Led backpacks is various configurations.

author: danners430
author_rank: Regular Contributor
timestamp: February 05, 2019, 06:07:43 am
content: Quote from: Rolo on February 05, 2019, 05:55:57 amHmm, they would work just fine too... Only downside is I'd need two chips for each board (3 matrices per board), so a little more expense and programming overhead - by no means unachievable, and certainly a good backup plan if the IS31FL3733 doesn't work out :-)Sent from my ONEPLUS A3003 using Tapatalk

author: rs20
author_rank: Super Contributor
timestamp: February 05, 2019, 06:14:20 am
content: If you wanted to drive68x8 displays with2IS31FL3733s, then you'd be fine! (Sort of... maybe not even actually)It's very clever to stagger the two 8x8 displays the way you did to increase your chances, but unfortunately your suggestion doesn't work, at least, not naively. If you used a diode to steer CS10 into CS2, then trying to turn on LED K2 via the diode would also turn on LED K10 in the green array. In fact, the drop across the steering diode would probably mean that only K10 would turn on, K2 would be off or very dim.I haven't prepared a formal proof, but I have a vague hunch that it's impossible to drive 3 8x8 displays with the IS31FL3733s, unless you somehow electrically split one of the displays in 2 (or redefine the requirements in such away that the artifacts from the weird wiring work in your advantage.)

author: danners430
author_rank: Regular Contributor
timestamp: February 05, 2019, 06:36:31 am
content: Quote from: rs20 on February 05, 2019, 06:14:20 amDangit... I was determined to get it working :-( It may be that I find some strange way to get it working in the next couple days, but I'll put it on the back burner for nowQuote from: danners430 on February 05, 2019, 06:07:43 amWell, searching for the HT16K33 did have one advantage - it led me to the HT1632C, which can drive 24x16 LEDs - which is literally double what I need, since one of my boards is a "measly" 24x8... Means I could theoretically connect two boards together, with a master and slave board, with a simple 32 way connector between the two :-)

author: rhodges
author_rank: Frequent Contributor
timestamp: February 05, 2019, 02:13:54 pm
content: Have you looked at the populated max7219 modules on ebay? Three of these would be about five dollars:https://www.ebay.com/itm/1-2-5-10PCS-MAX7219-Dot-matrix-module-MCU-control-Display-module-DIY-NEW/222263146269So maybe eighty dollars total for your 52 modules?I have written a library for the STM8 micro that might be helpful as a reference:https://github.com/unfrozen/stm8_libs/wiki/lib_max7219:-LED-controller-for-7-segment-or-matrix-displays.

author: danners430
author_rank: Regular Contributor
timestamp: February 05, 2019, 02:16:47 pm
content: Quote from: rhodges on February 05, 2019, 02:13:54 pmThey're tempting... But I've only got a 40x80mm footprint to fit all the control electronics for the module, unless I start stacking boards...Sent from my ONEPLUS A3003 using Tapatalk

author: mariush
author_rank: Super Contributor
timestamp: February 05, 2019, 10:34:25 pm
content: Have you considered using a cheap microcontroller for each 8x8 matrix?After all, you need only 16 IO pins + the IO pins for communicating with the outside world ... so a 28pin microcontroller would probably be plenty.A basic PIC16 can do probably 10-15mA per pin, and around 150mA in total, so if you light only one row or column at a time, that would be perfectly fine... you'll have 8 x 10-15mA of power consumption.You can use SPI and share the data and clock with all slave micros and use a select wire to make one microcontroller listen to incoming data.For example PIC16F57 with 28 pins at 65-70cents if you buy 50+ seems to be perfectly capable:https://www.digikey.com/product-detail/en/microchip-technology/PIC16F57-I-SS/PIC16F57-I-SS-ND/61320425 mA source / sink current per IO pin, 150mA in total according to electrical specs, so you could simply connect the matrix directly to io pins and not add money on transistors or mosfets for each row.With 72 bytes of ram you can do a lot ... you can bit bang 8 bytes into it (1 bit per led for 8bits on a row, x 8 because it's 8 rows) and optionally have a 1 byte command which tells the micro what to do (reset, update the matrix with the newly entered data, set brightness level etc)You may need 8 resistors to limit current, but these are dirt cheap...

author: robertbaruch
author_rank: Regular Contributor
timestamp: February 05, 2019, 11:27:11 pm
content: You could use aHoltek HT1632C. They are quite cheap and can do 32x8.

author: danners430
author_rank: Regular Contributor
timestamp: February 05, 2019, 11:29:51 pm
content: Quote from: robertbaruch on February 05, 2019, 11:27:11 pmAye, I mentioned those above - I've done some initial design work with them today, and it looks like that's the way I'll go in an ideal world - lets me easily save a character set as arrays, then I just need to do some basic maths to move them into the correct registers. Just a pain to get hold of it appears, I've only found one place that sells them...Sent from my ONEPLUS A3003 using Tapatalk

author: robertbaruch
author_rank: Regular Contributor
timestamp: February 05, 2019, 11:31:16 pm
content: I get mine from lcsc.com.

author: danners430
author_rank: Regular Contributor
timestamp: February 05, 2019, 11:34:43 pm
content: Quote from: robertbaruch on February 05, 2019, 11:31:16 pmYou sure.....? I can't connect to that website, and a search brings up the International Council of Shopping Centres Sent from my ONEPLUS A3003 using Tapatalk

author: Psi
author_rank: Super Contributor
timestamp: February 06, 2019, 12:08:17 am
content: https://lcsc.comworks for me

author: danners430
author_rank: Regular Contributor
timestamp: February 06, 2019, 12:10:06 am
content: Ooooh... For some reason I put in ICSC, not LCSC...  My bad...Sent from my ONEPLUS A3003 using Tapatalk

author: Rolo
author_rank: Regular Contributor
timestamp: February 06, 2019, 07:16:45 am
content: Those max7219 chips on ebay are like a box of chocolates, you never know what you're gonna get. When used in bigger panels the last thing you want is brightness differences. Lot's of fake arround. An original Maxim > 8 euro at mouser.

author: nick_d
author_rank: Regular Contributor
timestamp: February 07, 2019, 08:23:26 am
content: I like the cheap microcontroller idea. Naively you have an 8x24 display which would require 32 pins in order to light 24 leds at a time with a 1/8 duty cycle. However, I realized you could set up firstly an 8x8 matrix with one of your displays and 16 pins, then reuse this matrix by connecting the other display backwards and making use of tri state so as not to accidentally turn on display 2 while scanning display 1 and vice versa. How to connect the third one I am not sure, I think it would need another 8 pins? Thinking about this I decided to browse the Charlieplexing page on Wikipedia and this caught my eye:QuoteThere is even a citation so maybe read the cited source to get some ideas.cheers, Nick

author: danners430
author_rank: Regular Contributor
timestamp: February 07, 2019, 03:13:30 pm
content: Quote from: nick_d on February 07, 2019, 08:23:26 amI've had a read through it... and I'm not 100% sure how it works, even after having a read through the article and references... I've never really worked out Charlieplexing!!With reference to the HT1632C, are there any decent libraries out there to get it working as expected? I've been struggling to work out how to properly drive it, and I'm tempted to abandon that idea right now xDFailing a decent HT1632C library, I'm thinking I'll fall back on a nice, simple microcontroller... I'm thinking one of two options:1. a Microchip PIC with sufficient pins to drive 8 PNP and 24 NPN transistors, and spare I/O for comms2. a PICAXE (easier to program) only driving the first 23 columns, since I wouldn't need the last column in everyday use, with the spare I/O pin used as an interrupt pin, which prompts the program to scan for a new serial input.I'm not overly worried about data transfers temporarily stopping the matrix from working, since in the use-case I'm using them for (train describers on a model railway control panel) they would spend most of their time off anyway...

author: rhodges
author_rank: Frequent Contributor
timestamp: February 07, 2019, 05:21:47 pm
content: QuoteI think you have given me an idea for my next STM8 library.Thanks for the idea

author: nick_d
author_rank: Regular Contributor
timestamp: February 07, 2019, 10:23:56 pm
content: If you use a micro with the needed 32 pins, the problem goes awaySome tips regarding the 8 PNP and 24 NPN:- Use logic level FETs not bipolar. I did a design for my son using 2N7000s to drive an array of LEDs from my parts box and it worked very well. The reason to use FETs is you need no gate resistor.- You don't need 32 transistors, only 8. Just drive the row outputs by transistor and the others from the PIC or similar output pin, if you use a resistor to set the brightness then you need 24 of those, but you can also use a micro with the appropriate current limiting to save parts (I do not really recommend this approach if the micro is a system controller but it may be appropriate if the micro is doing nothing but LEDs).- You can also try without the 8 FETs, just driving the rows from your PIC. The danger here is brightness can vary depending on if you have say 1 LED turned on in the row vs 24. You may find this effect to be insignificant especially if you use the 24 brightness setting resistors. Or you could configure it for 8 LEDs at a time with 1/24 duty, it's a higher peak current but would not cause brightness variations if your output pins can pull low with 10x the current as they can pull high... I think this was the case with older PICs such as the 12C508.- Since 8 x 2N7000 uses quite a bit of room, it would be a space saving to use an octal buffer in 74AC logic, such as 74AC541 from memory. This would do basically the same thing but in one 20 pin DIP IC package. A cool thing about this is they can latch, so you need only 24 pins in such case. The first 8 pins drive display 1 and occasionally the latch for just long enough to latch the data. The next 16 drive displays 2 and 3.- You can use more or less latches depending on available pins. The easiest way though, is no doubt using a micro with 32 spare pins and sufficient drive capability to not need buffering at all.cheers, Nick

author: danners430
author_rank: Regular Contributor
timestamp: March 12, 2019, 12:20:09 pm
content: Hey guys, just a quick update:I've decided to take the easy route and bought some HT1632C matrix controllers (£14 for 30!) - I'm just gonna use the Arduino libraries from Adafruit, and build my code on top of that - I'll also just use the chips from an Arduino board to keep it simple.Since these matrices are so cheap, I'm also gonna use them for normal LEDs too - watch this space :-)Sent from my ONEPLUS A3003 using Tapatalk