Using both the UART and I2C in the same MSP430 USCI module

Started by Dr_Mark 12 months ago1 replylatest reply 12 months ago119 views
I'm using the MSP430F249 with two USCI modules (0 and 1), which provides four ports (USCIA0&B0 and USCIA1*B1), but it seems there are only two hardware interrupts for each module, one for TX and one for RX. So the question is, can I reassign an unused interrupt to allow an ISR from two ports (A0_TX and B0_TX)?

To add an I2C temp sensor to my design (using UCB0SCL and UCB0SDA) I had to give up the UCA0TX interrupt on my RS485 UART port (using UCA0TXD and UCA0RXD), and feed the bytes out from the TimerB ISR until the transmit buffer is gone. This allowed the UCB0 port to be used for the I2C interface, which works, but the UART speed is now limited by the frequency of the TimerB interrupt.

Looking in the include file "msp430F249.h", there are 32 interrupt vectors assigned, with 16 being reserved. If these are hardwired within the chip they probably can't be reassigned, but I don't see any reference to this in the User Guide. Is it possible to use, say "PORT2_VECTOR" and reassign it to the USCIB0 I2C port TX interrupt?

[ - ]
Reply by beningjwJune 1, 2023

Hello Dr_Mark, 

   I've not worked with the specific MPS430F249, but I've worked with several other MSP430's over the years. 

   You can't assign any of the other ISR's to the USCI modules. These are all hardwired with the microcontroller. 

   If you can share some additional information, I might be able to suggest a few things to try. I could have sworn I've done something like this in the past where I allowed the tx interrupt to be triggered and then checked the UART or I2C status to determine what code to execute in the interrupt.