issue of PT23_Getval() in BitsIO

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

issue of PT23_Getval() in BitsIO

607 Views
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

Tags (2)
0 Kudos
1 Reply

467 Views
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 Kudos