Author Topic: Connecting 8x8 matrices to a 12x16 driver  (Read 2457 times)

0 Members and 1 Guest are viewing this topic.

Offline danners430Topic starter

  • Regular Contributor
  • *
  • Posts: 137
  • Country: gb
  • Good at overcomplication
Connecting 8x8 matrices to a 12x16 driver
« on: February 04, 2019, 06:47:02 pm »
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
 

Offline Rolo

  • Regular Contributor
  • *
  • Posts: 206
  • Country: nl
Re: Connecting 8x8 matrices to a 12x16 driver
« Reply #1 on: February 05, 2019, 05:55:57 am »
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. 
 
The following users thanked this post: danners430

Offline danners430Topic starter

  • Regular Contributor
  • *
  • Posts: 137
  • Country: gb
  • Good at overcomplication
Re: Connecting 8x8 matrices to a 12x16 driver
« Reply #2 on: February 05, 2019, 06:07:43 am »
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.
Hmm, 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

 

Offline rs20

  • Super Contributor
  • ***
  • Posts: 2322
  • Country: au
Re: Connecting 8x8 matrices to a 12x16 driver
« Reply #3 on: February 05, 2019, 06:14:20 am »
If you wanted to drive 6 8x8 displays with 2 IS31FL3733s, 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.)
 
The following users thanked this post: danners430

Offline danners430Topic starter

  • Regular Contributor
  • *
  • Posts: 137
  • Country: gb
  • Good at overcomplication
Re: Connecting 8x8 matrices to a 12x16 driver
« Reply #4 on: February 05, 2019, 06:36:31 am »
If you wanted to drive 6 8x8 displays with 2 IS31FL3733s, 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.)

Dangit... 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 now

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.
Hmm, 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
Well, 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 :-)
« Last Edit: February 05, 2019, 06:38:24 am by danners430 »
 

Online rhodges

  • Frequent Contributor
  • **
  • Posts: 354
  • Country: us
  • Available for embedded projects.
    • My public libraries, code samples, and projects for STM8.
Re: Connecting 8x8 matrices to a 12x16 driver
« Reply #5 on: February 05, 2019, 02:13:54 pm »
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/222263146269

So 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.
Currently developing embedded RISC-V. Recently STM32 and STM8. All are excellent choices. Past includes 6809, Z80, 8086, PIC, MIPS, PNX1302, and some 8748 and 6805. Check out my public code on github. https://github.com/unfrozen
 
The following users thanked this post: danners430

Offline danners430Topic starter

  • Regular Contributor
  • *
  • Posts: 137
  • Country: gb
  • Good at overcomplication
Re: Connecting 8x8 matrices to a 12x16 driver
« Reply #6 on: February 05, 2019, 02:16:47 pm »
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/222263146269

So 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.
They'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

 

Online mariush

  • Super Contributor
  • ***
  • Posts: 5170
  • Country: ro
  • .
Re: Connecting 8x8 matrices to a 12x16 driver
« Reply #7 on: February 05, 2019, 10:34:25 pm »
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/613204
25 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... 
 
The following users thanked this post: danners430

Offline robertbaruch

  • Regular Contributor
  • *
  • Posts: 120
  • Country: us
Re: Connecting 8x8 matrices to a 12x16 driver
« Reply #8 on: February 05, 2019, 11:27:11 pm »
You could use a Holtek HT1632C. They are quite cheap and can do 32x8.
 
The following users thanked this post: danners430

Offline danners430Topic starter

  • Regular Contributor
  • *
  • Posts: 137
  • Country: gb
  • Good at overcomplication
Re: Connecting 8x8 matrices to a 12x16 driver
« Reply #9 on: February 05, 2019, 11:29:51 pm »
You could use a Holtek HT1632C. They are quite cheap and can do 32x8.
Aye, 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

 

Offline robertbaruch

  • Regular Contributor
  • *
  • Posts: 120
  • Country: us
Re: Connecting 8x8 matrices to a 12x16 driver
« Reply #10 on: February 05, 2019, 11:31:16 pm »
I get mine from lcsc.com.
 
The following users thanked this post: danners430

Offline danners430Topic starter

  • Regular Contributor
  • *
  • Posts: 137
  • Country: gb
  • Good at overcomplication
Re: Connecting 8x8 matrices to a 12x16 driver
« Reply #11 on: February 05, 2019, 11:34:43 pm »
I get mine from lcsc.com.
You sure.....? I can't connect to that website, and a search brings up the International Council of Shopping Centres [emoji23]

Sent from my ONEPLUS A3003 using Tapatalk

 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 10384
  • Country: nz
Re: Connecting 8x8 matrices to a 12x16 driver
« Reply #12 on: February 06, 2019, 12:08:17 am »
https://lcsc.com   works for me
Greek letter 'Psi' (not Pounds per Square Inch)
 
The following users thanked this post: danners430

Offline danners430Topic starter

  • Regular Contributor
  • *
  • Posts: 137
  • Country: gb
  • Good at overcomplication
Re: Connecting 8x8 matrices to a 12x16 driver
« Reply #13 on: February 06, 2019, 12:10:06 am »
Ooooh... For some reason I put in ICSC, not LCSC... [emoji1751] My bad...

Sent from my ONEPLUS A3003 using Tapatalk

 

Offline Rolo

  • Regular Contributor
  • *
  • Posts: 206
  • Country: nl
Re: Connecting 8x8 matrices to a 12x16 driver
« Reply #14 on: February 06, 2019, 07:16:45 am »
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.
 
The following users thanked this post: danners430

Offline nick_d

  • Regular Contributor
  • *
  • Posts: 120
Re: Connecting 8x8 matrices to a 12x16 driver
« Reply #15 on: February 07, 2019, 08:23:26 am »
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:
Quote
A balance between complexity and pin use can be achieved by Charlieplexing several pre-built multiplexed LED arrays together.[7]
There is even a citation so maybe read the cited source to get some ideas.
cheers, Nick
 

Offline danners430Topic starter

  • Regular Contributor
  • *
  • Posts: 137
  • Country: gb
  • Good at overcomplication
Re: Connecting 8x8 matrices to a 12x16 driver
« Reply #16 on: February 07, 2019, 03:13:30 pm »
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:
Quote
A balance between complexity and pin use can be achieved by Charlieplexing several pre-built multiplexed LED arrays together.[7]
There is even a citation so maybe read the cited source to get some ideas.
cheers, Nick

I'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 xD

Failing 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 comms
2. a PICAXE (easier to program :D ) 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...
 

Online rhodges

  • Frequent Contributor
  • **
  • Posts: 354
  • Country: us
  • Available for embedded projects.
    • My public libraries, code samples, and projects for STM8.
Re: Connecting 8x8 matrices to a 12x16 driver
« Reply #17 on: February 07, 2019, 05:21:47 pm »
Quote
With reference to the HT1632C, are there any decent libraries out there to get it working as expected?
:)
I think you have given me an idea for my next STM8 library.

Thanks for the idea :)
Currently developing embedded RISC-V. Recently STM32 and STM8. All are excellent choices. Past includes 6809, Z80, 8086, PIC, MIPS, PNX1302, and some 8748 and 6805. Check out my public code on github. https://github.com/unfrozen
 

Offline nick_d

  • Regular Contributor
  • *
  • Posts: 120
Re: Connecting 8x8 matrices to a 12x16 driver
« Reply #18 on: February 07, 2019, 10:23:56 pm »
If you use a micro with the needed 32 pins, the problem goes away :) Some 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
 

Offline danners430Topic starter

  • Regular Contributor
  • *
  • Posts: 137
  • Country: gb
  • Good at overcomplication
Re: Connecting 8x8 matrices to a 12x16 driver
« Reply #19 on: March 12, 2019, 12:20:09 pm »
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

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf