cancel
Showing results for 
Search instead for 
Did you mean: 

UART sending some else data and not as intended

rahul7515
Associate III

i am using STM3210e-eval board which has stm32f103zgt6 MCU no i am just sending data over uart to my pc the uart is interfaced with rs232 port so for the looking at the schematics i have connected it's tx and rx to ft232rl's rx and tx respectively and taken the vcc and gnd from the board to the module i have also check the ioc file and it has been set properly asynchronous  mode with 1 stop bit and none parity bit i have also double check the baud rate but i recieve something else on putty now the problem isn't in putty because i checked the data directly over oscilloscope directly from tx pin of mcu and it shows the exact same data as was shown on putty so i guess the mcu is some how converting my data into something else and then sending also it is not random on checking from for all the integers i found out that starting from 1 for all the odd numbers if sent 1 it shows 127 ascii value character and for next odd it decrements to 126 and so on and now for even number it stars at 63 ascii value character and decrements moving further but for all the multiples of 4 it gives nothing that a blank. what is happening?

PS: i have also tried changing the baud rate from 115200 to 9600.... doesn't do any difference

 

here is the code

uint8_t data[1];
data[0] = 10;
HAL_UART_Transmit(&huart1,data,1,HAL_MAX_DELAY);
HAL_Delay(1000);

 

12 REPLIES 12

@rahul7515 wrote:

 on scope without FT232RL it is the same data and if i send 0x55 is shows 0x54 on the scope 


As @waclawek.jan and @Tesla DeLorean  already said, please show the scope trace!

Preferably a capture/screenshot from the scope itself rather than just a photograph of the screen.

> the problem isn't in FTDI FT232RL since even on scope without FT232RL it is the same data and if i send 0x55 is shows 0x54 on the scope which as i mentioned earlier is matching with that weird pattern of odd even

As @Tesla DeLorean said, the problem is that you are looking at the signal on the DB9 connector of the EVAL board, *after* a RS232 convertor. RS232 has different levels than 0-3V, and is inverted.

That's why you need a second convertor between the DB9 and FT232RL which inverts again and reverts from RS232 levels to 0-3V.

Or, find the Tx signal directly on the mcu pin (there may be headers on the EVAL board exposing the mcu signals - I am not familiar with this particular board) and connect that to FT232RL.

JW