Hello everyone. I'm having a problem with serial data transmission.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-02-01 1: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?
- Labels:
-
STM32L1 Series
-
UART-USART
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-02-01 1:31 AM
The onboard debugger (STLink) includes the UART to USB bridge function.
Check the board schematics,
You will need to program the right USART and from USB PC side, set the baudrate correctly on your teraterm-like application.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-02-01 1:33 AM
I need it to work in this mode and I'm trying to track down the problem. In the other case it definitely works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-02-01 1:36 AM
If you want to find the rootcause within 30 minutes, use an oscilloscope on TX Pin of the MCU.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-02-01 1:39 AM
>>Putty configured consistently with the transmission parameters
Probably not, which USB-RS232 are you using?
As @S.Ma​ said, just use the UART connected to the stlink, you dont need to connect anything extra.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-02-01 1:40 AM
in fact, I had asked how can I verify this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-02-01 1:45 AM
yes, putty is set correctly. I'm using the following:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-02-01 6:04 AM
I checked, my board doesn't have UART to USB bridge function.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-02-01 8:01 AM
The converter on the photo above uses RS232 levels. You need to use USB-UART "TTL" type converter with 3.3 Volt output, not USB to RS232.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-02-01 8:36 AM
Check out some boards which are UART CMOS to USB, there was FTDI based kit (and clones), many available on the web. The cable above probably expect a MAX232 voltage shifter...
IMHO I would go directly to HC-05 Serial to Bluetooth Adapter... no wires, no drivers, isolated.
