2023-02-01 01:29 AM
I'm using a STM32L152C-Discovery and a USB-RS232 adapter to receive data via UART protocol from the board. The system clock is 32 MHz and I'm using a baud rate of 115200 and no parity check. To view the messages on the PC, I use Putty configured consistently with the transmission parameters. When I try to send data via HAL_UART_Transmit the serial monitor shows completely different data. In the case of repeted "Hello world" message I get the following result:
I also thought about low precision clock problems, if this were the case, how can I verify the correctness with the oscilloscope?
2023-02-01 09:08 AM
RS232 has different levels, and inverts, so data will often look as shown, ie patterns consistent, size/form, but wrong characters.
The UART outputs CMOS levels, not RS232
2023-02-09 03:04 AM
example:sprintf("Hello\n\r");
2023-02-15 12:32 AM
Hi @MZarb.1
Does your configuration have Parity enabled ?
If so, could you provide :
in terms of wordlength, stop bits, parity ?
Please note that in case of enabled parity, parity bit is included in word length on STM32 side, which is not the case on Putty config side.
Regards