Hi,
I am configuring a UART communication with rf transmitter. Below is the code:
#include <stdio.h>
#include <msp430.h>
void main()
{
WDTCTL = WDTPW | WDTHOLD; // stop watchdog timer
P4SEL |= 0x30; // P4.4,5 = USART0 TXD/RXD
P4DIR |= 0x90;
UCA1CTL1 |= UCSWRST;
UCA1CTL1 |=UCSSEL_2;
UCA1BR0=0x03;
UCA1BR1=0x00;
UCA1MCTL=0x03;
UCA1CTL1 &= ~(UCSWRST);
UCA1IE|= UCTXIE ;
while (!(UCA1IFG & UCTXIFG)); // USART0 TX buffer ready?
{
UCA1TXBUF = 0x42;
}
}
In the above code I have selected UCA1TXD pin. Baud rate is 9600 and here I am transferring one byte 42. In receiver section I have programmed accordingly. I have written this after studying msp430f5528 users' guide. Transmitter and receiver modules are working because I have programmed in other MCU and it is working fine. Please help me in this.