Reg: Accessing the FIFO Enabled UART

Status
Not open for further replies.

caniget

Newbie level 5
Joined
Dec 29, 2007
Messages
10
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,373
Dears,
I am developing an Industrial Automation project. and using LPC2478 Microcontroller. I have tried the UART Reception problem for one of the requirement. I have initialised the UART Configuration as per the datasheet. And i can able to transmit the data more than 16 bytes at a time. But, while i am trying to receive more than 16 bytes i couldn't. i have enabled the trigger level for FIFO. Still the problem arises. But i can able to get the data i am receiving the packet within 15 Byte size. while referring the datasheet the buffer size is only 16 bytes. i have tried lot in various angle. but i couldn't... can you anyone suggest me regaring the issue. Please kindly provide the solution regarding this. please find the coding part as follows.

************************** FIFO Enbled UART ***********************
uart_init()
{
PCONP |=(1<<24);
PCLKSEL1 |= 0x0000F000; // Enable clock for UART2,3
PINSEL0 |= 0x00500000; // P0.10 TXD2, P0.11 RXD2
// PINSEL9 |=0x0000A000; // P4.22 TXD2, P4.23 RXD2
U2LCR = 0x83; // 8 bits, no Parity, 1 Stop bit
Fdiv = ( configUART_CLOCK_HZ / 16 ) / baud ;
U2DLM = Fdiv / 256;
U2DLL = Fdiv % 256;
U2LCR = 0x03; /* DLAB = 0 */
U2FCR = 0x87; /* Enable and reset TX and RX FIFO.//tri level 2(8 bit) */
U2IER = 0;
if( install_irq( UART2_INT, (void *)UART2Handler,HIGHEST_PRIORITY)== FALSE)
return ;
U2IER = IER_RBR | IER_THRE | IER_RLS; // Enable UART2 interrupt
}

__irq __nested __arm void UART2Handler (void)
{
pdCHAR IIRValue, LSRValue;

volatile pdCHAR Data,Dummy;
__enable_interrupt(); // handles nested interrupt

IIRValue = U2IIR;
IIRValue >>= 1; // skip pending bit in IIR
IIRValue &= 0x07; // check bit 1~3, interrupt identification
switch(IIRValue)
{
case IIR_RLS:
case IIR_RDA:
case IIR_CTI:

LSRValue = U2LSR;

do
{
if(LSRValue & LSR_OE)
{
// Overrun Error
// Uart2LineEvents.bOE = TRUE;
}
LSRValue = U2LSR;
Data = U2RBR;

if (LSRValue & LSR_BI)
{
// Break Indicator
// Uart2LineEvents.bBI = TRUE;
}
else if (LSRValue & LSR_FE)
{
// Framing Error
// Uart2LineEvents.bFE = TRUE;
}
else if (LSRValue & LSR_PE)
{
// Parity Error
// Uart2LineEvents.bPE = TRUE;
}


// Read the line state of the UART
LSRValue = U2LSR;
}
while(LSRValue & LSR_RDR); // Is the hardware FIFO is empty?
break;

case IIR_THRE: // THRE Interrupt

break;


}

VICVectAddr = 0; // Clear interrupt in VIC.}
}

************************************************** **********
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…