Part Number:MSP430FR4133
Tool/software: Code Composer Studio
Hi
I am new to CCS, and I am having trouble in configuration/ initialization of UART. I referred slau445g for initiating the registers.
My primary aim is to transmit a single byte/ buffer(if possible) to comp port, attaching code for persual. Any help would be really appriciated.
//#include <classic.h>
#include <msp430.h>
#define DELAY 10000
unsigned int txint=12;
void txdata(unsigned int txint){
//UCA0IFG |= 0x02;
//while(UCA0TXIFG)
UCA0TXBUF = 0x01;
}
void init_uart(void){
P1SEL0 |=(BIT0 |BIT1);
UCA0CTLW0 |= UCSWRST;
UCA0CTLW0 |= UCSSEL__SMCLK;
UCA0BR0 = 104; // 16000000/16*9600
UCBRSx=0x49;
UCA0BR1 = 0x00;
UCA0MCTLW = UCOS16 | UCBRF_1;
UCA0CTLW0 &= ~UCSWRST;
UCA0IE |= UCRXIE;
RTCCTL &= ~RTCIE;
}
void init_delay(int l){
int i;
for(i=0;i>l;i++);
}
int main(void) {
WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer
init_uart();
while(1)
{
txdata(txint);
init_delay(DELAY);
}
}
Thank you