Actually I want to simply send Hex value to the UART Pin.. for experiment purpose.
Now when I run the below code, it prints several ones and twos and the occasional < character, like so:
11111111111111222222222222<, etc.
Help me to solve out this issue.
Please do needful.
#include <msp430.h>
#define INT 0x41;
void Init_GPIO();
int main(void)
{
WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer
// Configure GPIO
P1DIR = 0xFF; P2DIR = 0xFF;
P1REN = 0xFF; P2REN = 0xFF;
P1OUT = 0x00; P2OUT = 0x00;
PM5CTL0 &= ~LOCKLPM5; // Disable the GPIO power-on default high-impedance mode
// to activate 1previously configured port settings
// Configure UART pins
P1SEL0 |= BIT6 | BIT7; // set 2-UART pin as second function
// Configure UART
UCA0CTLW0 |= UCSWRST + UCPEN_0 + UCSYNC_0 + UC7BIT_0 + UCSPB_0 + UCMODE_0;
UCA0CTLW0 |= UCSSEL_1; // set ACLK as BRCLK
// Baud Rate calculation. Referred to UG 17.3.10
// (1) N=32768/4800=6.827
// (2) OS16=0, UCBRx=INT(N)=6
// (4) Fractional portion = 0.827. Refered to UG Table 17-4, UCBRSx=0xEE.
UCA0BR0 = 3; // INT(32768/4800)
UCA0BR1 = 0x00;
UCA0MCTLW = 0x92 + UCOS16_0;
UCA0CTLW0 &= ~UCSWRST; // Initialize eUSCI
UCA0IE |= UCTXIE; // Enable USCI_A0 RX interrupt
while(1)
{
UCA0TXBUF = INT;
__delay_cycles(1000000);
//__bis_SR_register( GIE); // Enter LPM0, interrupts enabled
// UCA0TXBUF = '\0';
}
}