Page 1 of 1

SPI or I2C communication in Python using RevPi MIO

Posted: 11 Oct 2022, 06:44
by Makoto G
I bought RevPi Connect S and RevPi MIO.

I would like to connect multiple digital potentiometers to the RevPi MIO's digital or analog I/Os and control them via SPI or I2C communication.
I'm a beginner, so I don't know how to send clocks and data synchronously from multiple outputs.
Could you tell me any libraries or sample programs that I can refer to?

Thanks in advance.
Makoto

Re: SPI or I2C communication in Python using RevPi MIO

Posted: 11 Oct 2022, 09:47
by nicolaiB
Hi Makoto,

the extension modules cannot be controlled via SPI/I2C. They communicate with the base module (Core or Connect) via our Backplane-Bus called PiBridge. I can recommend the Python library revpimodio2 for interacting with the process image.

-Nicolai

Re: SPI or I2C communication in Python using RevPi MIO

Posted: 11 Oct 2022, 15:31
by Makoto G
Thank you for your reply Nicolai,

I'm not good at English, so I apologize if there is any misunderstanding.
I plan to connect two RevPi MIOs to the RevPi Connect S via PiBridge.
And I want to control potentiometer ICs using digital or analog I / Os of RevPi MIO.

The communication standard of this potentiometer IC is SPI or I2C.
Therefore, to control these ICs, it is necessary to output synchronized 16-bit commands and reference clock (100 kHz) from each output of RevPi MIO.
Is it possible to control such input and output using the Python library revpimodio2 you introduced?

Thanks in advance.
Makoto

Re: SPI or I2C communication in Python using RevPi MIO

Posted: 12 Oct 2022, 16:18
by nicolaiB
Hi Makoto,

your English ist more than okay, so no worries.

Nevertheless the use-case you're planning is not possible with the MIO or another extension module. The only option which might work is a custom Con extension module on the RevPi Connect (right side - con bridge). The con bridge exposes native GPIOs which can be used for SPI or I2c.

Nicolai