double Rx interrupts on HCS08QG SCI

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

double Rx interrupts on HCS08QG SCI

跳至解决方案
1,221 次查看
TonvW
Contributor I

I have used the SCI intterface before and with succes but now it's nothing but trouble.

I'm expecting to receive 8 bytes, but every byte is received twice!

(when 'ABCDEFGH' is sent, 'AABBCCDD' is received.

 

Please give me some advise. I'm using the interrupt routine below:

 

 

__interrupt void isrVscirx(void)
{
   RxBuf[RcvCount] = SCID;    // store in buffer
   RcvCount++;
   if (RcvCount==RXMAXBYTES) {    
     AsuroDataValid = TRUE;       
     RcvCount =0;                 
     SCIC2_RE =0;
     SCIC2_RIE =0;        
   }
   (void) SCIS1;      // reset flag

}

 

Thank you.

标签 (1)
0 项奖励
回复
1 解答
989 次查看
tonyp
Senior Contributor II

I believe before you read the SCID register, you must read the SCIS1 register.  This is part of the flag clearing mechanism.  (Simply make the last statement first.)

在原帖中查看解决方案

0 项奖励
回复
2 回复数
990 次查看
tonyp
Senior Contributor II

I believe before you read the SCID register, you must read the SCIS1 register.  This is part of the flag clearing mechanism.  (Simply make the last statement first.)

0 项奖励
回复
989 次查看
TonvW
Contributor I

Thank you very much for your reply! 

it works fine this way.

0 项奖励
回复