Connect with us

SPI to UART converter.

Discussion in 'Microcontrollers, Programming and IoT' started by Daphne Silveira, Oct 6, 2017.

Scroll to continue with content
  1. Daphne Silveira

    Daphne Silveira

    Oct 6, 2017
    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.
  2. Harald Kapp

    Harald Kapp Moderator Moderator

    Nov 17, 2011
    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.
  3. pgib8


    Jul 26, 2015
    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.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day