GPIO Extender (PCAL9555APW,118)

Hi,

I am looking at using the PCAL9555APW,118 GPIO extender

Does anyone have any suggestions on any others that may already have a driver written for them?

Thanks,
Brett

I’m using MCP23017 in my project. I was meaning to push the driver to libDaisy. I will work on that soon-ish.

1 Like

@brbrr

Very cool, if you do put this into libDaisy please let me know.

Thanks,
Brett

Just opened the PR: Add MCP23017 I2C driver by brbrr · Pull Request #430 · electro-smith/libDaisy · GitHub

2 Likes

@brbrr,

Thanks for putting the pull request. Will the driver also do interrupt work as well? In my case I’ll have an encoder hooked up and polling may miss the encoder data.

Thanks,
Brett

I haven’t used the interrupt capabilities myself. But I guess it would be relatively easy to add.

FWIW I using 2 MCP23017 chips in my project: 6x8 matrix keyboard + 4 encoders and I am getting consistent results

@brbrr,

Thank you for letting me now - that helps me plan the coding that i’ll need to do. :slight_smile:

Hopefully the pull request will be accepted.

One other question:
What is the correct place to go to understand what drivers are there for what devices today?

Thanks,
Brett

Code!

Here are the libDaisy drivers for external ICs:

I also ported the ILI9341 TFT driver, and from my experience, it is not so hard to do. Especially for something relatively simple.

@brbrr,

Thanks for the info and pointer to the code. :slight_smile:

What I was trying to figure out from that code is:
Where is the LED Driver for the Daisy Field and the driver for the MAX 11300GCM+?

I wanted to start to dive in and look at some of the driver code. Any pointers or thoughts here would be appreciated.

Thanks,
Brett

I would strongly recommend looking through libDaisy code.

There is open PR from MAX11300: Add a driver implementation for the MAX11300 by recursinging · Pull Request #418 · electro-smith/libDaisy · GitHub

@brbrr,

Thank you, i’ll start taking a deeper dive into this code starting this weekend.

Thank you for the help!

@brbrr,

i was wondering your thought on the:
MCP23017 vs MCP23018

I ask only because there is far more stock of the 23018 devices and I wasn’t sure as they don’t look quite protocol compatible.

Any thoughts you have here would be appreciated.

Thanks,
Brett

The key differences are that the MCP23018 adds:

open drain outputs and higher total current sinking capability - 400mA vs 150mA across all ports

higher top speed on the I2C interface - 3.4MHz vs 1.7MHz

tolerance for voltages on input pins to 5.5V (irrespective of Vdd).

The MCP23018 has only 1 address pin, rather than the three on the MCP23017, but still allows up to 8 devices on the bus simultaneously - using voltage (via an external voltage source/divider). I don’t really understand the point of this given it doesn’t use the freed up pins - perhaps to allow a 24pin QFN (vs 28 for the MCP23017 QFN).

Above text from Differences between MCP23017 and MCP23018

@tunagenes,

Thank you for the reference.

And there is one other big plus - it is in stock! :slight_smile:

My only ohter question was: Is it protocol compatible? Because if I need to write a new driver then I was thinking of moving over to the PCAL9555APW,118 because it is smaller… and it looks like plenty are in stock right now.

Thanks,
Brett

I was getting started on my own code for the MCP23017, so good to see someone is a step ahead of me :slight_smile:

Have you run into any hardware issues with the chips? When I moved my prototype from breadboard to a piece of perfboard, the chips stopped working. After a bit of investigation I think it might be a communication issue. Any thoughts are appreciated.

Not really. I spent some time figuring out how to properly use address pins, but aside from that, it was quite straightforward.

To be clear, you had a working setup (both hardware, and software), and once you moved to perfboard, it stopped working? If that’s the case, it might be a connection issue. It might be a good idea to double-check the connectivity and make sure there is nothing shorted.

Hello, wow that sounds interesting… I have a ILI9341 here, but it just doesnt want to show anything. I can make it work with a NodeMCU (Arduino) , but not with the TFT_eSPI library ( curently trying in platformio) . may I ask you to share your code ? and als the pins you used, counting from 1 on the physical Seed. :slight_smile: … Thanks!

Here’s gist (with .hpp and .cpp contants in a same file): daisy_ ILI9341.hpp · GitHub

Also, to address the cache issues, you would need to bump DMA buffer in libdaisy code: libDaisy/system.cpp at master · electro-smith/libDaisy · GitHub (change to MPU_REGION_SIZE_256KB)

1 Like

that was quick! thank you! I will check it out…

may I ask you about the physical pins you used? I can see 11, 5 10 and 16, 22 in your code. But which pins in the pinout are these ? Sorry if my question is stupid… I get a loud tone out of the headphone as sonn as I call init(), even without anything connected, something is not right :slight_smile: