2018-01-10 12:56 PM
Hello,
I've just built the UART sample code for the 722ze Nucleo board and have a problem. I have not modified the code (except for the transmitted character buffer). The sample code shows setting up the unit for a 9600 N81 format. The character buffer that is transmitted is 153 characters long. When I transmit from the Nucleo I receive the correct number of characters on the RealTerm serial capture program but it's gibberish. None of the ASCII characters are discernable and I can't make heads or tails of how the bits might be shifted... For example, I am sending '12345' which in hex is 0x31 0x32 0x33 0x34 0x35 and I receive 0xEB 0x9B 0x99 0x97 0x95.
Has anyone seen anything like this?
2018-01-10 01:33 PM
Over the VCP, or RS232?
RS232 is at different levels and inverted wrt CMOS levels from STM32 USART
Make sure PLL and HSE_VALUE reflect the 8 MHz clock, not 25 MHz
If in doubt output 'U' (0x55) in a stream, and scope the signals.
2018-01-10 01:37 PM
maybe you have a grounding problem, did you check the baud rate on the scope ?
same number of chars ? maybe you are not reading the correct buffer ?
2018-01-10 04:14 PM
You wont be getting inverted data because the start bit is randomly being set within the data bit stream, lucky to receive the correct number of bytes.
but I think that inside the STM processor, some parts will be evaporating as we speak..
best not to connect it directly like that.
did you try to invert the data input pin ? it is a function of this usart. not sure how to use it, but your data will look right for a minute or two.
The processor will not last long, or maybe only the serial receive port will become disconnected internally.
2018-01-10 04:37 PM
Ahh... That might be the issue. I've attached the RS232 serial TX & RX directly to the PC6 and PC7 I think. So I need a serial driver chip between PC6&7 I assume?
2018-01-10 04:38 PM
,
,
Thanks. , I'm getting the correct ♯ of characters. , ,I think I need a serial driver chip between the GPIO pins and the RS232 pins I guess.
2018-01-10 04:58 PM
MAX3232 type chip, lots of translation boards on eBay, if you need to get to RS232 levels
2018-12-12 07:50 AM
Hi,
I have the same issue.
Is there a way to do this "voltage conversion" in software using UART hal driver?
Thanks
2018-12-12 09:12 AM
It is an electronics/signals issue, it can't be fudged in software.
RS232 signal levels have clearly defined expectations, the STM32 pin interface doesn't meet those.
2018-12-12 09:22 AM
I understand.
We nee to have serial console.
It means that there is no option for a serial console using nucleo board, unless we use a signal converted chip . Thanks,