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.

MSP430FR2533: Send a bit over UART for testing

Part Number: MSP430FR2533
Other Parts Discussed in Thread: MSP430FR2355, MSP430FR2433

Hello, first off sorry for the low level of the question. I want to test using an oscilloscope if my MSP430FR2533 is able to send a bit via UART. I therefore hooked up the pins 1.6 and 1.7 (acording to https://www.ti.com/lit/ug/slau680/slau680.pdf?ts=1664383334483  page 26 and https://www.ti.com/lit/ds/slasec4d/slasec4d.pdf?ts=1664451907348 page 76) to the oscilloscope and wrote this code:

#include <msp430.h>
#include <driverlib.h>
#include "eusci_a_uart.h"
char test = 0x42;
volatile uint32_t i;

void main(void) {
    // Stop watch dog timer
        WDT_A_hold(WDT_A_BASE);
        PMM_unlockLPM5();
    UCA0CTLW0 |= UCSWRST;
   // GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P1, GPIO_PIN7,
     //   GPIO_SECONDARY_MODULE_FUNCTION);
       // GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P1, GPIO_PIN6,
        //GPIO_SECONDARY_MODULE_FUNCTION);
    EUSCI_A_UART_initParam eUSCI_initParam = {
        EUSCI_A_UART_CLOCKSOURCE_SMCLK, // selectClockSource
                6, // clockPrescalar UCBRx
                8, // firstModReg UCBRFx
                17, // secondModReg UCBRSx
                EUSCI_A_UART_NO_PARITY, EUSCI_A_UART_MSB_FIRST,
                EUSCI_A_UART_ONE_STOP_BIT, EUSCI_A_UART_AUTOMATIC_BAUDRATE_DETECTION_MODE,
                EUSCI_A_UART_OVERSAMPLING_BAUDRATE_GENERATION };



    EUSCI_A_UART_init(EUSCI_A0_BASE, &eUSCI_initParam);
    EUSCI_A_UART_enable(EUSCI_A0_BASE);
    EUSCI_A_UART_enableInterrupt(EUSCI_A0_BASE,
            EUSCI_A_UART_RECEIVE_INTERRUPT);

    while(1)
    {
        EUSCI_A_UART_transmitData(EUSCI_A0_BASE, test);

        for (i = 0; i<100000000; ++i);
    }
}

However, I cant read any signal with the oscilloscope. Is there anythingwrong with the init() or the enable function?

Once again, I am sorry for such a stupid question, but i wasnt really able to find what i really need after a long search on the internet.

Thank you, Julius

  • Hi Julius,

    There are no stupid questions, you are welcome to ask away!

    One point of clarification--based on the documentation you have linked in your question, you are using the MSP430FR2355, not the MSP430FR2533.

    Your use of P1.6 and P1.7 is correct, but I would recommend some resources for your code as there are a few things missing:

    • Take a look at this code for the FR2355, which has a similar function to what you are working on and allows you to test UART using a logic analyzer/oscilloscope. If you want an in-depth explanation of the code, refer to the UART MSP Academy (keep in mind that the MSP Academy code example is written for the MSP430FR2433, not the FR2355, so the actual code might be slightly different).
    • Additionally, you are using the driverlib's API, whereas the code I have provided is register level code, so you will have to modify it using driverlib functions. This driverlib user guide might be helpful or this similar UART code using driverlib.

    Hope this helps,

    Amruta Deole

**Attention** This is a public forum