issue of PT23_Getval() in BitsIO

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

issue of PT23_Getval() in BitsIO

1,100 次查看
aaronlee
Contributor V

Hi,

We use S12ZVCA and CodeWarrior for MCU v11.1.

[main.c line 188]

bTurnStatus_Temp = PT23_LeftRight_GetVal(); // Get PT2 & PT3 value (SCI1 & SCI2 abnormal)

It's highly unstable Transmit/Receive in SCI1 &SCI2  if we use the Getval().

[main.c line 187]

bTurnStatus_Temp = (PTT & 0x0C) >> 2; // Get PT2 & PT3 value (SCI1 & SCI2 work fine)

We use line 187 to instead of GetVal(). It works fine. Why?

  • SCI0, 115200,n,8,1
  • SCI1 9600,n,8,1
  • SCI1 sent "$D1,00,000#" immediately when SCI0 received 0xA0 10 0B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 DE

Best Regards,

Aaron

标记 (2)
0 项奖励
回复
1 回复

960 次查看
lama
NXP TechSupport
NXP TechSupport

Hi,

I do not think the issue is the code you mentioned.

If you disassemble the code for both of them you will see the only difference in the shift right.

The issue, in my opinion, is a traffic jam and data processing time. Have you checked overun error?

It can happen that if you use interrupt communication then there is no time to serve other interrupt request because of current interrupt processing.

Could you please try to decrease sending period and perform tests.

Best regards,

Ladislav

0 项奖励
回复