I’ve received a lot of questions and requests for information and help on the MSP430 UART, so I decided to make available an driver for it. It’s simple but has plenty of flexibility.
Even more important, it abstracts a lot of the register controls to a level that most users should be comfortable using.
You can find the Driver and MSP430F5438 sample code for CCS here:
Download MSP430 UART Driver with F5438 Example
The code is heavily commented. More than just a useful driver, I intended it to be easy to use and a guide on using the UART module. My code uses plenty of tricks and pointers to make it flexible (and I might have overdone some of it), but I expect in the near future to complete support for the USART module (USCI is what the MSP430F5438 and similar devices have). Some basic support is there but USART isn’t tested.
You can import the CCS project compile and run it on an F5438 Experimenter board. Using it in your own project is simple, just import uart.h and uart.c and make sure to call the right functions.
Ultimately I have the following goals:
1) Support for most MSP430 devices and UART modules
2) Basic framing including CRC generation and checking
3) Example code for a variety of hardware platforms and variety of use cases
If you use it, feel free to let me know.