Skip to content

Handling multiple SPI units #16

@ErikErikErikErikErik

Description

@ErikErikErikErikErik

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions