Part Number:MSP432P401R
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