double Rx interrupts on HCS08QG SCI

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

double Rx interrupts on HCS08QG SCI

ソリューションへジャンプ
637件の閲覧回数
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 解決策
405件の閲覧回数
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 返答(返信)
406件の閲覧回数
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 件の賞賛
405件の閲覧回数
TonvW
Contributor I

Thank you very much for your reply! 

it works fine this way.

0 件の賞賛