cancel
Showing results for 
Search instead for 
Did you mean: 

STM32f4 and RS232 protocol

BMoha.3
Associate II

hello everyone, i am using stm32f407 discovery board and i would receive data from a device (load cell amplifier) which communicates via RS232. So my question is : can i use a simple USART in my stm32f4 to receive data ? or i need to use ( RS232 --> UART) converter between the device and my stm32f4 ?

1 ACCEPTED SOLUTION

Accepted Solutions
SofLit
ST Employee

Dear @BMoha.3​ 

You need an RS232 transceiver to add to STM32F4 if your device (load cell amplifier) has levels of RS232 :

Signal Voltage levels State

-3 to -25v --> 1

+3 to +25v --> 0

And you can use UARTx or USARTx peripheral.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

View solution in original post

7 REPLIES 7
SofLit
ST Employee

Dear @BMoha.3​ 

You need an RS232 transceiver to add to STM32F4 if your device (load cell amplifier) has levels of RS232 :

Signal Voltage levels State

-3 to -25v --> 1

+3 to +25v --> 0

And you can use UARTx or USARTx peripheral.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Thank you @Community member​ for your response,

so what i clearly understand that i have to use a ( RS232 --> UART) converter like MAX3232 between my device and the stm32, am i right ?

SofLit
ST Employee

Yes, you need a transceiver like MAX3232 for STM32F4 if your device from the other side follow RS232 levels.

For example, if you need to connect STM32F4 to a PC via RS232, you have to add RS232 transceiver to adapt voltage levels.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Yes, you can also find equivalent devices on the RS-232 selector website, where you can select a suitable device for your needs (number of RX, TX, Speed, Supply).

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Thank you so much for the help @Community member​, so i will use a RS232 transceiver (MAX3232) to read data from my device. After connection of :

RX_stm32 --> TX_MAX3232

TX_stm32 --> RX_MAX3232

now should i use a normal UASRT configuration to read the data or configure the USART of the stm32 used with the Hardware flow control RS232 option ?

this a picture of the RS232 pins of my device :0693W00000Hr7diQAB.jpg

@BMoha.3​ ,

As I already said, you can use UART or USART for RS232 communication.

USART can be used also for synchrounus communication but you don't need this feature as per the picture you shared.

You can refer to any of the examples provided in STM32CubeF4 under the path:

\Projects\STM324xG_EVAL\Examples\UART

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
S.Ma
Principal

Don't bother, use HC-05 uart to bluetooth serial 4 pin dongle for few dollars. For mobile phone, you can have fun with android Bluetooth Electronics which use your phone as a remote touch screen!