cancel
Showing results for 
Search instead for 
Did you mean: 

I can't get uart transmit interrupt.

hmehmetkurnaz
Associate II
Posted on September 05, 2007 at 16:16

I can't get uart transmit interrupt.

6 REPLIES 6
hmehmetkurnaz
Associate II
Posted on May 17, 2011 at 09:46

Hi all.

I need use UART0 with interrupt.I opened the uart0 with transmit, receive and receive timeout interrupts.TX and RX FIFO levels are 1/8 (2 byte).

I can't get any tx interrupt but i wait tx int when tx fifo less then 2 bytes.

I clear tx interrupt in uart isr.

amira1
Associate II
Posted on May 17, 2011 at 09:46

Hello mehmet,

You should enable the UART before configure it.

Are you sending data to the hyperteminal? You should verify that the hyperterminal configuration is the same as the UART config. In the example, the Hyperterminal configuration is as follow:

- Word Length = 7 Bits

- Two Stop Bit

- No parity

- BaudRate = 115200 baud

- Flow control: None

Best regards,

mirou.

amira1
Associate II
Posted on May 17, 2011 at 09:46

Hello mehmet,

Could you please find attached an IAR project using UART transmit interrupt with TX FIFO level is 1/8.

With best regards,

mirou.

[ This message was edited by: mirou on 04-09-2007 14:43 ]

hmehmetkurnaz
Associate II
Posted on May 17, 2011 at 09:46

Hi Mirou

Thanks for your answer.

I compare your source with mine and there is no important difference.

But i have some question about tx int.

- Is the sequence important for to get tx int?

...I first config and enable VIC with uart line and config Uart with tx int.Last i enable uart.

- Is the content of tx fifo.

... In the beginning, tx fifo is empty.In my serial write function i write to soft ring buf and i wait tx int.In tx int i write my ring buf to hard fifo.

What can i do in my function for to get tx int.I tried writing one byte to hard fifo in my function but it is useless.Should i write TX_FIFO_LEVEL byte to hard fifo for to get tx int?If so, what can i do when i have data less than TX_FIFO_LEVEL?

How can i tx int with ring buf?

Regards...

Mehmet

hmehmetkurnaz
Associate II
Posted on May 17, 2011 at 09:46

hi mirou,

I enable the UART before configure it and

i am sure hyperterminal configuration is the same as the UART config.

The problem is that clearing the tx int bit in the ICR is not enough.Why should i write to hard fifo until it becomes greater than the trigger level.But user manual says that clear int OR write fifo.

Best regards,

mehmet

sarao
Associate II
Posted on May 17, 2011 at 09:46

Hey mehmet,

I am running with a Keil board MCB-STR9 vers.3

some things I had to do:

1. I use COM2 on the Keil demo board.

I thought I read there was some issue using COM1

2. I had to use a NULL MODEM adapter on the serial cable

I didn't have time to probe the lines of the cable (lazy)

When I found it didn't work, I added the NULL MODEM adapter

Everything worked after that.