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: Unable to send a single character through UART A0

Part Number: MSP432P401R
Other Parts Discussed in Thread: MAX232

Tool/software: Code Composer Studio

Hi,
I am using MSP432P401R Launchpad. I am learning to use the UART driver library. I have connected the Launchpad to the PC using the RS232 Serial to USB Cable and tryng to receive a character continuously on the Hyperterminal
Since i am using UART Module A0, I have connected the the Rx and Tx pins from the J101 to the DB9 connecter of the Serial to USB connecter. Below is my trial code, in which I am trying to send alphabet U continously from the launchpad to Hyperterminal software.

#include "driverlib.h"
#include <msp.h>

const eUSCI_UART_Config uartConfig =
{
EUSCI_A_UART_CLOCKSOURCE_SMCLK, // SMCLK Clock Source
72, // BRDIV = 78
2, // UCxBRF = 2
0, // UCxBRS = 0
EUSCI_A_UART_NO_PARITY, // No Parity
EUSCI_A_UART_LSB_FIRST, // MSB 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 */
WDT_A_holdTimer();


/* Configure pins P1.2 and P1.3 in UART mode.
* Doesn't matter if they are set to inputs or outputs
*/
GPIO_setAsPeripheralModuleFunctionInputPin(GPIO_PORT_P1,
GPIO_PIN1|GPIO_PIN2 | GPIO_PIN3, GPIO_PRIMARY_MODULE_FUNCTION);

/* Setting DCO (clock) to 12MHz */
CS_setDCOCenteredFrequency(CS_DCO_FREQUENCY_12);

/* Configuring UART Module */
UART_initModule(EUSCI_A0_BASE, &uartConfig);

/* Enable UART module */
UART_enableModule(EUSCI_A0_BASE);

while(1)
{
/* Send the 'g' character over UART */
UART_transmitData(EUSCI_A0_BASE,"U");
}
}

The problem I am facing is that on the hyperterminal, I am receiving garbage value. I have tried it with different characters, numbers and even unsigned integers but the issue is the same. Also tried by applying different Baudrates at the terminal software other than 9600, although launchpad is set at 9600. but the problem remains the same.

I have also tried to use the back channel UART feature of the debug probe along with the terminal application present in the CCS. In that case no data or garbage value was received.

Any help or Suggestions.

Regards,

Amit K

  • Amit,

    Let's sanity check a few things first.

    1. Are you using a red Launchpad? This has the latest MSP432P401R , Revision C device which is required to work with the latest examples.
    2. Can you use an "out of the box" example to establish functionality? The example you have here has been modified, which is ok but I'd like you to get started with a "known" set of hardware + software. Your easiest path to getting the latest examples is to use dev.ti.com --> resource explorer --> software --> Simplelink MSP42 SDK --> examples --> Dev tools--> MSP-EXP--> Driverlib
    Select the "uart_pc_echo_12MHz_brclk" example.
    3. you can either paste this code into your desktop CCS or run the example from the cloud.
    4. Connect LP to PC and use hyperterminal software to send/ rx bytes.

    This example has been validated to work.
    If you can get it to work on your red Launchpad, then we have a known good starting point & we can guide you through changes from there on.

    Regards,
    Priya
  • Quick edit to add, that you have the right jumper selection in J101 RXD, TXD. However I need to double check if this is connected to the launch pad's standard UART connection. Let me get back to you on this.
  • Hey Priya , thanks for you prompt reply. I would like to let you know that I am using the Red Launchpad and the issue is nothing with the Launchpad UART because I have already tested the UART with sending Data and Viewing the Same on the Terminal Software. It all works fine and no issue with the UART communication.

    The issue is with GSM module Communication, may be the synatax of posting the data over HTTP.

    Any help regarding it
  • Glad you have the setup working. I think the rest of it may be beyond my expertise. UART in general is a very straight forward peripheral.
    If you have the hardware working, baud rate and clock selection setup correctly, correct pins tied & the right LPMs it should just work.

    I saw in your code example you had changed BRDIV but not the clock setting.
    What baud rate, clock source are you trying to use?

    -Priya
  • Hi, Thanks for your help. Actually I was confused with the other forum Question I have asked. The issue mentioned in this forum has been sorted out. And the solution of the problem was that I was not using a MAX232 Level Converter Between the PC and the MSP432.

    Sorry for misguiding and Appreciate all your efforts
  • no problem! thanks for closing out with us.

**Attention** This is a public forum