The Raspberry Pi Pico is a great little microcontroller and it comes with 26 GPIO ports, but sometimes that’s just not enough.
Or even if it is sometimes you may want to the GPIO ports located differently, perhaps run on a different voltage or perhaps have more power for each pin. One solution to these issues is to use one or more MCP23008 GPIO expanders.
Technically the MCP23008 ic known as a 8-Bit I/O Expander with Serial Interface, but I’ll stick with GPIO expander for this video.
In this video I’ll give an example of how you can use these with a Raspberry Pi Pico and how to get started with some simple micropython code.
For more information see: https://www.penguintutor.com/electron...
Related videos / more information:
Model railway capacitor discharge unit • Designing a model railway point contr...
Dual OLED display on single SPI bus • Raspberry Pi Pico with 2 x SPI SSD130...
Introduction to I2C • I2C - Raspberry Pi, Pico and an Arduino
MOSFET voltage level shifter • MOSFET logic-level shift circuit - Co...
Power to the Pico • Power for the Raspberry Pi Pico - Gui...
Chapters:
00:00 Introduction
01:29 Model railway point controller
02:52 MCP23008 GPIO expander
04:16 I2C address wiring
05:31 Problems with 3.3V I2C
07:15 Schematic diagram
08:35 Programming with MicroPython
09:23 Summary
Errata: In the video I state that GP7 is to be used for output only. This was based on a datasheet by Microchip dated 2004-2022. After further research there appear to be many other datasheets from Microchip with different dates that do not include that statement either in the description or table 1.1. It is possible that this only applies to certain versions of the MCP23008, or that it was an error in the earlier datasheet. Using a recent IC should not have any problems using GP7 as an input or an output.