I am writing an ISR routine to process incoming characters on a MC9S08 from another serial device. The device sends the characters with no idle time between the bytes. In one example the device responds to a specific command with 3 bytes "OK<CR>". I find that I can only recieve the first character and then I get an overRun error. I feel that either my ISR is incorrect OR my clocks are not configured correctly. My init and ISR are as follows...
...
/* configure SCI2 interrupt mode */
/* SCI2C1: LOOPS=0,SCISWAI=0,Rsrc=0,M=0,WAKE=0,ILT=0,PE=0,PT=0 */
SCI2C1 = 0x00; /* Configure the SCI */
/* SCI2C3: R8=0,T8=0,TXDIR=0,TXINV=0,ORIE=0,NEIE=0,FEIE=0,PEIE=0 */
SCI2C3 = 0x00; /* Disable error interrupts */
/* SCI2S2: LBKDIF=0,RXEDGIF=0,??=0,RXINV=0,RWUID=0,BRK13=0,LBKDE=0,RAF=0 */
SCI2S2 = 0x00;
/* SCI2C2: TIE=0,TCIE=0,RIE=0,ILIE=0,TE=0,RE=0,RWU=0,SBK=0 */
SCI2C2 = 0x00; /* Disable all interrupts */
SCI2BD = UART_BAUD_9600;
/* SCI2C3: ORIE=0,NEIE=0,FEIE=0,PEIE=0 */
SCI2C3 |= 0x00; /* disable error interrupts */
SCI2C2 |= ( SCI2C2_TE_MASK | SCI2C2_RE_MASK | SCI2C2_RIE_MASK); /* Enable transmitter, Enable receiver, Enable receiver interrupt */
asm CLI;
}
#pragma TRAP_PROC
void vSci2Rx(void){
//mask this isr
SCI2C2 &= ~(SCI2C2_RIE_MASK);
while(SCI2S1 & SCI1S1_RDRF_MASK){
//read the char into buf
ucSci2RcvBuf[iSci2Index++] = SCI2D;
if(iSci2Index > 7){
iSci2Index = 0;
}
}
//unmask isr
SCI2C2 |= (SCI2C2_RIE_MASK);
}
Any ideas on how I can get better thru-put for this part?
thanks
rich