Skip to content

Add enableAddrPins() for MCP23X08 #88

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 12, 2022

Conversation

alexmaurer-madis
Copy link
Contributor

MCP23S08 hardware address pins A1 and A0 are not enabled by default on chip reset.
(See Microchip datasheet page 14)

This pull request add the following function to the class Adafruit_MCP23X08
void enableAddrPins();

Otherwise the library does not work with HW address pins on MCP23S08.

README.md is modified accordingly.

@ryanrsrs
Copy link

Oh wow, this solves the problem I have spent all day debugging.

Thanks!

@alexmaurer-madis
Copy link
Contributor Author

Oh wow, this solves the problem I have spent all day debugging.

Thanks!

I'm glad it helped you !

@caternuson
Copy link
Contributor

Thanks for finding this. Looks like SPI HW address support was added for MCP23S17 here:
#78
but the MCP23S08 was left out.

Agree this is needed for the MCP23S08 despite what current README says:
image

Do you know if the same errata mentioned in that pull request discussion for the MCP23S17 also applies to the MCP23S08? See Adafruit_MCP23X17::enableAddrPins() for ref.

Also, looks like the CI test are failing on clang formatting. Here's how to fix:
https://learn.adafruit.com/the-well-automated-arduino-library/formatting-with-clang-format

@ryanrsrs
Copy link

ryanrsrs commented Dec 12, 2022

I do not believe that errata affects the MCP23S08. The A2 pin is not present on the MCP23S08. Also, Microchip has not published an errata for the MCP23S08, so the optimistic conclusion is that it doesn't have that bug.

Alexandre's pull request (with single write, so no errata workaround) works perfectly on my project with 2x MCP23S08 sharing CS. One is at addr 0, the other at addr 1.

My chips are marked 2216H9K so they should be the latest silicon.

@caternuson
Copy link
Contributor

Cool - thanks for testing and verifying on another setup.

In addition to running clang-format, please also remove the changes to the library.properties file. That'll be dealt with during release.

@alexmaurer-madis
Copy link
Contributor Author

all done !

@caternuson
Copy link
Contributor

Thanks. Looks like library.properties is still showing a diff. But we can deal with that directly after merging. Might just keep it anyway, since that seems like next logical ver.

@caternuson caternuson merged commit 40df8ff into adafruit:master Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants