stone zhang

Serial communications interface interrupt error!

Discussion created by stone zhang on Jun 4, 2012

please help!

Now I am writing SCI code, but i recieve two interrupt unexpectedly ,when i send one byte via pc serial port .

Following is my code, it's simple. i can't find any error in it.

 

void SCI3_Init(void)

{  

setReg8(SCI1_C2, 0x00U);            

(void)getReg8(SCI1_S1);           

(void)getReg8(SCI1_D);             

setReg8(SCI1_S2, 0x00U);             

setReg8(SCI1_BDH, 0x00U);           

setReg8(SCI1_BDL, 0x68U);             

setReg8(SCI1_C1, 0x00U);               

setReg8(SCI1_C3, 0x00U);              

setReg8(SCI1_C2, 0x2CU);             

}

ISR(sci_rx_interr) {

(void)getReg8(SCI1_D);

}

Outcomes