💾 Archived View for gem.librehacker.com › gemlog › tech › 20210630-0.gmi captured on 2022-06-11 at 20:47:27. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2021-11-30)
-=-=-=-=-=-=-
I started a project to control the MCP23S17 GPIO expander chip with FlashForth over SPI. If you need lots of I/O lines in a project, one approach is to attach to a microcontroller that has a lot of GPIO pins. Sometimes however you might have some reason to use a particular MC with less built-in lines, and in this case you can instead use a GPIO expander chip. The MCP23S17 has the following features:
The downside is since it is serial communication, you have to spend some extra cycles just transferring data. But MCP23S17 supports 5 Mhz SPI, and anyway with many GPIO applications you don't need to check or modify the GPIO lines at a super high frequency.
So far, I haven't gotten much further than setting up the repository, writing the SPI initialization code, and setting up some code to control the Chip Select lines. It seemed a likely enough scenario in this case that someone might be using more than one expander chip on a board, so I have to take that into account while writing the code.