Control several displays from one PCF8574

Status
Not open for further replies.

sixeight

Well-known member
For the production version of my VController project, I would like to use 12 RGB displays. As the PCF chips only have eight addresses I would like to connect three displays to one PCF8574. I would like to know if this idea will work or not.

The idea is inspired by this example:
https://www.hackmeister.dk/2010/08/4-lcd-displays-on-1-arduino/

The code for controlling the displays would be something like this:
Code:
// Set the pins on the I2C chip used for LCD connections:
//                    addr, en,rw,rs,d4,d5,d6,d7,bl,blpol
LiquidCrystal_I2C lcd1(0x27, 5, 5, 4, 0, 1, 2, 3);
LiquidCrystal_I2C lcd2(0x27, 6, 6, 4, 0, 1, 2, 3);
LiquidCrystal_I2C lcd3(0x27, 7, 7, 4, 0, 1, 2, 3);

But I guess I am getting into trouble for omitting the R/W pin. I also want to use the pin that normally is used for backlight to control another display. Or should I be using an MCP23016 instead? AFAIK the LiquidCrystal library is not compatible with that chip.

To control the RGB backlights, I would like to add an WS2811 chip for each display. This will turn the display into a Neopixel LED and that will give me complete control over colour and brightness of the display.

I have worked the idea out in a rough schematic (I have connected just the wires between the displays and the chips)

Is at possible to work this way, or have I forgotten something important?

View attachment Multicoloured display schematic.pdf
 
Well three other ways come to mind (note, I am a software person, so these come from reading data sheets, etc.)

1) On the Teensy 3.1/3.2 there is a second i2c bus on pads 29/30 underneath the Teensy, and on the Teensy LC there is a second i2c bus on pins 22/23 (A8/A9). You would have to rework the Liquid Crystal library to use the i2c_t3 library which gives you access to the second i2c bus, and take an additional argument that is the i2c bus to use. Note, the 2nd i2c needs pull-up resistors like the main i2c bus does.

2) You can use an i2c multiplexer, such as this one that multiplexes up to 8 separate i2c buses: https://www.adafruit.com/products/2717, so you could have 64 displays (you probably will run into various limitations before you get up to 64 displays).

3) You could use the dig-ole displays (soldering the jumper for i2c control), and use the library command to set up each display on a different i2c address. Note, the dig-ole displays have their own programming library: http://www.digole.com/index.php?categoryID=153
 
You could also use pins 18 & 19 for half of the displays and pins 16 & 17 for the other half.

Use Wire.setSDA() and Wire.setSCL() to reassign the signals between those pins. It's pretty much like the multiplexer MichaelMeissner suggested in #2 (also a great way), with only 2 channels instead of 8, but conveniently already built inside Teensy 3.2 & Teensy LC.
 
I just new here but you may be missing something.....the digole supports multiple addresses on I2C...there is a command to set the address...I don't know about the symmetry of the displays but I think you could use a broadcast to all if they are symmetric then you would only need the interrupt lines for the input from the touch screens.

from the header file.....
HTML:
 void setI2CAddress(uint8_t add) {
        writeStr("SI2CA");
        write(add);
        _I2Caddress = add;
    }
See page 25 of the Digole manual "SI2CA" this is save to EEPROM so that on boot it would be that address. I just started playing with the Digole library yesterday and The wheels fell of the bus for me because i want to use SETSPEED FOR OTHER SLOWER modules on the same bus so I use i2c_t3.h in my main program and the compiler whines about what I did to the Digole library:

//#include <Wire.h> //substiuted below for teensy
#include <i2c_t3.h>

The Beta #2 compiler whines about duplicate and conflicting Wire definitions...so I thought I could do the above in the .h file but then I get a bunch of issues with the Digole library construct:
HTML:
#if defined(_Digole_Serial_I2C_)

    void begin(void) {
        _myWire->begin();
    }

    DigoleSerialDisp(TwoWire *s, uint8_t add) //U2C set up
    {
        _myWire = s;
        _I2Caddress = add;
    }
These are as follows:




In file included from C:\Users\1bit\Desktop\AutoSMLSR0dIP131teensy32dig\AutoSMLSR0dIP131teensy32dig.ino:23:0:

C:\Program Files (x86)\Arduino\libraries\DigoleSerial/DigoleSerial.h:69:30: error: expected ')' before '*' token

DigoleSerialDisp(TwoWire *s, uint8_t add) //U2C set up

^

In file included from C:\Users\1bit\Desktop\AutoSMLSR0dIP131teensy32dig\AutoSMLSR0dIP131teensy32dig.ino:23:0:

C:\Program Files (x86)\Arduino\libraries\DigoleSerial/DigoleSerial.h:601:5: error: 'TwoWire' does not name a type

TwoWire *_myWire;

^

In file included from C:\Users\1bit\Desktop\AutoSMLSR0dIP131teensy32dig\AutoSMLSR0dIP131teensy32dig.ino:23:0:

C:\Program Files (x86)\Arduino\libraries\DigoleSerial/DigoleSerial.h: In member function 'void DigoleSerialDisp::begin()':

C:\Program Files (x86)\Arduino\libraries\DigoleSerial/DigoleSerial.h:66:9: error: '_myWire' was not declared in this scope

_myWire->begin();

^


Maybe I should stick to coloring books and stay out of library modifications....... any hints would be greatly appreciated...but all theee other devices are working fine for me and I most appreciate the help I got yesterday....
 
Last edited:
AFAIK you can still use the old wire.h library on Teensy. Only when you use both i2c ports, you need the new i2c_t3 one.

And I have built my own controller pcb boards that support three displays, three RGB neopixel LEDs and four switches from one MCP23017 chip. I also want to control the backlights from ws2811 chips. Still waiting for delivery of boards and components.
 
Thanks to MikeM and Paul. I needed to "spoof" the library....I did make this board..it is for a DUE, and a bunch of breakout boards... but has a TEENSY 3.2 pad set on it. It worked with everything, and a WIZNET5100....I will modify it for the 820 or just use one of the piggyback carriers referenced around here. I think Iam going to port my bioreactor code to a Teensy 3.2 network

View attachment 8753
 
Last edited:
Status
Not open for further replies.
Back
Top