[nRF52] Button/LED support though IOExpander on PCA10040 and PCA10056 boards

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
User avatar
FoldedToad
Posts: 8
Joined: Sat Feb 23, 2019 11:50 pm

[nRF52] Button/LED support though IOExpander on PCA10040 and PCA10056 boards

Post by FoldedToad » Wed Apr 17, 2019 3:57 am

For those using the Nordic nRF52 eval boards for MicroPython development, you might be interested in freeing the GPIO pins consumed by the Buttons/LEDs. This can be accomplished by shorting the pin 5 (SHIELD_DETECT) of the ICSP header to ground.
This shorting will free the Button/LED GPIOs, but result in the lost of direct access to the Buttons/LEDs.

Access to the Buttons/LEDs can be accomplished though the on-board IOExpander (PCAL6408A, U7).
The link below provides a simple template module which shows how to program the IOExpander to preform IO operations as well as pass in interrupts. https://github.com/foldedtoad/more_py_p ... ioexpander

The README.md file has more details

Post Reply