Is it possible to chain multiple MicroDot PHATs?

Hi, wondered if it were possible to control multiple MicroDot PHATs. Clearly one would need to run jumpers from the Pi to the PHATs. Are the three fixed I2C addresses on the driver IC the roadblock in this case?

Unfortunately, they’re set by an ADDR line that is tied direct to one of the pins on the driver chip, so there’s no way to change them without a scalpel and some veeeery small wires. Plus, there’s only one additional address that could be used, so the most you would get out would be an additional two display on the second Micro Dot pHAT.

Interestingly, @CannonFodder is attempting a workaround for this using i2c multiplexers. I’ll try and summon him!

makes ooooohmmming noises

Funny the buzzing sound stopped, when I starting this reply. I think and hope it will be possible to chain multiple MicroDot displays, I planning to use an i2c multiplexer, and a custom PCB to carry the displays. Hoping to breadboard it soon. I have found and debugged a python library for controlling the i2c multiplexer chip, I need to look at modifing the MicroDot library to allow for multiple displays. I will post details here over the weekend.

This project is currently a side project to developing my Pi Wars robot, for when I’m fed up with driver broads, motors and sensors!

Brian

Ooh, exciting! Thanks gadgetoid, CFodder!

I love these little guys so much, and have look at the IS31FL3730 and LTP-305s and wondered how difficult (quite, I expect!) it would be to build a board with ore than three IS31FL3730s and therefore more LTP-305s… but the multiplexer sounds awesome, looking forward to hearing more.

Being new to these things, I wondered if there are there other drivers out there that would drive more than the (cleverly worked) 2 per chip? What would one even have to know to look for to find suitable driver chip for this or similiar 5x7 matrices? Any knowledge you could pass on regaring these kind of drivers would be gratefully recieved. I know the IS31FL3730s big brother the IS31FL3731 drives the adafruit 9x16 Charlieplexed boad, but is that good only for 9x16 setups?

Any links to learning resources for LED Matrix drivers would be great too, thanks!

Oh, and CannonFodder - forget the robot, make love(ly matrix display multiplexers) not war!

A LED matrix driver is, at heart, nothing more complicated than asserting the right pins either HIGH or LOW to light the desired LEDs. Here’s the LTP-305G pinout:

Pins labelled CX are Columns, and pins labelled RX are rows. Columns need a supply of current, and rows need to be connected to ground.

Generally you only ever turn on one column at any one time, and pull down the right combination of rows to light that specific column. If you wanted to light the top left most pixel then you’d ground R1 and supply power to C1. You’d do this for a fraction of a second, then move on to the right permutation for the next column, and so on.

This is called scanning, or multiplexing.

To multiplex a series of LTP-305G pixels you need:

  • something that can sink up to 7 pins to ground. A darlington array is great for this- it takes a HIGH input signal, boosts it through a transistor pair, and pulls its output pins down to a common ground.

  • something that can supply power to the 5 columns, plus the 1 decimal place. This would have to be a chip capable of sourcing ~5-10mA * 7 rows per pin (45-70mA) - or less depending on how bright you want it to be.

So to drive a series of LTP-305Gs you need 12 pins, +5 pins for each additional matrix.

10 matrices would need 57 pins. Or 7 daisy-chained shift registers, plus a separate one driving a darlington array.

You would only ever have to light ONE column at a time, so you could set a 1 on your shift registers first bit and just toggle the shift register clock so that bit falls down the chain, lighting one column at a time. At each toggle of the shift register clock, you would shift out 8 bits to the other register to govern which rows should be turned on.

The wiring for all this would be an absolute haystack, so I’d recommend trying just a couple first :D

This setup also means you’re using just over half an 8bit shift register for each matrix. Not very chip efficient ;D

Just a visual example of @gadgetoid 's post, a hand-soldered 8x16 LED matrix. Using shift-registers to pull an LED in each column high and transistors connect individual rows to ground. Then multiplexing each row to give the impression they’re all turned on.


2 Likes

Guys, sorry for the late reply, thank you very much!

I mostly follow you gadgetoid, except for in a couple of places. I’ve heard of the darlington array, mostly in connection with motor drivers…

What is the difference between this method and using a common ground from the Arduino ground pins?

And re: the shift register chips - looking at the data sheet for the SN74HC595-EP - http://www.ti.com/lit/ds/scls719/scls719.pdf

In the entry under FEATURES we have:

±6-mA Output Drive at 5 V

from that, I’m presuming this is not a suitable chip? but then in the ABSOLUTE MAXIMUM RATINGS we have:

VCC Supply voltage range −0.5 V to 7 V
IIK Input clamp current(2) VI < 0 or VI > VCC ±20 mA
IOK Output clamp current (2) VO < 0 or VO > VCC ±20 mA
IO Continuous output current VO = 0 to VCC ±35 mA
Continuous current through VCC or GND ±70 mA

I just don’t know enough to really know where to look!

Can you recommend a suitable chip?

And major_tomm - that looks super neat and awesome - although there is a heck of a lot of work there, the control end doesn’t seem TOO much of a nightmare!

Could you post a schematic? That would be a great help in understanding what goes where.

I’d really like to start small, using just a couple of the arrays to start, and go from there,… and although I understand in theory what is needed don’t quite know where to start in practice.

I’ve played around with the 74HC595 and 4511 with 7-segment displays, I think I should go back to that and really work through some tutorials so I get a much better understanding of shift registers, but a simple schematic and recommended parts list for a simple set-up with just a couple or three of the LTP-305Gs that would get me really going.

I hope you don’t think I’m asking for you to do my work for me, but at this stage, my knowledge is such that a bit more hand-holding would be greatly appreciated!

Many thanks again for your advice.

I’ll see what I can put together in Fritzing, I’ve been meaning to write that particular project up!

1 Like

finally got round to pulling my code for running the TCA9548A I2C Multiplexer available form the shop.

if multiplex.py is executed, channel 2 is selected.

#!/usr/bin/python

import smbus

class multiplex:

def __init__(self, bus):
    self.bus = smbus.SMBus(bus)

def channel(self, address=0x70,channel=0):  # values 0-3 indictae the channel, anything else (eg -1) turns off all channels
    
    if   (channel==0): action = 0x01
    elif (channel==1): action = 0x02
    elif (channel==2): action = 0x04
    elif (channel==3): action = 0x08
    else : action = 0x00

    self.bus.write_byte_data(address,0x04,action)  #0x04 is the register for switching channels 

if __name__ == '__main__':

bus=1       # 0 for rev1 boards etc.
address=0x70

plexer = multiplex(bus)
plexer.channel(address,2)

print "Now run i2cdetect"

the following is an example of how to use multiplex.

import multiplex

# setup multiplex object using i2c bus 1

i2c = multiplex.multiplex(1)

# clear and then select the required channel on the multiplex

i2c.channel(0x70,-1)

i2c.channel(0x70,2)

hope that helps

Brian

1 Like

Again, sorry for delayed response.

I’ve had good success with the TCA9548A I2C Multiplexer on the Arduino - haven’t tried with the Pi yet - TBH, although I started learning about MCUs etc with the PI, and am learning Python, I’m currently more comfortable with the Arduino, the IDE and C, C++ (also studying C, C++)

So, thanks for that start - a good one I think.

Will report back with porgress…

I finally got around to tackling my Fritzing diagram and its a bit of a beast, hope it’s useful to someone.

And some more smart photos of the matrix.

1 Like

Amazing work!! :-) :-)

1 Like

This makes me want to revive my LED cube, or try to build a new one that’s not half crushed and neglected :(

1 Like

That’s the problem with my matrix, it’s been to so many talks and show ‘n’ tells with me over the last 5 years, it’s a bit worse for wear.