Skip to main content
Visitor II
July 25, 2005
Question

UART and EIC bit

  • July 25, 2005
  • 3 replies
  • 991 views
Posted on July 25, 2005 at 07:45

UART and EIC bit

    This topic has been closed for replies.

    3 replies

    Visitor II
    July 13, 2005
    Posted on July 13, 2005 at 06:47

    Hello,

    I write an aplication using 2 UARTS and timer. The UART0 and UART1 are full interrupt controlled. I use UART0 to send and get commands to target device. UART1 is used to communicate with an external device over RS485. UART1 send a comand and receive the response ( all via interrupt handlers ). After receiving it send a new command and so on.

    The behaviour is the following:

    The application run ca. 20sec. Than the EIC->IER bit of UART1 is reset. The rest of the aplication works well (inclusive the timer interrupt) but I don't get interrupts from UART1. Sometimes UART0 isn't working too. When I enable the EIC->IER bit of UART1 again UART1 doesn't work again. The regiter values of UART1 seems OK.

    Do you have an idea why the EIC->IER bit is reset?

    Some aditional informations:

    In normal working state the EIC register is 0x1C0C01. When UART1 stops the EIC register is 0x1C0801. The interrupt pending register is 0x180001 when UART1 stops

    I check the IRQ, and C-Stack -> OK

    I changed the interrupt priority -> no chaning

    I removed all code wich disable flags in EIC->IER -> no changing

    Visitor II
    July 18, 2005
    Posted on July 18, 2005 at 06:08

    I finished a application with full duplex communication.It works well.I give you some info as bellow:

    1. The receive interrupt is enable all the time

    2. The Tx interrupt and TimeOut interrupt are enabled by the programwhen you need.

    3.In

    void UART0_IRQHandler(void)

    {

    u16 wFlag;

    wFlag = UART_FlagStatus(UART0) ;

    if(wFlag & UART_RxBufFull)

    {

    do something;

    }

    else if(wFlag & UART_TimeOutIdle )

    {

    do something;

    }

    else if(wFlag & UART_TxEmpty)

    {

    do something;

    }

    else{};

    }

    That's all.It's simple.isn't it?

    Visitor II
    July 25, 2005
    Posted on July 25, 2005 at 07:45

    Hi,

    I didn't find the bug, but now the aplplication works. I removed all object files a build the application again. Now it works without errors.