Hello Everyone!
After playing with 2553 for about 5 months now, I finally decided to quit using software UART and using Hardware UART in my codes. For the most part, the TI MSP430x2xx Family User's Guide was helpful for understanding how UART hardware worked, but only for the most part. I am trying to achieve a 2 way, full duplex 38400 baudrate, 1 Stop Bit, No parity RS232 connection, but unfortunately I have not been able to send healthy data yet. Here is my code:
#include <msp430g2553.h>
int main(void)
{
//UCA0CTL1 |= UCSWRST;
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
BCSCTL1 = CALBC1_8MHZ; // Set range
DCOCTL = CALDCO_8MHZ; // Set DCO step + modulation
P1SEL = BIT1 + BIT2; //select RXD and TXD for UART
P1SEL2 = BIT1 + BIT2; //select RXD and TXD for UART
UCA0CTL0 = 0;
UCA0CTL1 |= UCSSEL_3;
UCA0MCTL = UCBRF_0 + UCBRS_3;
UCA0BR0 = 208;
UCA0BR1 = 0x00;
UCA0CTL1 &= ~UCSWRST; //toggle swreset off
while (1)
{
UCA0TXBUF = 0x61;
//while (!(IFG2 & UCA0TXIFG));
_delay_cycles(8000000);
}
}
All I am trying to do is to send hex 61 about once every second but I do not see 61 on my computers terminal :/
UCA0MCTL = UCBRF_0 + UCBRS_3; // Comes from family Guide :S ????
I adjusted the UCA0MCTL and the UCA0BRx registers according to the User Family Guide to achieve 38400 Baud:
Could someone tell me what I am doing wrong?
PS: The jumpers are crossed so thats not the problem.
Thanks
-Anil