This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/MSP432P401R: Transmitting data from one port to another

Part Number: MSP432P401R

Tool/software: Code Composer Studio

Hi,

I was editing a UART example so I could eventually use the UART ports 3 and 2. I was just using UART port 1 for seeing if the data being transmitted was being received. So for EUSCI_A0 I sent the letter 'g', I see it in the TX buffer but it never gets to the RX buffer. Can someone help me see if I am doing anything wrong.

Thanks



/****************************************************************************** * MSP432 UART - PC Echo with 12MHz BRCLK * * Description: This demo echoes back characters received via a PC serial port. * SMCLK/DCO is used as a clock source and the device is put in LPM0 * The auto-clock enable feature is used by the eUSCI and SMCLK is turned off * when the UART is idle and turned on when a receive edge is detected. * Note that level shifter hardware is needed to shift between RS232 and MSP * voltage levels. * * MSP432P401 * ----------------- * | | * | | * | | * RST -| P1.3/UCA0TXD|----> PC (echo) * | | * | | * | P1.2/UCA0RXD|<---- PC * | | * * Author: Timothy Logan *******************************************************************************/ /* DriverLib Includes */ #include "driverlib.h" /* Standard Includes */ #include <stdint.h> #include <stdbool.h> /* UART Configuration Parameter. These are the configuration parameters to * make the eUSCI A UART module to operate with a 9600 baud rate. These * values were calculated using the online calculator that TI provides * at: *software-dl.ti.com/.../index.html */ char info = 'g'; const eUSCI_UART_Config uartConfig = { EUSCI_A_UART_CLOCKSOURCE_SMCLK, // SMCLK Clock Source 78, // BRDIV = 78 2, // UCxBRF = 2 0, // UCxBRS = 0 EUSCI_A_UART_NO_PARITY, // No Parity EUSCI_A_UART_LSB_FIRST, // LSB First EUSCI_A_UART_ONE_STOP_BIT, // One stop bit EUSCI_A_UART_MODE, // UART mode EUSCI_A_UART_OVERSAMPLING_BAUDRATE_GENERATION // Oversampling }; int main(void) { /* Halting WDT */ MAP_WDT_A_holdTimer(); /* Selecting P1.2 and P1.3 in UART mode */ MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P1, GPIO_PIN2 | GPIO_PIN3, GPIO_PRIMARY_MODULE_FUNCTION); //Set LED 1.0 as output MAP_GPIO_setAsOutputPin(GPIO_PORT_P1, GPIO_PIN0); MAP_GPIO_setOutputLowOnPin(GPIO_PORT_P1, GPIO_PIN0); /* Selecting P2.2 and P2.3 in UART mode */ MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P2, GPIO_PIN2 | GPIO_PIN3, GPIO_PRIMARY_MODULE_FUNCTION); //Set LED 2.0 as output MAP_GPIO_setAsOutputPin(GPIO_PORT_P2, GPIO_PIN0); MAP_GPIO_setOutputLowOnPin(GPIO_PORT_P2, GPIO_PIN0); /* Selecting P3.2 and P3.3 in UART mode */ MAP_GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P3, GPIO_PIN2 | GPIO_PIN3, GPIO_PRIMARY_MODULE_FUNCTION); //Set LED 2.1 as output MAP_GPIO_setAsOutputPin(GPIO_PORT_P2, GPIO_PIN1); MAP_GPIO_setOutputLowOnPin(GPIO_PORT_P2, GPIO_PIN1); /* Setting DCO to 12MHz */ CS_setDCOCenteredFrequency(CS_DCO_FREQUENCY_12); /* Configuring UART Module0 */ MAP_UART_initModule(EUSCI_A0_BASE, &uartConfig); /* Configuring UART Module1 */ MAP_UART_initModule(EUSCI_A1_BASE, &uartConfig); /* Configuring UART Module2 */ MAP_UART_initModule(EUSCI_A2_BASE, &uartConfig); /* Enable UART module0 */ MAP_UART_enableModule(EUSCI_A0_BASE); /* Enable UART module1 */ MAP_UART_enableModule(EUSCI_A1_BASE); /* Enable UART module2 */ MAP_UART_enableModule(EUSCI_A2_BASE); /* Enabling interrupts0 */ MAP_UART_enableInterrupt(EUSCI_A0_BASE, EUSCI_A_UART_RECEIVE_INTERRUPT); MAP_Interrupt_enableInterrupt(INT_EUSCIA0); MAP_Interrupt_enableSleepOnIsrExit(); MAP_Interrupt_enableMaster(); /* Enabling interrupts1 */ MAP_UART_enableInterrupt(EUSCI_A1_BASE, EUSCI_A_UART_RECEIVE_INTERRUPT); MAP_Interrupt_enableInterrupt(INT_EUSCIA1); MAP_Interrupt_enableSleepOnIsrExit(); MAP_Interrupt_enableMaster(); /* Enabling interrupts2 */ MAP_UART_enableInterrupt(EUSCI_A2_BASE, EUSCI_A_UART_RECEIVE_INTERRUPT); MAP_Interrupt_enableInterrupt(INT_EUSCIA2); MAP_Interrupt_enableSleepOnIsrExit(); MAP_Interrupt_enableMaster(); while(1) { UART_transmitData(EUSCI_A0_BASE, info); //UART_transmitData(EUSCI_A2_BASE, info); //MAP_PCM_gotoLPM0(); } } /* EUSCI A0 UART ISR - Echoes data back to PC host */ void EUSCIA0_IRQHandler(void) { uint32_t status = MAP_UART_getEnabledInterruptStatus(EUSCI_A0_BASE); MAP_UART_clearInterruptFlag(EUSCI_A0_BASE, status); if(status & EUSCI_A_UART_RECEIVE_INTERRUPT_FLAG) { MAP_UART_transmitData(EUSCI_A0_BASE, MAP_UART_receiveData(EUSCI_A0_BASE)); MAP_GPIO_setOutputHighOnPin(GPIO_PORT_P1, GPIO_PIN0); } MAP_GPIO_setOutputLowOnPin(GPIO_PORT_P1, GPIO_PIN0); } /* EUSCI A1 UART ISR - Echoes data from P2 to PC host */ void EUSCIA1_IRQHandler(void) { uint32_t status = MAP_UART_getEnabledInterruptStatus(EUSCI_A1_BASE); MAP_UART_clearInterruptFlag(EUSCI_A1_BASE, status); if(status & EUSCI_A_UART_RECEIVE_INTERRUPT_FLAG) { MAP_UART_transmitData(EUSCI_A0_BASE, MAP_UART_receiveData(EUSCI_A1_BASE)); MAP_GPIO_setOutputHighOnPin(GPIO_PORT_P2, GPIO_PIN0); } MAP_GPIO_setOutputLowOnPin(GPIO_PORT_P2, GPIO_PIN0); } /* EUSCI A2 UART ISR - Echoes data P3 to P2 */ void EUSCIA2_IRQHandler(void) { uint32_t status = MAP_UART_getEnabledInterruptStatus(EUSCI_A2_BASE); MAP_UART_clearInterruptFlag(EUSCI_A2_BASE, status); if(status & EUSCI_A_UART_RECEIVE_INTERRUPT_FLAG) { MAP_UART_transmitData(EUSCI_A1_BASE, MAP_UART_receiveData(EUSCI_A2_BASE)); MAP_GPIO_setOutputHighOnPin(GPIO_PORT_P2, GPIO_PIN1); } MAP_GPIO_setOutputLowOnPin(GPIO_PORT_P2, GPIO_PIN1); }

**Attention** This is a public forum