cancel
Showing results for 
Search instead for 
Did you mean: 

UART and EIC bit

jpetereit29
Associate II
Posted on July 25, 2005 at 07:45

UART and EIC bit

3 REPLIES 3
jpetereit29
Associate II
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

caolei7255
Associate II
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?

jpetereit29
Associate II
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.