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.

Compiler/MSP432P401R: UART in MSP432

Part Number: MSP432P401R

Tool/software: TI C/C++ Compiler

I created a program where I set up the UART with MSP432, however I can not make the UART work well, can someone help me to configure the UART. Or show me an example where it works with interrupts and no interrupts

  • uart.c

    /*UART CONFIGURATION*/
    void uart_init(void){
         /*Configure UART*/
         EUSCI_A2->CTLW0 |= EUSCI_A_CTLW0_SWRST;                        /*PUT EUSCI IN RESET*/
         EUSCI_A2->CTLW0  = EUSCI_A_CTLW0_SWRST |                       /*REMAIN EUSCI IN RESET*/
                          EUSCI_B_CTLW0_SSEL__SMCLK;                    /*CONFIGURE EUSCI CLOCK SMCLK*/
         /*Baud Rate calculation
         *12000000/(16*9600) = 78.125
         *Fractional portion = 0.125
         *User's Guide Table 21-4: UCBRSx = 0x10
         *UCBRFx = int ( (78.125-78)*16) = 2
         */
         EUSCI_A2->BRW = 78;                                            /*12000000/16/9600*/
         EUSCI_A2->MCTLW = (2 << EUSCI_A_MCTLW_BRF_OFS) |
                           EUSCI_A_MCTLW_OS16;
         EUSCI_A2->CTLW0 &= ~(EUSCI_A_CTLW0_SWRST);                     /*INITIALIZE EUSCI*/
         EUSCI_A2->IFG   &= ~(EUSCI_A_IFG_RXIFG);
         EUSCI_A2->IE |= EUSCI_A_IE_RXIE;                               /*ENABLE THE UART RX INTERRUPT*/
    
    
         /*ENABLE GLOBAL INTERRUPT*/
         __enable_irq();
         /*ENABLE NVIC IN EUSCI_A2 INTERRUPT*/
         NVIC->ISER[0] = 1 << ((EUSCIA2_IRQn) & 31);
    
    }
    /*UART PORTS*/
    void confg_uart_wired(void){
         P3->SEL0 |= UART_TX | UART_RX;                                /*SET 2 UART PIN AS SECOND FUNCTION*/
    }
    /*UART CLOCK SYSTEM*/
    void uart_cs(void){
         CS->KEY  = CS_KEY_VAL;                                        /*UNLOCK CS MODULE REGISTER ACESS*/
         CS->CTL0 = 0;                                                 /*RESET TUNING PARAMETERS*/
         CS->CTL0 = CS_CTL0_DCORSEL_3;                                 /*SET DCO TO 12MHz (NOMINAL, CENTER OF 8-16MHz RANGE)*/
         CS->CTL1 = CS_CTL1_SELA_2 |                                   /*SELECT ACLK = REFO*/
                    CS_CTL1_SELS_3 |                                   /*SMCLK = DCO*/
                    CS_CTL1_SELM_3;                                    /*MCLK = DCO*/
         CS->KEY  = 0;
    }
    
    
    void EUSCIA2_IRQHandler(void){
        if(EUSCI_A2->IFG & EUSCI_A_IFG_RXIFG){
            LED_PyOUT(G_LED);
    
        }
        if(EUSCI_A2->IFG & EUSCI_A_IFG_TXIFG){
            LED_PyOUT(R_LED);                                        /*LIGHT UP P2.x LED ON RX*/
        }
    }
    

    main.c

    void main(void){
        /*CLEAR ALL LED RGB*/
        LED_PxCLR(R_LED|G_LED|B_LED);
        LED_PyDIR(R_LED|G_LED|B_LED);
    
        WatchDogHold();
        uart_cs();
        confg_uart_wired();
        uart_init();
        while(1){
    
        }
    }
    
    void WatchDogHold(void){
    WDTCTL = WDTPW | WDTHOLD;  /*STOP WATCHDOG TIMER*/
    }
    

  • There are example programs available at the Product page ("Tools and Software") but I think you have it almost right.

    > if(EUSCI_A2->IFG & EUSCI_A_IFG_RXIFG){
    > LED_PyOUT(G_LED);

    You need to clear RXIFG or it will keep happening. The safest way to do this (if you don't care what the byte is) is:

    > (void)EUSCI_A2->RXBUF; // Read Rx char and throw it away (clears RXIFG)
    ------
    > if(EUSCI_A2->IFG & EUSCI_A_IFG_TXIFG){
    > LED_PyOUT(R_LED); /*LIGHT UP P2.x LED ON RX*/

    I'll just point out here that in this program TXIFG will always be set . This is fine, but: Are R_LED and G_LED mutually exclusive?
  • Bruce McKenney first of all Thank you for your help.

    I am trying to mount a program that sends data (text) through the UART to a bluetooth module. R_LED and G_LED are assigned to the MSP432 card, and are only used for debugging. Verify that this transmit or receive, however I did not understand the operation of RXIFG and TXIFG.if I have understood well the part of the interruption can be done as follow:

    void EUSCIA2_IRQHandler(void){
        if(EUSCI_A2->IFG & EUSCI_A_IFG_RXIFG){
            LED_PyOUT(G_LED);                                        /*LIGHT UP P2.1 LED ON RX*/
            EUSCI_A2->IFG &= ~(EUSCI_A_IFG_RXIFG);
        }
        if(EUSCI_A2->IFG & EUSCI_A_IFG_TXIFG){
            LED_PyOUT(R_LED);                                        /*LIGHT UP P2.0 LED ON TX*/ 
            while(!(EUSCI_A2->IFG & EUSCI_A_IFG_TXIFG));
    
        }
    }

    This may be the doubt of many other users, after resolving this problem I will make available the resources to be able to help everyone who has the same problem.

  • > EUSCI_A2->IFG &= ~(EUSCI_A_IFG_RXIFG);
    I don't recommend that you clear RXIFG this way. Rather, you should clear it by reading RXBUF (as I described above). In a full application, you would be reading RXBUF anyway, and then doing something with the result, so if you prefer you could code it as:
    > unsigned char c = EUSCI_A2->RXBUF; // Read Rx char (clears RXIFG)
    and add code to do something with "c" when you figure out what.
    ------
    > while(!(EUSCI_A2->IFG & EUSCI_A_IFG_TXIFG));
    This is harmless, since you determined already that TXIFG is set. I mention it since it's generally a bad habit to spin on TXIFG (or anything else, for that matter) in an ISR. Here again, what code goes here depends on how the rest of your application develops.
  • ok, I made some modifications and some implementations based on what you told me

    uart.c

    char RX_Buffer[];
    int BUFFER_COUNT = 0;
    
    /*UART CONFIGURATION*/
    void uart_init(void){
         /*Configure UART*/
         EUSCI_A2->CTLW0 |= EUSCI_A_CTLW0_SWRST;                        /*PUT EUSCI IN RESET*/
         EUSCI_A2->CTLW0  = EUSCI_A_CTLW0_SWRST |                       /*REMAIN EUSCI IN RESET*/
                          EUSCI_B_CTLW0_SSEL__SMCLK;                    /*CONFIGURE EUSCI CLOCK SMCLK*/
         /*Baud Rate calculation
         *12000000/(16*9600) = 78.125
         *Fractional portion = 0.125
         *User's Guide Table 21-4: UCBRSx = 0x10
         *UCBRFx = int ( (78.125-78)*16) = 2
         */
         EUSCI_A2->BRW = 78;                                            /*12000000/16/9600*/
         EUSCI_A2->MCTLW = (2 << EUSCI_A_MCTLW_BRF_OFS) |
                           EUSCI_A_MCTLW_OS16;
         EUSCI_A2->CTLW0 &= ~(EUSCI_A_CTLW0_SWRST);                     /*INITIALIZE EUSCI*/
         EUSCI_A2->IFG   &= ~(EUSCI_A_IFG_RXIFG);
         EUSCI_A2->IE |= EUSCI_A_IE_RXIE;                               /*ENABLE THE UART RX INTERRUPT*/
    
    
         /*ENABLE GLOBAL INTERRUPT*/
         __enable_irq();
         /*ENABLE NVIC IN EUSCI_A2 INTERRUPT*/
         NVIC->ISER[0] = 1 << ((EUSCIA2_IRQn) & 31);
    
    }
    /*UART PORTS*/
    void confg_uart_wired(void){
         P3->SEL0 |= UART_TX | UART_RX;                                /*SET 2 UART PIN AS SECOND FUNCTION*/
    }
    /*UART CLOCK SYSTEM*/
    void uart_cs(void){
         CS->KEY  = CS_KEY_VAL;                                        /*UNLOCK CS MODULE REGISTER ACESS*/
         CS->CTL0 = 0;                                                 /*RESET TUNING PARAMETERS*/
         CS->CTL0 = CS_CTL0_DCORSEL_3;                                 /*SET DCO TO 12MHz (NOMINAL, CENTER OF 8-16MHz RANGE)*/
         CS->CTL1 = CS_CTL1_SELA_2 |                                   /*SELECT ACLK = REFO*/
                    CS_CTL1_SELS_3 |                                   /*SMCLK = DCO*/
                    CS_CTL1_SELM_3;                                    /*MCLK = DCO*/
         CS->KEY  = 0;
    }
    
    /*DELAY MILLISECONDS WHEN SYSTEM CLOCK IS AT 3MHz*/
    
    void delayMs(int n){
        int i, j;
        for(j= 0; j < n;j++);
            for(i= 750;i>0;i--);
    }
    
    /*UART COUNT CARACTERS SENT*/
    void uart_c_String(char *c){
    
        int i;
        for(i=0; c[i];i++){
           BUFFER_COUNT++;
        }
        uart_send(c, BUFFER_COUNT);
    }
    
    
    /*UART SEND MULTIPLE BYTES*/
    void uart_send(unsigned char *pucData, unsigned char ucLength){
    
        while(ucLength){
                /*WAIT FOR TX BUFFER TO BE READY FOR NEW DATA*/
                while(!(EUSCI_A2->IFG & EUSCI_A_IFG_TXIFG));           /*CHECK IF NOT SET*/
                /*IF SET, TX INTERRUPT IS PENDING*/
                EUSCI_A2->TXBUF = *pucData;                            /*PUSH DATA TO TX BUFFER*/
                ucLength--;                                            /*LENGTH OF DATA LEFT*/
                pucData++;                                             /*SHIFT POINTER*/
        }
        /*WAIT UNTIL THE LAST BYTE IS COMPLETELY SENT*/
        while(EUSCI_A2->STATW & EUSCI_A_STATW_BUSY);                   /*THIS INDICATE IF EUSCI IS SEND OR RECEIVE*/
    }
    
    /*UART GET MULTIPLE BYTES*/
    void uart_get(void){
        RX_Buffer[BUFFER_COUNT] = EUSCI_A2->RXBUF;
            if(++BUFFER_COUNT >= 2){
                BUFFER_COUNT = 0;
                EUSCI_A2->IFG &= ~(EUSCI_A_IFG_RXIFG);                 /*RESET RX flag*/
            }
    }
    
    
    void EUSCIA2_IRQHandler(void){
        if(EUSCI_A2->IFG & EUSCI_A_IFG_RXIFG){
                  uart_get();                                             /*LIGHT UP P2.1 LED ON RX*/
                  LED_PyOUT(G_LED);
        }
        if(EUSCI_A2->IFG & EUSCI_A_IFG_TXIFG){
                 EUSCI_A2->IFG &= ~(EUSCI_A_IFG_TXIFG);
                 LED_PyOUT(R_LED);                                        /*LIGHT UP P2.0 LED ON RX*/
        }
    }
    

    main.c

    void main(void){
        /*CLEAR ALL LED RGB*/
        LED_PxCLR(R_LED|G_LED|B_LED);
        LED_PyDIR(R_LED|G_LED|B_LED);
    
        WatchDogHold();
        uart_cs();
        confg_uart_wired();
        uart_init();
    
        uart_c_String("Hello World!");
        while(1){
    
        }
    }
    
    void WatchDogHold(void){
    WDTCTL = WDTPW | WDTHOLD;  /*STOP WATCHDOG TIMER*/
    }

  • > EUSCI_A2->IFG &= ~(EUSCI_A_IFG_RXIFG); /*RESET RX flag*/
    I (still) recommend that you not clear RXIFG this way. Reading RXBUF already cleared it atomically, and doing it this way is hazardous.
    > EUSCI_A2->IFG &= ~(EUSCI_A_IFG_TXIFG);
    You should not be doing this (ever), since it will stall your transmission. More generally: since you're not using interrupts for TX, your ISR shouldn't be looking at TXIFG at all -- you should remove that whole if() block.

    > char RX_Buffer[];
    If this is the only declaration, it declares a 0-byte buffer, and you're using 2 bytes in it. (I'm a little surprised the compiler didn't warn you about this.) Try:
    > char RX_Buffer[2]; // See also: constant 2 in uart_get()
  • Ok Bruce,
    I already done that you have you told me, but I have declare char RX_Buffer[], because in main a call for a function "uart_c_String()" where i pass the entire text I want sent, so this function count the characters and pass them to "uart_send()" function where dynamically, refill the buffer. Is this a bad practice?

    uart.c

    #include "msp.h"
    #include "uart.h"
    #include "main.h"
    #include <stdint.h>
    #include <stdio.h>
    
    char RX_Buffer[2];
    int BUFFER_COUNT = 0;
    
    /*UART CONFIGURATION*/
    void uart_init(void){
         /*Configure UART*/
         EUSCI_A2->CTLW0 |= EUSCI_A_CTLW0_SWRST;                        /*PUT EUSCI IN RESET*/
         EUSCI_A2->CTLW0  = EUSCI_A_CTLW0_SWRST |                       /*REMAIN EUSCI IN RESET*/
                          EUSCI_B_CTLW0_SSEL__SMCLK;                    /*CONFIGURE EUSCI CLOCK SMCLK*/
         /*Baud Rate calculation
         *12000000/(16*9600) = 78.125
         *Fractional portion = 0.125
         *User's Guide Table 21-4: UCBRSx = 0x10
         *UCBRFx = int ( (78.125-78)*16) = 2
         */
         EUSCI_A2->BRW = 78;                                            /*12000000/16/9600*/
         EUSCI_A2->MCTLW = (2 << EUSCI_A_MCTLW_BRF_OFS) |
                           EUSCI_A_MCTLW_OS16;
         EUSCI_A2->CTLW0 &= ~(EUSCI_A_CTLW0_SWRST);                     /*INITIALIZE EUSCI*/
         EUSCI_A2->IFG   &= ~(EUSCI_A_IFG_RXIFG);
         EUSCI_A2->IE |= EUSCI_A_IE_RXIE;                               /*ENABLE THE UART RX INTERRUPT*/
    
    
         /*ENABLE GLOBAL INTERRUPT*/
         __enable_irq();
         /*ENABLE NVIC IN EUSCI_A2 INTERRUPT*/
         NVIC->ISER[0] = 1 << ((EUSCIA2_IRQn) & 31);
    
    }
    /*UART PORTS*/
    void confg_uart_wired(void){
         P3->SEL0 |= UART_TX | UART_RX;                                /*SET 2 UART PIN AS SECOND FUNCTION*/
    }
    /*UART CLOCK SYSTEM*/
    void uart_cs(void){
         CS->KEY  = CS_KEY_VAL;                                        /*UNLOCK CS MODULE REGISTER ACESS*/
         CS->CTL0 = 0;                                                 /*RESET TUNING PARAMETERS*/
         CS->CTL0 = CS_CTL0_DCORSEL_3;                                 /*SET DCO TO 12MHz (NOMINAL, CENTER OF 8-16MHz RANGE)*/
         CS->CTL1 = CS_CTL1_SELA_2 |                                   /*SELECT ACLK = REFO*/
                    CS_CTL1_SELS_3 |                                   /*SMCLK = DCO*/
                    CS_CTL1_SELM_3;                                    /*MCLK = DCO*/
         CS->KEY  = 0;
    }
    
    /*DELAY MILLISECONDS WHEN SYSTEM CLOCK IS AT 3MHz*/
    
    void delayMs(int n){
        int i, j;
        for(j= 0; j < n;j++);
            for(i= 750;i>0;i--);
    }
    
    /*UART COUNT CARACTERS SENT*/
    void uart_c_String(char *c){
        int i;
        for(i=0; c[i];i++){
           BUFFER_COUNT++;
        }
        uart_send(c, BUFFER_COUNT);
    }
    
    
    /*UART SEND MULTIPLE BYTES*/
    void uart_send(unsigned char *pucData, unsigned char ucLength){
    
        while(ucLength){
                /*WAIT FOR TX BUFFER TO BE READY FOR NEW DATA*/
                while(!(EUSCI_A2->IFG & EUSCI_A_IFG_TXIFG));           /*CHECK IF NOT SET*/
                /*IF SET, TX INTERRUPT IS PENDING*/
                EUSCI_A2->TXBUF = *pucData;                            /*PUSH DATA TO TX BUFFER*/
                ucLength--;                                            /*LENGTH OF DATA LEFT*/
                pucData++;                                             /*SHIFT POINTER*/
        }
        /*WAIT UNTIL THE LAST BYTE IS COMPLETELY SENT*/
        while(EUSCI_A2->STATW & EUSCI_A_STATW_BUSY);                   /*THIS INDICATE IF EUSCI IS SEND OR RECEIVE*/
    }
    
    /*UART GET MULTIPLE BYTES*/
    void uart_get(void){
        RX_Buffer[BUFFER_COUNT] = EUSCI_A2->RXBUF;
            if(++BUFFER_COUNT >= 2){
                BUFFER_COUNT = 0;
            }
    }
    
    
    void EUSCIA2_IRQHandler(void){
        if(EUSCI_A2->IFG & EUSCI_A_IFG_RXIFG){
            LED_PyOUT(G_LED);
            uart_get();
    
        }
    }
    
    

  • I didn't say not to declare it, but just that "If this is the only declaration" it needs to have a size provided (which you've done).

    So what does it do when you run it?
  • Bruce, 

    I have done some alterations and the characters  sent by the serial are the same as those that are counted in the bluetooth terminal

    uart.c

    char input[100];
    unsigned int RXByteCtr = 0;
    /*UART CONFIGURATION*/
    void uart_init(void){
         /*Configure UART*/
         EUSCI_A2->CTLW0 |= EUSCI_A_CTLW0_SWRST;                        /*PUT EUSCI IN RESET*/
         EUSCI_A2->CTLW0  = EUSCI_A_CTLW0_SWRST |                       /*REMAIN EUSCI IN RESET*/
                            EUSCI_A_CTLW0_MODE_0|
                            EUSCI_A_CTLW0_SSEL__SMCLK;                  /*CONFIGURE EUSCI CLOCK SMCLK*/
         /*Baud Rate calculation
         *12000000/(16*115200) = 78.125
         *Fractional portion = 0.125
         *User's Guide Table 21-4: UCBRSx = 0x10
         *UCBRFx = int ( (78.125-78)*16) = 2
         */
         EUSCI_A2->BRW = 6;                                            /*12000000/16/9600*/
         EUSCI_A2->MCTLW = (8 << EUSCI_A_MCTLW_BRF_OFS) |
                           EUSCI_A_MCTLW_OS16;
         EUSCI_A2->CTLW0 &= ~(EUSCI_A_CTLW0_SWRST);                     /*INITIALIZE EUSCI*/
         EUSCI_A2->IFG   &= ~(EUSCI_A_IFG_RXIFG);
         EUSCI_A2->IE    |= EUSCI_A_IE_RXIE;                            /*ENABLE THE UART RX INTERRUPT*/
    
    
         /*ENABLE GLOBAL INTERRUPT*/
         __enable_irq();
         /*ENABLE NVIC IN EUSCI_A2 INTERRUPT*/
         NVIC->ISER[0] = 1 << ((EUSCIA2_IRQn) & 31);
    
    }
    /*UART PORTS*/
    void confg_uart_wired(void){
         P3->SEL0 |= UART_TX | UART_RX;                                /*SET 2 UART PIN AS SECOND FUNCTION*/
    }
    /*UART CLOCK SYSTEM*/
    void uart_cs(void){
         CS->KEY  = CS_KEY_VAL;                                        /*UNLOCK CS MODULE REGISTER ACESS*/
         CS->CTL0 = 0;                                                 /*RESET TUNING PARAMETERS*/
         CS->CTL0 = CS_CTL0_DCORSEL_3;                                 /*SET DCO TO 12MHz (NOMINAL, CENTER OF 8-16MHz RANGE)*/
         CS->CTL1 = CS_CTL1_SELA_2 |                                   /*SELECT ACLK = REFO*/
                    CS_CTL1_SELS_3 |                                   /*SMCLK = DCO*/
                    CS_CTL1_SELM_3;                                    /*MCLK = DCO*/
         CS->KEY  = 0;
    }
    
    /*DELAY MILLISECONDS WHEN SYSTEM CLOCK IS AT 3MHz*/
    
    void delayMs(int n){
        int i, j;
        for(j= 0; j < n;j++);
            for(i= 750;i>0;i--);
    }
    
    void uart_transmit(const char *str) {
        while (*str != 0) { //Do this during current element is not
            //equal to null character
            while (!(EUSCI_A2->IFG & EUSCI_A_IFG_TXIFG));
            //Ensure that transmit interrupt flag is set
            EUSCI_A2->TXBUF = *str++;
            //Load UCA0TXBUF with current string element
            printf("%c",EUSCI_A2->TXBUF);
        }
    
    }
    
    
    void EUSCIA2_IRQHandler(void){
        if(EUSCI_A2->IFG & EUSCI_A_IFG_RXIFG){
            input[RXByteCtr++] = EUSCI_A2->RXBUF;
            LED_PyOUT(G_LED);
        }
    }
    

    main.c

    const char correct[] = "Your password is correct\n";
    
    void main(void){
        /*CLEAR ALL LED RGB*/
        LED_PxCLR(R_LED|G_LED|B_LED);
        LED_PyDIR(R_LED|G_LED|B_LED);
    
        WatchDogHold();
        uart_cs();
        confg_uart_wired();
        uart_init();
    
        uart_transmit(correct);
        while(1){
        }
    }
    
    void WatchDogHold(void){
    WDTCTL = WDTPW | WDTHOLD;  /*STOP WATCHDOG TIMER*/
    }

    result:

  • So, um, is that a success? (I'm not quite sure what I'm looking at.)
  • No Bruce, I can not get the data correctly on the device, can you give me some tips.

    I'm completely lost I do not know what to do

  • I don't see your definitions for UART_RX and UART_TX here. They should look something like:
    > #define UART_RX BIT2 // P3.2 (UCA2RXD)
    > #define UART_TX BIT3 // P3.3 (UCA2TXD)
  • Hello Bruce,

    all definitions, and functions prototypes are defined in uart.h header file. 

  • You have uart.h and we don't. Do those definitions look right?
  • yes the definitions are right...

    uart.h

    #ifndef UART_H_
    #define UART_H_
    
    /*DEFINE*/
    #define UART_TX BIT3
    #define UART_RX BIT2
    
    void uart_init(void);
    void confg_uart_wired(void);
    void uart_cs(void);
    
    
    
    #endif /* UART_H_ */
    

  • When I took your source and (1) dummied the LED functions (2) provided those UART definitions and (3) jumpered P3.2/3 to the Launchpad "bridge" header (J101), I received your message just fine using a PC with PuTTY.

    That suggests that the trouble is in (a) the LED functions or (b) something external, e.g. wiring or maybe the configuration of your Bluetooth module. I'm not in a position to check those things.
  • Bruce  i share with you the main.h, there is where that functions are...

    main.h

    #ifndef MAIN_H_
    #define MAIN_H_
    
    void WatchDogHold(void);
    
    /*LED PIN CONFIGURATION*/
    #define LED_PxOUT  P2->OUT
    #define LED_PxDIR  P2->DIR
    #define LED_PxCLR(x)  LED_PxOUT &= ~(x & 0x00FF)
    #define LED_PxSET(x)  LED_PxOUT |=  (x & 0x00FF)
    #define LED_PyDIR(x)  LED_PxDIR |=  (x & 0x00FF)
    #define LED_PyOUT(x)  LED_PxOUT ^=  (x & 0x00FF)
    
    #define R_LED    BIT0                       /*RED LED*/
    #define G_LED    BIT1                       /*GREEN LED*/
    #define B_LED    BIT2                       /*BLUE LED*/
    
    #endif /* MAIN_H_ */
    

  • The LED definitions look pretty innocent. (I would suggest putting parentheses around the "x", but that's not causing you trouble here.)

    I think that leaves: (b) something external. The next step would be to check (again) your wiring and your BT module configuration.
  • You can also try just what I did: Feed P3.2/3 through a USB chip to a PC with your favorite terminal program. That result ought to tell you where to look further.
  • Armando,

     A couple of suggestions:

    1. Regarding Bruce's suggestion of routing P3.2/3 to a USB chip. You don't need a separate chip if you have an MSP432 LaunchPad.  The JTAG emulator built-in to the board also provides a backchannel UART through its USB cable .  You'll need to remove the existing jumpers on J101's RXD and TXD pins and connect your P3.2/3 to the pins (in the yellow box in the picture below)
      1. Once properly connected, you can use a terminal emulator (like TeraTerm) to connect to the appropriate COM port. See the picture below and select the "Application/User UART"
    2. An alternative is to directly connect the LaunchPad's RXD/TXD pins (in the yellow box) to your Bluetooth board and see if they function correctly when driven in this way.

    Hope that helps.

    -Bob L.

  • Bruce an Bob thank you for your advices,

    have realized the changes they told me but I did not get results, I think my problem is the data sending function and reception, connected interruptions, I think it is not well done, 

**Attention** This is a public forum