2021-07-01 02:35 AM
Hi! Does anyone know if HAL_UART_Transmit() sends ASCII or binary? I've tried to send some data a serial plotter but nothing is being plotted. The format of the data sent follows the setting in STM32CubeMx. (It works on Arduino serial plotter)
Serial plotter that I used: https://hackaday.io/project/5334-serialplot-realtime-plotting-software
2021-07-01 03:11 AM
Hello @M7890.1,
Which MCU you use ?
You can try the USART example in the firmware of the product you use.
Mohamed Aymen.
2021-07-01 05:39 AM
I'm using STN32F103CBT6. Changing UART to USART doesn't solve the problem.
2021-07-01 06:01 AM
HAL_UART_Transmit() sends bytes what you put in there. ASCII is a subset of 8 bit binary data.
2021-07-01 06:05 AM
Exactly, it sends whatever is in the buffer
If you need ASCII numbers send "255," not 255 as a byte
2021-07-01 08:40 AM
Arduino has libraries for everything, which spoils people, but ST users should also be spoiled that way.
Arduino serial output is so oversimplified, it ends up being confusing, Uart outputs only byte or bytes, (one or more of 0-255s), and its receivers job to make sense of it.
2021-07-01 08:56 AM
HAL_UART_Transmit()
transmits the "binary", well.... everything transmitts binary its the receiving side the one that interprets the data as ascii.
@M7890.1 Try this: https://realterm.updatestar.com/en
This serial console PC programm allows you to read/send raw binary data and also the ascii interpretation, its pretty handy for debugging.
arduino serial.print("a"); will send one byte represented in binary as 0x61.
your arduino PC console would read that 0x61 and translate it back to "a".
if you want to send raw bytes with arduino try serial.write();
2021-07-01 09:03 AM
arduino is a tool created to be simple and easy to use for beginers.
people sometimes shouldnt bother to know...
2021-07-01 09:57 AM
I learned binary data representations, including floating point, in secondary school, forty years ago. Current education is complete s**t..
2021-07-12 05:19 AM
I am using Atollic TrueSTUDIO as my IDE and only use the Arduino serial plotter for plotting the graph. Any other suggestion?