AnsweredAssumed Answered

k64 fifo uart fifoempt flag always high.....

Question asked by thrithin chand on Jun 4, 2016
Latest reply on Jun 7, 2016 by Robin_Shen

sir, i did uart bootloader code in k64 at 9600 baud rate in polling method ,,,,,

aceept data from uart when it reach 32 byte itll go for flash write and come back befor the next byte .... so it worked fine but it require much time so i need to implement uart fifo to increase the baud rate..9600 to 115200...and reduce the time for flash ... so here i enable the uart0 fifo,8byte size.. but while i checking the uart fifo empty flag it always show...the fifo is empty....ill put my code here .......

/* Disable UART TX RX before setting. */

    base->C2 &= ~(UART_C2_TE_MASK | UART_C2_RE_MASK);

/* Enable tx/rx FIFO */

    base->PFIFO |= (UART_PFIFO_TXFE_MASK | UART_PFIFO_RXFE_MASK);

 

/*select fifo size 8 data word*/

    base->PFIFO|=UART_PFIFO_RXFIFOSIZE(2);

    /* Flush FIFO */

    base->CFIFO |= (UART_CFIFO_TXFLUSH_MASK | UART_CFIFO_RXFLUSH_MASK);

/*enaable UART TX RX before setting. */

    base->C2 |= (UART_C2_TE_MASK | UART_C2_RE_MASK);

above code for enable fifo....

delay();

(in that delay running i send data)

then in my pgm code....

if(kUART_RxFifoEmptyFlag)

   {UART_WriteBlocking(DEMO_UART,&UART0->RCFIFO,1);

    UART_WriteByte(DEMO_UART,'A');}

    else UART_WriteByte(DEMO_UART,'B');

i got out put 9A9A9A.... like this so flag always one so data in fifo is empty???????????

actually my task to store data in fifo to store a buf ......

Outcomes