Topic : lm3s600 uart

Forum : ARM

Original Post
Post Information Post
February 4, 2011 - 6:11am
Guest

hiii,

i am using LM3S600 ON UV4.
i am developing some uart interrupt application for my project which will be use for serial communication.
this will be implimented by direct access registers.

so plz tell wats the problem ?

// Check if we have received a byte
//... check for buffer overflow and append it to the command buffer
__irq void UART0_ISR(void)

{
U8 CUR_state;
char chr;

UART0_MIS_R = CUR_state; // Make a local copy because the
// value could change by UART handler at any time
while (!(CUR_state & 0x01==1))
{
switch(CUR_state & 0x0E)
{
case SERIAL_RXTIMEOUT: //The receive timeout interrupt only occurs
//when the Rx FIFO is not empty
chr = UART0_FR_R; //UART Receive Time-Out Interrupt Mask

if (!Comnd_Received)
{

if (Read_Counter < UART0_BUFFER_LENGTH) // Add character to the buffer
{
*In_Data++ = chr;
Read_Counter++;
}
else
{

Buff_Oflw = TRUE;
}

if (chr == Line_Feed)
{
In_Data = 0;
Comnd_Received = TRUE;
}
}
break;

case SERIAL_TXTIMEOUT: // Write char - Send the char to the serial port //
//UART transmit Interrupt Mask
if (Head_Flag != Tail_Flag)
{
UART0_DR_R = Mesg_Buffer[Tail_Flag++];
if (Tail_Flag >= BUFFER_SZ)
Tail_Flag = 0;
}

break;
}
UART0_MIS_R = CUR_state;
}
UART0_ICR_R =0x000007f0; //clear the interrupt
}

also tell me here i used UART0_MIS_R this reg. is it rt?