Skip to main content
Visitor II
December 3, 2007
Question

How does the UART with FIFO really work?

  • December 3, 2007
  • 2 replies
  • 647 views
Posted on December 03, 2007 at 13:37

How does the UART with FIFO really work?

    This topic has been closed for replies.

    2 replies

    netzAuthor
    Visitor II
    November 15, 2007
    Posted on November 15, 2007 at 06:39

    Hello,

    I miss some guide from the documentation.

    I want to use the FIFO. My Setup:

    Code:

    UART_Init(UART1);

    UART_FifoConfig(UART1,ENABLE);

    UART_Config(UART1,115200,UART_NO_PARITY,UART_1_StopBits,UARTM_8D);

    UART_TimeOutPeriodConfig(UART1,0xFF);

    UART_OnOffConfig(UART1,ENABLE);

    Code:

    UART_RxConfig(UART1 ,ENABLE);

    UART_ItConfig(UART1,0xFF, DISABLE);

    UART_ItConfig(UART1,UART_RxBufFull, ENABLE);

    My ISR is:

    Code:

    if ( int_flags & UART_RxBufFull) { // Data received

    UART_ItConfig(UART1,(UART_RxBufFull), DISABLE);

    OSSignalBinSem(BINSEM_BT_RX); // Calls Task GetRX

    }

    Code:

    void GetRX(void){

    for(;;) {

    OS_WaitBinSem(BINSEM_BT_RX,OSNO_TIMEOUT);

    while( UART1->SR | UART_RxBufFull) {

    g_rxbuf = UART1->RxBUFR & 0xFF;

    ...

    }

    UART_ItConfig(UART1,(UART_RxBufFull), ENABLE);

    }

    }

    What I get, instead of

    RING

    is

    RRRRRRRRRRRRIIIIIIIIIIIIINNNNNNNNNNNGGGGGGGGGGGG

    Why that?

    Sometimes 11,12,13 chars?

    Will the FIFO-Pointer set through reading or have I to

    Reset the FIFO. Only when?

    When will the RXBufNotEmpty reset, and why is it in the

    STR71-Softlib named RxBufFull?

    Questions over questions.

    Has one a document, where the UART is described in detail?

    Or can you help me :o

    Thanks,

    Steffen

    Visitor II
    December 3, 2007
    Posted on December 03, 2007 at 13:37

    Dear Bummibaer,

    New examples of UART FIFO were provided with STR71xFWLib V4.0. and the RxBufFull flag name is modified as well to RxBufNotEmpty. The

    http://www.st.com/mcu/download2.php?file=str71xfwlib.zip&info=STR7 Software STR71x&url=http://www.st.com/stonline/products/support/micro/files/str71xfwlib.zip

    is available on the web site. Enjoy ;)