but I'm aware that I can only have two of these running at once due to the fact that they only have two address options (selectable by moving the 0 ohm resistor on the back of them). So I'm now wondering if i can demultiplex the signal from the scl and sda pins using this module: -
alternatively I'm wondering if using SPI OLED's (as opposed to I2C) would allow me to connect more without the need for a multiplexer module but at the expense of extra digital pins. Is this how it works?
Use the address line as if it were a chip select line.
Bring each display's address line to a unique pin on the Mega, and drive them high.
Then take one line low, talk to the display using the Address Line = 0 address. Take the line back high when done.
Repeat for the other displays, talking to one at a time.
okay so I have a few options. I think I'll give the multiplexer option a go first as I already have a few I2C OLED modules. many thanks for your help guys
I'm a little confused by crossroad's response if im honest. There are only 4 pins on each OLED module... 5v, ground, SDA and SCL.
Bring each display’s address line to a unique pin on the Mega<
does this mean connect each of the SDA pins to unique pins on the MEGA? I thought the SDA line was for data... not address.
and drive them high.
Then take one line low, talk to the display using the Address Line = 0 address. Take the line back high when done.<
If I write the SDA pin LOW surely then it would then jump between HIGH and LOW again as soon as I start sending data along it. I'm assuming the data is a digital signal so as soon as it jumps HIGH the address won't be LOW anymore so the data transfer will stop.
At the back of your OLED pcb there is a solder-bridge or 0R that selects the Slave Address.
You will connect a GPIO wire instead. i.e. to alter Slave Address under program control.
Life is always a compromise. Soldering a tiny wire to the pcb is a bit fiddly. (and unsafe)
Buying a TCA9548 board costs time and money. But all your wiring is done with robust header pins and Dupont cables.
Since you were considering SPI displays, you understand the concept of a Chip-Select signal.
Ah right... Yes I'm familiar with using a chip-select signal. I was just confused by the fact that I couldn't see a C/S pin on the module but it makes sense now. Thank you everybody for your help.
very much appreciated
Be careful soldering. We tried to do similar on a breakout board we got from Sparkfun, the pads were really sensitive, easy to overheat and come off the board.
Thanks for the heads up. I will bear that in mind if I decide to go for the chip select/ address pad method. I'm going to try the MUX method first tho as i'd rather not have dupont wires hanging off the back of my OLED's. I'm planning to photo etch a pcb for this job so adding a MUX into the layout will not be that much extra work and will ensure a good secure finish.