Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] Questions on the UART Interface

2004-11-17 by Robert Adsett

At 08:55 PM 11/17/04 +0000, you wrote:
>Now concerning U0THR & U0RBR (data registers)...
>2. Why do they both share the same memory address? I'd really like
>to know the purpose of this.

Consider the R/W line an extra address bit if it helps.  They don't share 
the same physical memory.  The idea (from the 8250 on) is that since you 
never read the transmit register and never write the receive register that 
they can be distinguished simply by the state of the read line and save all 
that extra address space and decoding logic (also explains why the divisor 
latch is a banked register).  These would be from the same school of chip 
designers that believe you never actually need to read setup registers.


>3. What will happen if the lpc receives a character while I'm
>writing to the transmit register?

It's supposed to act just fine.


>I ask this because currently, I'm having trouble running the serial
>port both ways (with interrupts) while sending replies and receiving
>command packets from the PC. Sometimes the protocol I'm using works.
>However, while debugging I always notice the lpc losing receiver
>bytes whenever communication goes wrong. I only observe this
>happening if the lpc's replying to a command packet and another
>command packet's coming in the same time.

Are you sure it's not the other way around?  I have seen a similar problem 
but I keep losing THRE interrupts.  It appears they 'disappear' if the LPC 
receives a byte while the interrupt identification register was being 
read.  I have a work-around that appears to at least reduce the problem 
(I've not had it reappear) that only reads the IIR once per interrupt.

It behaves similarly to the documented race conditions on the LPC 
(particularly the timers) but I've not seen anybody report duplicating it yet.

Needless to say, I'd like to know for sure what's going on with it and you 
seem to have come closest to duplicating the conditions I see it under 
(both interrupts active, transmit and receive happening simultaneously).

Robert

" 'Freedom' has no meaning of itself.  There are always restrictions,
be they legal, genetic, or physical.  If you don't believe me, try to
chew a radio signal. "

                         Kelvin Throop, III

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.