Yahoo Groups archive

Lpc2000

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

Message

Basic UART and RS422 implementation

2006-01-20 by my_cool_nickname@yahoo.com

I\'m somewhat new to the ARM and lower-level programming, so I have some (rather) basic questions about the UART on the LPC 2214 and then some on our implementation of half-duplex RS-422.

First off, the user manual says that the 2214 has a 16-byte-deep Tx FIFO.  Does this mean that when I want to transmit, I could just write myself a loop routine to read bytes out of my Tx buffer and write 16 bytes into the THR, then wait for the TEMT flag to tell me when it\'s done transmitting?

If this is the case what is a method I could use to easily keep track of how large my messages are in order to use the 16-byte FIFO efficiently?

The code that we currently use seems to be copied from 8051 apps and only writes one byte at a time to the THR, then waits for the THRE interrupt to write another single byte to the THR.

Considering the above things, how would I know when to shut down my RS-422 Tx enable line as quickly as possible without cutting off the transmitssion?  We don\'t have any sort of echoing back the Tx to the Rx, and it\'s too late to change the hardware design now.

Thanks,
Kent

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.