Sign in to follow this  
Followers 0
aegotheles

Pin Mapping /Debug versus Aux Serial UART

2 posts in this topic

I apologize if this is obvious, but on a new version of a MSP430FR5949 based datalogger programmed using Energia 18 - I switched the pins on the physical chip for serial communication from the Aux to the Debug UART for better layout.  Below is the modified pin map energia_pins.h file -

#if defined(__MSP430_HAS_EUSCI_A0__) || defined(__MSP430_HAS_EUSCI_A1__)
static const uint8_t DEBUG_UARTRXD = 18;  /* Receive  Data (RXD) at P2.1 */
static const uint8_t DEBUG_UARTTXD = 17;  /* Transmit Data (TXD) at P2.0 */
static const uint8_t AUX_UARTRXD = 22;     /* Receive  Data (RXD) at P4.5 */
static const uint8_t AUX_UARTTXD = 21;     /* Transmit Data (TXD) at P4.4 */
#define DEBUG_UARTRXD_SET_MODE (PORT_SELECTION1 | INPUT)
#define DEBUG_UARTTXD_SET_MODE (PORT_SELECTION1 | OUTPUT)
#define AUX_UARTRXD_SET_MODE (PORT_SELECTION1 | INPUT)
#define AUX_UARTTXD_SET_MODE (PORT_SELECTION1 | OUTPUT)
#define DEBUG_UART_MODULE_OFFSET 0x00
#define AUX_UART_MODULE_OFFSET 0x20
#define SERIAL1_AVAILABLE 1
#endif

I can't seem to even get a simple serial print out in terminal, although it loads without errors.  

How do I specify to use the debug_uartrxd and debug_uarttxd pins?  Is there something similar to Wire.setModule() for serial?

Share this post


Link to post
Share on other sites

So it was obvious, you can select the alternate serial port by simply initializing Serial1.begin(XXXX).  However, initially this didn't work, because when I made the msp430fr5949 pin map above the correct pin assignments for DEBUG_UART and AUX_UART were switched.  They should be (I believe) -

static const uint8_t DEBUG_UARTRXD = 22;  /* Receive  Data (RXD) at P2.1 */
static const uint8_t DEBUG_UARTTXD = 21;  /* Transmit Data (TXD) at P2.0 */
static const uint8_t AUX_UARTRXD = 18;     /* Receive  Data (RXD) at P4.5 */
static const uint8_t AUX_UARTTXD = 17;     /* Transmit Data (TXD) at P4.4 */

 and everything works fine.  

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0