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/EVM430-FR6047: Trying to get UART in CCS terminal

Part Number: EVM430-FR6047

Tool/software: Code Composer Studio

I am attempting to get the EVM430-FR6047 to transmit UART data to my PC, preferably viewable in the terminal from code composer studio. I am using the MSP430FR6047EVM_USS_Water_Demo software and have successfully found the header file to activate UART. I also have the pins populated as per instructions in hardware guide. I can see the UART1 in my device manager and have been successfully using the EVM using the I2C protocol and the design center desktop software.

I found in the hal_uart.h file that the default baudrate is 57600, I have tried this when connecting with terminal but still nothing shows up. I have left all the other settings to their defaults. My guess is this may be my problem. It seems like this is something is clearly supposed to work, as per reading all the documentation, I am probably just making some bone head mistake.

Thanks so much for the help.

  • Hey Zachary,

    I am looking into this and will provide information as soon as I can.

    Thanks!

    -Mitch
  • Thanks Mitch.
    You guys are awesome. We will be standing by,

    -Zach
  • Hey Zach,

    There is functionality built into the SW to do what you are trying to do - there are just a few things you need to alter in the code to get it working.
    The first thing you'll need to do is initialize the UART channel by calling the "hal_uart_Init()" function (found in hal_uart.c).
    Next, in order to transmit UART data to the PC, call the "hal_uart_TxByte()" function with whatever data you want to send. Make sure the JTAG UART headers are populated and you should be good to go!

    Thanks,

    Mitch
  • Unfortunately I a still having trouble,

    Here is my configuration:

    I switched to COMM_UART in the comm_config.h file.

    //!
    #define COMM_NONE (0)
    
    //! \def UART Serial Interface
    //!
    #define COMM_UART (1)
    
    //! \def I2C Slave Serial Interface
    //!
    #define COMM_I2CSLAVE (2)
    
    //! \def Serial communication interface selection.  Set this to one of the valid
    //!      interfaces or COMM_NONE to disable the COMM module.
    //!
    #define COMM_SERIAL_INTERFACE (COMM_UART)

    And I attempted to follow your instructions by modifying the main.c

    void main(void)
    {
        uint16_t reset_source = 0x00;
    
        // Initializes the basic functionality of the system
        hal_system_Init();
    
    
    
        // Initialize interfaces to user including buttons, LCD, GUI
        HMI_Init();
    
        // Verify the reset source and log/report if there was an error
        reset_source = hal_system_GetResetSource();
        if(reset_source != 0x00)
        {
            USSLibGUIApp_send_error(COMMAND_HANDLER_ERROR_FAULT_RESET_ERROR,
                                    reset_source);
        }
    
        __enable_interrupt();
    
        // Initialize the USS Lib
        USSLibGUIApp_Init();
    
        // This is the Design Centers Main Loop
        USSLibGUIApp_Engine();
    
        //Initialize UART
        hal_uart_Init();
    
    
        //Continuously transmit
        while (1==1){
        hal_uart_TxByte(1);
        }
    }

    Lastly, I attempt to connect using the built in terminal with the following parameters,

    Unfortunately this results in a blank terminal window:

    Once again, I can get the Design center working great if I leave the default I2C setting in the comm_config.h file. Obviously I want to eventually transmit the water flow rate and perhaps other (ToF) parameters instead of the integer 1, but I am just trying to get moving. Apologies in advance for whatever bone headed thing I am forgetting, I really appreciate the help.

    -Zach.

  • Hey Zach!

    I'm so sorry for the late response - the notification must have slipped right by me when you posted this.

    You won't need to switch COMM_UART in the comm_config.h file. Go ahead and switch that back to COMM_I2CSLAVE. This is strictly for communication with the USS GUI - this will not allow you to transmit data to the terminal.

    The rest of the SW looks good - you are initializing the other UART channel and are using the correct function to transmit a byte.

    One thing I see is that you may not be powering the board. You will want to make sure J1 is populated with with a header (shown below) if you are powering the board with a USB cable.

    Another thing I would ask you to check is the COM port. When you plug the board into the PC, go to device manager and look for "ports". Expand this and look for what COM port "MSP Application UART1" is assigned to. This is the COM port you will want to select in the terminal in CCS. The rest of the terminal configurations looks good.

    Also, remove the RX and TX jumpers on the J5 headers. Since we are using I2C to communicate with the GUI, you will not need those, and they might cause issues with the other UART channel.

    Please let me know if this helps!

    -Mitch

  • Thanks Mitch!

    I was feeling kind of lonely so I started working on using I2C as a protocol instead. I would much prefer UART as I have some distance to travel with my signal. I did get I2C talking by interfacing with my PC, but as I said, I would rather be using UART.

    Your message seemed to indicate that the main problem is probably with the header configuration of my board. I added the extra header as you suggested and double checked that the power switch is in the middle position.

    Here is my latest board configuration:

    Also, here is a screen shot from Device manager showing the UART1

    I also reverted back the comm_config.h file to its original state.

    I connected again with the exact same settings shown in my last post. Unfortunately their is still nothing showing in the terminal.

    Thanks so much for helping my team and I out on this. It seems like it is probably something very simple and I am just to bone headed to figure it out. We really appreciate you guys.

    -Zach.

  • Hey Zach,

    There is a while(1) loop in the USSLibGUIAppEngine() routine. The code you put after the USSLibGUIAppEngine() routine in main is not getting called. Call hal_uart_Init() any time before USSLibGUIAppEngine(), and then call hal_uart_TxByte(1) in the while(1) loop in USSLibGUIAppEngine(). Let me know if this works!

    -Mitch
  • You will also want to have hal_uart_TxByte('1') instead of hal_uart_TxByte(1)
  • You Sir, are a Genius. That was the problem, it now works. Massive thank you. I feel slightly less than brilliant for not thinking of the infinite for loop issue, but sometimes we just get blind.

    Mitch, you really made my day.

    Sincerely,

    Zach.