Any way to temporarily change SPI frequency without re-initialization of interface? #15596
-
Hi there, background: I am communicating to I2C devices with a maximum clock frequency of 400kHz by tunneling commands through an isoSPI-connection (RP2040 to LTC6820 to ADBMS1818) with is typically clocked at 1MHz. The execution of I2C communication through isoSPI commands effectively uses half the SPI clock (=500kHz), bit it's still high than the 400kHz specified in the datasheet of one I2C device. I wonder if a temporary frequency reduction is possible in micropython? I do initialize the SPI outside of the class which uses a reference to it and it would be great to keep in that way :-) Of course, one could reduce the isoSPI frequency to 800kHz in general to stay within the specs... but I was wondering if somebody knows any "special" or "hidden" method, which could achieve this? Searched the interwebs for a while now... Thank you in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
One you have created an SPI instance, like spi=machine.SPI(.......), you can change the baudrate with spi.init(baudrate=nnn) without changing other properties of the SPI object. |
Beta Was this translation helpful? Give feedback.
One you have created an SPI instance, like spi=machine.SPI(.......), you can change the baudrate with spi.init(baudrate=nnn) without changing other properties of the SPI object.