openMV RT1062 is it possible to use the SPI pins for UART?

Hello,

I am working on a project where I have some sensors that connect via i2c using pins P4 for SCL and P5 for SDA. But I also need a UART bus line to connect to another microcontroller, and wanted to use the pins P0 and P1 for that, since I am not planning on using SPI because the protocol does not have DMA. I started looking at the machine.UART documentation [link] (class UART – duplex serial communication bus — MicroPython 1.22 documentation) and saw that function UART.init() has some keyword-only arguments that supposedly lets you define the TX and RX pins. I tried this but did work for me. I also started digging into the firmware and pin mapping to micropython but wanted to know if anyone else has done this before and could point me to the correct direction.

Thank you !
-Tomas

I’d switch the I2C to soft I2C: class I2C – a two-wire serial protocol — MicroPython 1.22 documentation (openmv.io)

And then you can use the UART like normal.

There’s no soft UART as this requires specific timing. You could technically bit-bang slow UART data. But RX will be very hard unless you create an interrupt-based sampling algorithm. It’s all doable in Python, though.

E.g. Yes, you can write a UART in python for TX easily and use a timer event to handle RX data. Baud rates for RX though would be very low.