Maker Pro
Maker Pro

SPI to UART converter.

Daphne Silveira

Oct 6, 2017
1
Joined
Oct 6, 2017
Messages
1
Goal: convert SPI pins to be used as UART.

Ouestion1: In my understanding, the chip select and SCLK pin is the only diff between SPI and UART. So if I don't use CS and SCLK, can I use MOSI and MISO as TX and RX?

Ouestion2: What does an SPI to UART converter do. Why is there a need for an extra ic to accomplish this job. Does the IC max3107 do the same task?

Question3: Can I use the SPI pins as UART by writing additional software code.
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,725
Joined
Nov 17, 2011
Messages
13,725
You cannot convert SPI directly to a UART protocol as the protocols are rather different. SPI is a synchronous protocol, using a clock to transfer data. UART is, as the name implies, an asynchronous protocol without clock signal.

You can, however, use SPI to control a SPI based UART chip, e.g. one like this.

Or you can use a soft-UART library which handles all the necessary signals and timing in software.
 

pgib8

Jul 26, 2015
107
Joined
Jul 26, 2015
Messages
107
you can bit-bang a uart port yourself and for that you can use any pins you want. the rx pin however ideally will have interrupt capabilities (but also not necessary). it will be more work to do but if you gotta do it you gotta do it.
this is not like a hardware uart port that you can just write and read bytes from/to, you'll have to do everything manually and work out proper timing.
 
Top