Santhosh,
Removing the Xon/XOff flow control would make the Rx and Tx ISRs look like:
/*************************************************************************************/
void RxISR(void)
{
/* Variable Declarations */
uchar c;
/* Begin Function RxISR() */
c = SCI0DRL;
if (RxBAvail != 0) /* if there are bytes available in the Rx buffer */
{
RxBAvail--; /* reduce the count by 1 */
RxBuff[RxIn++] = c; /* place the received byte in the buffer */
if (RxIn == RxBufSize) /* reached the physical end of the buffer? */
RxIn = 0; /* yes. wrap around to the start */
}
} /* end RxISR */
/*************************************************************************************/
void TxISR(void)
{
/* Variable Declarations */
/* Begin Function TxISR() */
SCI0DRL = TxBuff[TxOut++]; /* remove a character from the buffer & send it */
if (TxOut == TxBufSize) /* reached the physical end of the buffer? */
TxOut = 0; /* yes. wrap around to the start */
if (++TxBAvail == TxBufSize) /* anything left in the Tx buffer? */
SCI0CR2 &= ~SCI0CR2_TIE_MASK; /* no. disable transmit interrupts */
}
} /* end TxISR */
/*************************************************************************************/
The get char() and put char() functions would look like:
/*************************************************************************************/
int putchar(int c)
{
/* Variable Declarations */
/* Begin Function putchar() */
while (TxBAvail == 0) /* if there's no room in the xmit queue */
; /* wait here */
DisableInterrupts;
TxBuff[TxIn++] = c; /* put the char in the buffer, inc buffer index */
if (TxIn == TxBufSize) /* buffer index go past the end of the buffer? */
TxIn = 0; /* yes. wrap around to the start */
TxBAvail--; /* one less character available in the buffer */
EnableInterrupts;
return(c); /* return the character we sent */
} /* end putchar */
/*************************************************************************************/
int getchar(void)
{
/* Variable Declarations */
uchar c; /* holds the character we'll return */
/* Begin Function getchar() */
while (RxBAvail == RxBufSize) /* if there's no characters in the Rx buffer */
; /* just wait here */
DisableInterrupts;
c = RxBuff[RxOut++]; /* get a character from the Rx buffer & advance the Rx index */
if (RxOut == RxBufSize) /* index go past the physical end of the buffer? */
RxOut = 0; /* yes wrap around to the start */
RxBAvail++; /* 1 more byte available in the receive buffer */
EnableInterrupts;
return(c); /* return the character retrieved from receive buffer */
} /* end getchar */
/*************************************************************************************/
Best Regards,
Gordon