EmbeddedRelated.com
Forums
Memfault State of IoT Report

LPC17xx question - ISR driven Serial possible?

Started by Ron February 26, 2010
You may have two solutions:

1) Use UART1 and its Auto Direction Control. It will set/clear its
RTS/DTR line on transmit.

2) If UART1 is reserved, you may manually do it easily: On put char
always set the pin. In ISR Thre req, if there is no data in fifo, clear the
pin..

From: l... [mailto:l...] On Behalf Of
Ron
Sent: 02 March, 2010 02:20
To: l...
Subject: [lpc2000] Re: LPC17xx question - ISR driven Serial possible?

Thanks for the advice. I am working with this now, to see what kind of
results I have. The one issue I might with utilizing the FIFO is the system
that I am trying to connect to.

There is a driver on the Tx line that has to be turned on and off on a real
time comm system, so if I wanted to transmit 1234 the driver system would
have to be this:

_____1234_____ TXed characters
|____| driver !enable line

I have this working for 1 character, beyond that, not as much luck.

--- In l... , "Deniz
Can Cigsar" wrote:
>
> I would recommend a software fifo that works as a carrier between sender
and
> ISR. You do not need a task to process TX data, its waste of resources..
> Also you are not using 16 level fifo of the hardware..
>
> My put char code is like this:
>
> 1. Disable Thre Irq, this wont hurt, it is just thre not the whole
> interrupt system
>
> 2. Check if there is room in hardware FIFO, if there is room, push the
> data into it, goto step 5
>
> 3. If software fifo is full, register txEvent, enable Thre IRQ, wait
> for txEvent, goto step 1
>
> 4. Push data to software fifo
>
> 5. Enable Thre Irq
>
> The interrupt routin is like this:
>
> 1. Read IIR
>
> 2. for thre:
>
> a. move upto 16 bytes of data from software fifo into hardware fifo
>
> b. if registered, trigger txEvent
>
> This will use both of 16 level hardware fifo, and additional software
fifo.
> Also no thread to handle tx flow, interrupt driven such that the output is
> continuous if you have more than 16 bytes to transmit.. Realy low resource
> to waste..

An Engineer's Guide to the LPC2100 Series


Memfault State of IoT Report