How to communicate with Even Parity device?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

How to communicate with Even Parity device?

跳至解决方案
673 次查看
everkimage
Contributor IV

My mcu is MC9S12XEP.I use it's serial communication interface to communicate with other device which is EVEN Parity 485 Bus.It doesn't work now.But i can use PC software(Even Parity) to communicate with that device.

In the RM file : SCICR1.PE = 1 enable the parity function and insert a parity bit in the most significiant bit position.And i get the result in PC software like this:

0x01 change to 0x81

0x85 change to 0x05

Normally Even Parity will insert a parity bit at the end of data.

What can i do to communicate with Even Parity communication device using MC9S12XEP?

标签 (1)
0 项奖励
1 解答
609 次查看
kef2
Senior Contributor IV

Hi,

  • SCICR1.PE = 1 enable the parity function and insert a parity bit in the most significiant bit position
  • Normally Even Parity will insert a parity bit at the end of data.

SCI is LSB first. So most significant bit position is at the end of data.

Even or odd parity is set up using PT bit.

BTW you didn't say how many bits is your data format, 8 or 9. If your S12XE is set up for 8bits, it would mean then 8bits including parity bit. Don't you need 8bits plus parity bit  = 9 bits? Please check 20.4.3 Data Format.

Edward

在原帖中查看解决方案

0 项奖励
1 回复
610 次查看
kef2
Senior Contributor IV

Hi,

  • SCICR1.PE = 1 enable the parity function and insert a parity bit in the most significiant bit position
  • Normally Even Parity will insert a parity bit at the end of data.

SCI is LSB first. So most significant bit position is at the end of data.

Even or odd parity is set up using PT bit.

BTW you didn't say how many bits is your data format, 8 or 9. If your S12XE is set up for 8bits, it would mean then 8bits including parity bit. Don't you need 8bits plus parity bit  = 9 bits? Please check 20.4.3 Data Format.

Edward

0 项奖励