lpcware

LPC1114: Improved SW UART, 115k @ 12MHz !

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by ArneB on Fri Jan 20 10:10:02 MST 2012
Hi folks,

I needed a SW UART for my application and had a look at the sample provided by NXP... Max 9.6k @ 12 MHz clock frequency ???? Ooops, way too slow for me...

Therefore I have decided to write my own SW UART, optimized for speed. The results are quite surprising: The UART is able to achieve a baudrate of 115.2k at 12 MHz processor clock frequency ! :)
To be honest, I have only tested half-duplex operation (send or receive, but not both at the same time), therefore for full-duplex operation the maximum baudrate will be lower.

I don't claim, that this is the best driver on earth (definitely not...), but it is maybe a good starting point for your current or next project. :D

The attached file is an exported LPCXpresso project, which includes the driver together with a main.c file, which creates a loopback. You will receive every byte you send. It is just a small example, how to use the driver.

Some more implementation details: I have used two different timers, one  for the Tx and the other one for the Rx part. For the Tx part I am using  the external timer match pin (MAT), for the Rx part the capture pin  (CAP).

Any comments or project success stories are welcome !

Outcomes