Check UART odd parity bit

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
MaWo_1214996
Level 3
Level 3
First like given

Hello,

I would like to use the UART component as follow in half duplex mode:

Responding only if the received byte has parity bit set to 1, otherwise do nothing. Sending only with parity bit 0.

Is that somehow possible?

My attempt now is:

UartByte = UART_GetByte();

UartControlReg = UART_ReadControlRegister();

When reading the control register, which bit is signaling odd parity?

Thanks in advance....

0 Likes
3 Replies
BragadeeshV
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hi user_248309786​,

Could you please mention the PSoC device you are using? I assume it is PSoC  5 LP.

Are you using the Mark/Space feature that differentiates between address or data?

Regards,

Bragadeesh

Regards,
Bragadeesh
0 Likes

Yes, PSoC 5lp. I don't use Mark/Space. Half duplex.

I musst somehow react to the 9th bit. If it is 1, then it comes from a master device and is a request and I need to further check the message.

If it is a 0, then it comes from slave devices and I can ignore it.

Now depend on adjustments, it can be also the stop bit. If there is no stop bit, then it would lead in a framing error.

0 Likes

Hi user_248309786​,

Is the parity bit coming from the master/ slave device being set according to the even/ odd numbers of 1s in the data?

Regards,

Bragadeesh

Regards,
Bragadeesh
0 Likes