AnsweredAssumed Answered

Incorrect Data after reception when used 7,Even,1 stop bit UART combination.

Question asked by Alpha Mr on May 11, 2018
Latest reply on May 14, 2018 by Clive One

Hello,

 

I am trying to communicate with remote serial device which needs 7-bit data length, Even or odd parity, 1 stop bit. But I am facing problems in implementing this. Problem is the data received in RDR register is incorrect. For example I am transmitting 0x31 from PC terminal and I am getting 0xB1 when I configured UART  with 8,E,1 and PC terminal with 7,E,1 setting.This seems wrong but its correct as STM32 has data word length including parity If seen the above byte in binary form : 0x31 is 00110001 and 0xB1 is 10110001 . Its clear that the latter is the 0x31 with added even parity. But I am not getting why RDR has 0xB1 instead of 0x31 after reception?  I am using STM32F091RCT6 with SWSTM32 IDE.The same was tested with odd parity too but with same results. Parity handling is done in STM32 isn't it? I have tried searching for user manual of this MCU but didn't find any, found only reference manual which didn't helped in knowing how STM32 handles parity. I have successfully tested the 8,E/O,1 combination and it worked fine, but 7,E/O,1  didn't worked. Any help will be appreciated.

Outcomes