cancel
Showing results for 
Search instead for 
Did you mean: 

Software Serial in STM32

SARTHAK KELAPURE
Associate II
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?

13 REPLIES 13
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 Up vote any posts that you find helpful, it shows what's working..
AvaTar
Lead
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).

Andrew Neil
Evangelist
Posted on March 22, 2018 at 16:22

If yes, how?

In pretty much the same way as any other processor!

henry.dick
Senior II
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
Lead
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.

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 Up vote any posts that you find helpful, it shows what's working..
Posted on March 22, 2018 at 18:13

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

Posted on March 22, 2018 at 19:30

That, and frankly at better grasp of the requirements that got you there. You're already at the end of a decision tree where you've burned all the lifeboats, and all you have left is an assortment of bad outcomes.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..