Skip to main content
SARTHAK KELAPURE
Associate III
March 22, 2018
Question

Software Serial in STM32

  • March 22, 2018
  • 13 replies
  • 7732 views
Posted on March 22, 2018 at 13:08

Hello everyone,

Just out of curiosity, is it possible to have some feature like Software Serial in STM32 controllers. If yes, how? Are any such libraries available?

    This topic has been closed for replies.

    13 replies

    Tesla DeLorean
    Guru
    March 22, 2018
    Posted on March 22, 2018 at 13:19

    Sure, it's software after all.

    You're looking for bits at a prescribed periodicity, so either you're outputting bits via GPIO, or synchronize to edges and reading GPIO pin.

    Presumes of course that you understand the signalling used by a serial bit stream.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    AvaTar
    Senior III
    March 22, 2018
    Posted on March 22, 2018 at 13:43

    TI even has library modules for that purpose, in source code if I remember correctly.

    For their line of Cortex M controllers, of course, but porting would not be too difficult.

    However, the performance penalty for 'serious' baud rates (>4.8 kBaud) are considerable (and listed in TI's documents).

    SARTHAK KELAPURE
    Associate III
    March 23, 2018
    Posted on March 23, 2018 at 05:07

    Well, that is a great option will try to play with it.

    Found it here, 

    https://github.com/energia/Energia/tree/master/hardware/msp430/libraries/SoftwareSerial

    Andrew Neil
    Super User
    March 22, 2018
    Posted on March 22, 2018 at 16:22

    If yes, how?

    In pretty much the same way as any other processor!

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
    henry.dick
    Associate II
    March 22, 2018
    Posted on March 22, 2018 at 17:15

    '

    If yes, how?'

    basically the same as you would on other MCUs.

    here is an example: 

    https://dannyelectronics.wordpress.com/2018/03/01/uart-for-all/

     

    not difficult to extend it to your STM32.

    LMI2
    Senior III
    March 22, 2018
    Posted on March 22, 2018 at 17:55

    If you are referring to Arduino, there are ways to the get at least some Arduino features in STM32F. But are they needed for UART, perhaps not. Uart works with these CPUs quite well, and you can choose what pin you want to use for serial communication.

    Tesla DeLorean
    Guru
    March 22, 2018
    Posted on March 22, 2018 at 18:00

    It is indicative that those involved in the design need to sit down and seriously review the design choices made and the part selection.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Andrew Neil
    Super User
    March 22, 2018
    Posted on March 22, 2018 at 18:13

    Indeed - choose a part which has sufficient UARTs for your requirements!

    A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.