cancel
Showing results for 
Search instead for 
Did you mean: 

STR7 UART0 TimeoutIdle problem

anirban
Associate
Posted on August 20, 2007 at 08:38

STR7 UART0 TimeoutIdle problem

3 REPLIES 3
anirban
Associate
Posted on June 16, 2007 at 09:22

I want to use the Timeout feature of the UART.

When i enable the timeout interrupt for the UART0, i find that the timeout flag is always set in the status register of the UART. This causes the UART0 interrupt to be called repeatedly. How to overcome this problem?

The UART0 initialisation routine is pasted below:

UART_Init(UART0);

GPIO_Config(GPIO0, PIN(8),GPIO_IN_TRI_CMOS);

GPIO_Config(GPIO0, PIN(9),GPIO_AF_PP);

UART_FifoConfig(UART0, DISABLE);

UART_FifoReset(UART0, UART_TxFIFO);

UART_FifoReset(UART0, UART_RxFIFO);

UART_LoopBackConfig(UART0, DISABLE);

UART_Config(UART0,19200,UART_NO_PARITY,UART_1_StopBits,UARTM_8D);

UART_RxConfig(UART0, ENABLE);

UART_TimeOutPeriodConfig(UART0, UART0Timeout_Period);

UART_ItConfig(UART0, (UART_RxBufFull | UART_TimeOutIdle), ENABLE);

VectSet(IRQ_UART0,UART0_IRQHandler);

EIC_IRQChannelPriorityConfig((IRQChannel_TypeDef)IRQ_UART0, 3);

EIC_IRQChannelConfig((IRQChannel_TypeDef)UART0_IRQChannel, ENABLE);

UART_OnOffConfig(UART0, ENABLE);

kleshov
Associate II
Posted on June 19, 2007 at 08:43

This is normal behavior. When servicing the interrupt, you need to reload the timeout timer by doing one of the following (see manual):

The UART contains an 8-bit timeout counter. This reloads from UARTn_TOR whenever one or more of the following is true

- UARTn_RxBBUFR is read

- The UART starts to receive a character

- UARTn_TOR is written to

Regards,

- mike

philip1
Associate II
Posted on August 20, 2007 at 08:38

you don't mention whic processor you are using...

We had problems with the STR730 because there is a mistake in the C library where the TOR address is not specfied correctly. Make sure you have the latest library update and check that 73x_map.h has:

...

vuc16 SR; /*Status Register*/

u16 EMPTY6;

u16 EMPTY7;

u16 EMPTY8;

vu16 TOR; /*Timeout Register*/

...

in it (note the 3 empty definitions, the faulty library only has 1)

hope this helps

PhilipJ