2018-07-12 07:59 AM
Posted on July 12, 2018 at 16:59
Hello,
I have a pb with UART1 for L152RE board. I connected a sensor to my board in UART2 through a Max232 and i succeed to have information to my hyperterminal (TerraTerm). But i was not able to have information in the variable (or buffer) in my code. I was told that UART2 can not do that, so i was adviced to use UART1.
So i did it with UART1 but i'm not able to get data neither through hyperterminal nor in the variable in my code.
To parametrize the code, i use CubeMX and i changed the main.c. Do i have to change something else?
Find attached my code.
Thank you for your help.
2018-07-12 09:38 AM
PA2/PA3 USART2 on the NUCLEO-64 should be connected to the VCP, and you should be able to open the COM port in a PC based terminal application.
PA9/PA10 USART1 should be available to connect an RS232 based sensor, via a MAX3232 type level translator.
May be you should echo the data received on USART1 out to USART2
Use volatile variables appropriately.
I'd probably start with a simple polling and forwarding loop to copy characters from USART1 RX side to USART2 TX, and display on a PC terminal. Use the same baud rates and have code to clear overrun, noise or framing errors from the USARTs.