double Rx interrupts on HCS08QG SCI

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

double Rx interrupts on HCS08QG SCI

Jump to solution
836 Views
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.

Labels (1)
0 Kudos
Reply
1 Solution
604 Views
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.)

View solution in original post

0 Kudos
Reply
2 Replies
605 Views
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 Kudos
Reply
604 Views
TonvW
Contributor I

Thank you very much for your reply! 

it works fine this way.

0 Kudos
Reply