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.

MSP430FR2355: MSP‑EXP430FR2355 (MSP Application UART) configured with even parity

Part Number: MSP430FR2355

Using code on the MSP430FR2355 to send messages to a PC terminal program via the MSP Application UART set to 9600 8N1 works

Changing the MSP and the terminal program settings to 9600 8E1(even parity). some characters sent do not appear eg '3' , '5'

With the same code on the MSP that does not work with even parity on the "MSP Application UART" using a USB to serial cable(FTDI) works reliable.

---------------------------

I then tested "MSP Application UART" to "USB to serial cable(FTDI)" using two terminal windows on the PC.

settings 9600 8N1 works

setting 9600 8E1 misses some characters when sending from the FTDI to the ""MSP Application UART"  eg '3' , '5' same as original issue.

----------------------------

It seems on the development board MSP‑EXP430FR2355 using even parity on the "MSP Application UART" does not work reliable (possible bug).

 

  • Hi Daniel,

    Which code do you use? I can test in my side.

    Thanks!

    Best Regards

    Johnson

  • Hi,

    I have attached code that demonstrate the issue on an MSP‑EXP430FR2355

    #include "driverlib.h"

    #define CS_MCLK_DESIRED_FREQUENCY_IN_KHZ    ( 8000U)
    #define CS_MCLK_FLLREF_RATIO                ( CS_MCLK_DESIRED_FREQUENCY_IN_KHZ/32.768 )

    uint8_t data[]  = "01234567\n";
    uint8_t RXData = 0;
    uint8_t done = 0;

    void main(void)
    {
        //Stop Watchdog Timer
        WDT_A_hold(WDT_A_BASE);

        CS_initClockSignal(CS_FLLREF, CS_REFOCLK_SELECT, CS_CLOCK_DIVIDER_1);

        //Set ACLK = REFOCLK (internal 32khz RC)
        CS_initClockSignal(CS_ACLK, CS_REFOCLK_SELECT, CS_CLOCK_DIVIDER_1);

        CS_initFLLSettle(CS_MCLK_DESIRED_FREQUENCY_IN_KHZ, CS_MCLK_FLLREF_RATIO);
        //Set SMCLK = DCO
        CS_initClockSignal(CS_SMCLK, CS_DCOCLKDIV_SELECT, CS_CLOCK_DIVIDER_1);
        //Set MCLK = DCO
        CS_initClockSignal(CS_MCLK, CS_DCOCLKDIV_SELECT, CS_CLOCK_DIVIDER_1);

        /* Setup the IO pins for the UART */
        GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P4, GPIO_PIN2, GPIO_PRIMARY_MODULE_FUNCTION);
        GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_P4, GPIO_PIN3, GPIO_PRIMARY_MODULE_FUNCTION);

        PMM_unlockLPM5();

        EUSCI_A_UART_initParam params = { 0 };

        /* The operating parameters of the UART */
        params.selectClockSource = EUSCI_A_UART_CLOCKSOURCE_SMCLK;
       // params.parity = EUSCI_A_UART_NO_PARITY; // No parity all characters printed '01234567\n
        params.parity = EUSCI_A_UART_EVEN_PARITY;  // Even parity only '1247' printed on terminal
        params.msborLsbFirst = EUSCI_A_UART_LSB_FIRST;
        params.numberofStopBits = EUSCI_A_UART_ONE_STOP_BIT;
        params.uartMode = EUSCI_A_UART_MODE;

        /* As generated from
         * EUSCI
         * 8MHz Clock
         * 9600 baud
         */
        params.clockPrescalar = 52;
        params.firstModReg = 1;
        params.secondModReg = 73;
        params.overSampling = EUSCI_A_UART_OVERSAMPLING_BAUDRATE_GENERATION;

        EUSCI_A_UART_init(EUSCI_A1_BASE, &params);

        EUSCI_A_UART_enable(EUSCI_A1_BASE);

        EUSCI_A_UART_enableInterrupt(EUSCI_A1_BASE, EUSCI_A_UART_RECEIVE_INTERRUPT);
        EUSCI_A_UART_enableInterrupt(EUSCI_A1_BASE, EUSCI_A_UART_TRANSMIT_INTERRUPT);

        // Enable global interrupts
        __enable_interrupt();
        uint16_t i = 0;

        while (1)
        {
            // Load data onto buffer
            EUSCI_A_UART_transmitData(EUSCI_A1_BASE, data[i]);
            while(done != 1);
            done = 0;

            i++;
            if(i >= sizeof(data) - 1)
            {
                i = 0;
            }
        }
    }
    //******************************************************************************
    //
    //This is the USCI_A1 interrupt vector service routine.
    //
    //******************************************************************************
    #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
    #pragma vector=USCI_A1_VECTOR
    __interrupt
    #elif defined(__GNUC__)
    __attribute__((interrupt(USCI_A1_VECTOR)))
    #endif
    void EUSCI_A1_ISR(void)
    {
        switch(__even_in_range(UCA1IV,USCI_UART_UCTXCPTIFG))
        {
            case USCI_NONE: break;
            case USCI_UART_UCRXIFG:
                RXData = EUSCI_A_UART_receiveData(EUSCI_A1_BASE);
                break;
           case USCI_UART_UCTXIFG:
               done = 1;
               break;
           case USCI_UART_UCSTTIFG: break;
           case USCI_UART_UCTXCPTIFG: break;
        }
    }


  • Hi Daniel,

    I will do some test and get back.

    Thanks!

    Best Regards

    Johnson

  • Hi Daniel,

    I did some test in my side, and using a logic analysis to capture this waveform.

    The result shows normal.

    Thanks!

    Best Regards

    Johnson

  • Hi daniel,

    I find the root cause, ez-FET bridge don't support EVEN default, thus you will loss some data, you need set the baud to 9625 in PC GUI and send any data to set the bridge to EVEN mode, then you can receive normal data.

    Thanks!

    Best Regards

    Johnson

  • Hi, 

    Thanks for your help this seem to resolve the issue.

    This limitation is not mention  MSPEXP430FR2355 user guide(UART section). It would be useful to mention that odd parity is not supported and even parity is not supported in the usual way by terminal applications.

**Attention** This is a public forum