Lacking support for multiple spi devices on the same bus
Posted: Sat Aug 15, 2020 2:58 pm
Important: The platform Im working on is the Doit esp32 devkit v1.
Iv'e come from a c++/Arduino background where if I want to use multiple spi devices on the same bus i just need to manage their slave select pin and use SPI.beginTransaction to set various speeds. However, in micropython there is no such thing as SPI.beginTransaction and I didn't find any custom drivers that ported the Arduino core SPI to micropython. Therefore, Im stuck with using init and deinit to imitate SPI.beginTransaction and SPI.endTransaction and the problem is it doesn't work. the sensors stop working completely.
As for the reason I need such functionality:
I want to power an ili9341 TFT LCD and use both its touch and graphics capabilities and a MAX7219 seven segment display. In arduino I could just assign them the same spi bus(MISO, MOSI, SCK) for example vspi (23,19,18) and manually enable them through their slave select pin. However I dont see it possible with micropython.
Iv'e attached two examples for the max7219 7 segment I've ported from c++ 1 working without imitating SPI.beginTransaction and the other tries to imitate SPI.beginTransaction and doesn't work at all, the seven segment doesn't even light up.
Am I missing something obvious ? or does such a feature not exist in micropython ?
Iv'e come from a c++/Arduino background where if I want to use multiple spi devices on the same bus i just need to manage their slave select pin and use SPI.beginTransaction to set various speeds. However, in micropython there is no such thing as SPI.beginTransaction and I didn't find any custom drivers that ported the Arduino core SPI to micropython. Therefore, Im stuck with using init and deinit to imitate SPI.beginTransaction and SPI.endTransaction and the problem is it doesn't work. the sensors stop working completely.
As for the reason I need such functionality:
I want to power an ili9341 TFT LCD and use both its touch and graphics capabilities and a MAX7219 seven segment display. In arduino I could just assign them the same spi bus(MISO, MOSI, SCK) for example vspi (23,19,18) and manually enable them through their slave select pin. However I dont see it possible with micropython.
Iv'e attached two examples for the max7219 7 segment I've ported from c++ 1 working without imitating SPI.beginTransaction and the other tries to imitate SPI.beginTransaction and doesn't work at all, the seven segment doesn't even light up.
Am I missing something obvious ? or does such a feature not exist in micropython ?