cancel
Showing results for 
Search instead for 
Did you mean: 

ST7 39 Serial TX using interrupt

brian4
Associate II
Posted on February 10, 2009 at 13:27

ST7 39 Serial TX using interrupt

3 REPLIES 3
brian4
Associate II
Posted on February 09, 2009 at 10:32

Hi all

I am writing a serial routine in assembler to TX some data using SCI. if I use the code in AN969 which is just a loop it works ok.

But I want this to work with interrupts i.e.

Send byte

Do something

When byte sent, send next byte

The problem I am having is that whenever I set the TIE bit then the code jumps straight to the interrupt and stays there.

Does anybody have any code they could send me or point me to some other examples?

Re Brian

fggnrc
Associate II
Posted on February 10, 2009 at 01:23

Hello Brian.

I have an example of what you ask.

You can download this example from

http://sourceforge.net/projects/uants4home

On the cvs repository, there is the uAnthill project that uses a ST7FLite39 to ''talk'' with a PC with CTS/RTS hardware flow control.

The RS-232 link uses SCI and iterrupts.

The PcLink.asm source file contains the SCI interrupt handler (SCI_INT) and the external interrupt (CTS_INT) that manages the CTS line which the PC raises when its receive buffer is full.

Regards

EtaPhi

brian4
Associate II
Posted on February 10, 2009 at 13:27

Thanks

So as I have found as soon as you set the TIE flag it jumps to the interrupt

You then load you data into SCIDR and Reset Int RIM

keep doing this untill yoyr TX buffer is empty?

Does this sound correct

Re Brian