Controlling GPIO with MCP23S18 over SPI #325
Replies: 3 comments
-
@taartspi created serveral examples with MCP-ICs, maybe you can find a starting point there? |
Beta Was this translation helpful? Give feedback.
-
In those examples I think the mcp23017 is the one to look at. Compare the data sheets to see if they are the same registers for control and just that yours handles more current. You also asked about SPI. Looking at your datasheet I think you need to handle the CS (chip se;ect) in your code. Allowing the SPI to do that the write/read combination will likely fail. See BME280 spi https://github.com/taartspi/pi4j-example-devices/blob/master/src/main/java/com/pi4j/devices/bme280/BME280DeviceSPI.java |
Beta Was this translation helpful? Give feedback.
-
Thank you very much. I will try to use these examples as a starting point. |
Beta Was this translation helpful? Give feedback.
-
Hi, could anyone push me in the right direction how to start with a GPIO Controller for the MCP23S18 controlled over SPI. So i need to add DigitalInputProvider, DigitalOutputProvider and SPiProvider? How does it works that i can control outputs, register inputs for change events and the communication to the chip is done over SPI? Thank you very much for your support. So far i added the following dependencies to my project. pi4j-core-2.4.0, pi4j-plugin-raspberrypi-2.4.0 and pi4j-plugin-pigpio-2.4.0. Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions