Hi,
I am trying to print the sensor values in the UART terminal, I can able to print the values using print in debugging mode. But, I wanted to print the values in the UART terminal for real-time monitoring.
I am able to print the char 'A' and string, But, I can't print the integer sensor values in Terminal. I am using the driver lib Library in my code.
Clock setting is:
//Set DCO frequency to 1 MHz
CS_setDCOFreq(CS_DCORSEL_0,CS_DCOFSEL_0);
//Set external clock frequency to 32.768 KHz
CS_setExternalClockSource(32768,0);
//Set ACLK=LFXT
CS_initClockSignal(CS_ACLK,CS_LFXTCLK_SELECT,CS_CLOCK_DIVIDER_1);
//Set SMCLK = DCO with frequency divider of 1
CS_initClockSignal(CS_SMCLK,CS_DCOCLK_SELECT,CS_CLOCK_DIVIDER_1);
//Set MCLK = DCO with frequency divider of 1
CS_initClockSignal(CS_MCLK,CS_DCOCLK_SELECT,CS_CLOCK_DIVIDER_1);
//Start XT1 with no time out
CS_turnOnLFXT(CS_LFXT_DRIVE_0);
EUSCI_A_UART_initParam param = {0};
param.selectClockSource = EUSCI_A_UART_CLOCKSOURCE_SMCLK; // EUSCI_A_UART_CLOCKSOURCE_SMCLK; //EUSCI_A_UART_CLOCKSOURCE_ACLK;
param.clockPrescalar = 8; // 115200-8 9600-3;
param.firstModReg = 0;
param.secondModReg = 214; //115200-214; 9600-92;
param.parity = EUSCI_A_UART_NO_PARITY;
param.msborLsbFirst = EUSCI_A_UART_LSB_FIRST;
param.numberofStopBits = EUSCI_A_UART_ONE_STOP_BIT;
param.uartMode = EUSCI_A_UART_MODE;
param.overSampling = EUSCI_A_UART_LOW_FREQUENCY_BAUDRATE_GENERATION;
Please let me know where I did wrong.