Skip to main content
Associate II
October 25, 2024
Question

Space Parity Setting on STM32L010RB

  • October 25, 2024
  • 4 replies
  • 2234 views

I want to send data from my STM32 to another micro controller and I want to enable space parity, there is no setting to enable it, the only settings are none, odd and even. For space parity i want the parity bit to always be 0.  I am using 9 bit UART including parity bit. I have tried to maintain even parity meaning the data has even number of 1s so even parity is 0 always but that doesn't help. I am using Barry terminal to check the transmitted data in that when parity is set even or none then only data is received, with space parity settings its not received. Is there any way in which i can ensure that the parity bit is 0 always and I get the data with space parity settings?

Any help is appreciated. Thanks.

4 replies

PGump.1
Senior II
October 25, 2024

Hi,

Just use 9 bit setting with parity disabled... Data bit 8 is your parity... (make sure you are using 16 bit transfers if you want to write to bit 8).

Kind regards
Pedro

AI = Artificial Intelligence, NI = No Intelligence, RI = Real Intelligence.
Associate II
October 25, 2024

Hi,

I tried that but in that case parity setting as NONE is working. I want it to work with space parity . Here is the screen shot of the terminal. when i set parity as none only in that case I am getting the data not under space.

Purnima_wbe_0-1729834423943.png

 

PGump.1
Senior II
October 25, 2024

Hi,

What do you get if you select Mark parity?

Kind regards
Pedro

AI = Artificial Intelligence, NI = No Intelligence, RI = Real Intelligence.
Associate II
October 25, 2024

Hello, I do not get anything.

PGump.1
Senior II
October 25, 2024

Hi,

Without an oscilloscope image of the TX data, I'm going to say you have a bug with your Terminal program...

Kind regards
Pedro

AI = Artificial Intelligence, NI = No Intelligence, RI = Real Intelligence.
PGump.1
Senior II
October 25, 2024

Hi,

Then you'll need to post an oscilloscope view of the TX data...

Kind regards
Pedro

AI = Artificial Intelligence, NI = No Intelligence, RI = Real Intelligence.
Associate II
October 25, 2024

Hi, here it is, i am transmitting

 

Purnima_wbe_0-1729841511773.png

 

PGump.1
Senior II
October 25, 2024

That not very helpful. What are you transmitting? Can you transmit a character with timing info - say 0xA5

Where are you measuring? TX data pin?

Kind regards
Pedro

AI = Artificial Intelligence, NI = No Intelligence, RI = Real Intelligence.
Associate II
October 25, 2024

Hi, I am transmitting 0xA5 and it is measured on Tx pin of stm32. The usart settings are 9 bit and parity none.

 

USART_DATA[0] = 0xA5;

USART_DATA[1] = 0x1C;

 

in while:

HAL_UART_Transmit(&huart2, USART_DATA , 1, 500);

HAL_Delay(1000);

 

Purnima_wbe_1-1729849283630.png