Skip to content
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

Handling multiple SPI units #16

Open
ErikErikErikErikErik opened this issue Nov 19, 2022 · 0 comments
Open

Handling multiple SPI units #16

ErikErikErikErikErik opened this issue Nov 19, 2022 · 0 comments

Comments

@ErikErikErikErikErik
Copy link

I'm currently using two MCP23S17 and an SSD1309 OLED. In detail I'm reading rotary encoders/buttons wired to each of the MCP's, while continuously displaying encoder values on the display. Communicating with any one device works fine, however I get occasional lagging issues with my display. My assumption is that this is caused by not handling the switching of SPI communication between devices properly.

According to https://www.pjrc.com/teensy/td_libs_SPI.html it's my understanding that I need to utilize the SPI.beginTransaction() and SPI.endTransaction() functions in order to switch SPI communication between devices (besides handling the CS pins).

Further, it's also my understanding that this library encapsulates handling of the SPI class within an MCP23S17 class object.

Unless I'm mistaken about the stuff above, I'm wondering if I can handle switching between devices with this library alone, or do I need to address SPI objects directly to deal with communication across multiple devices?

Thanks in advance

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

No branches or pull requests

1 participant