Hi,
I'm trying to send fixed data to PC using UART. I just want to receive data from msp430. Now I guess there may be two things I'm doing wrong.
1. I have launchpad Rev 1.4 and I'm using msp430g2553 on it. I set the J3's TxD and RxD pin vertical as suggested by some posts.
2. Here is my code. In the code I'm writing fixed data to UCA0TXBUF=0x45 and checking the TXIFG flag to see if the data is sent or not. If its sent then LED will be on.
I'm not getting anything on my PC. I tried using putty.
#include <msp430.h> /* * main.c */ void main(void) { WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer DCOCTL = 0; BCSCTL1 = CALBC1_1MHZ; DCOCTL = CALBC1_1MHZ; P1DIR = BIT6; P1OUT &=~BIT6; P1SEL |= BIT1 + BIT2 ; // P1.1 = RXD, P1.2=TXD P1SEL2 |= BIT1 + BIT2 ; // P1.1 = RXD, P1.2=TXD UCA0CTL1 |= UCSSEL_2; // SMCLK UCA0BR0 = 104; // 1MHz 9600 UCA0BR1 = 0; // 1MHz 9600 UCA0MCTL = UCBRS0; // Modulation UCBRSx = 1 UCA0CTL1 &= ~UCSWRST; // enable the usci module UCA0TXBUF = 0x45; //data transmission initiated __bis_SR_register(LPM0 + GIE); while (1) { // UCA0TXBUF = 0x45; //data transmission initiated if ((IFG2 & UCA0TXIFG) == 1) // check if the TXBUF is empty P1OUT |= BIT6; else P1OUT |=BIT0; } }