Hi all,
I have MSP 430F 1611 and I want to enable USART communication between the device and a hyper terminal. According to the slau049f f for MSP430x1xx pdf file, it is possible to do the same. I am using a java program and putty as the program to receive the outputs from the device. Neither seems to be getting any outputs from the MSP. I have provide code snippets so that the forum members can highlight and possibly give an explanation of the area where I am faltering in the code. I also read through the slau049 - MSP 430x1xx pdf and have put values as per the explanation provided for the registers in the pdf document.
First, I initialize the halInit() and also enable the interrupts. Next, I have the code as shown below
P3SEL |= 0x30; // P3.4,5 = USART0 TXD/RXD
ME1 |= UTXE0 + URXE0; // Enable USART0 TXD/RXD
UCTL0 |= CHAR; // 8-bit character
UTCTL0 |= SSEL1 ; // UCLK = ACLK = 32.768kHz --- (Tried SSEL0 )
UBR00 = 0xD0;
UBR10 = 0x00;
UMCTL0 = 0x00 ;
UCTL0 &= ~ SWRST; // Initialize USART state machine
IE1 |= URXIE0 + UTXIE0; // Enable USART0 RX/TX interrupt
Then I have a while loop sending a character to the terminal
while (1)
{
toggleLed(1);
setLed(1);
delayMs(1000);
while (!(IFG1 & UTXIFG0)); // USART0 TX buffer ready?
TXBUF0 = 0x42;
}
Is this code correct? In debug mode, the loop functions and I can see the led toggling. When downloaded and executing on the device through IAR, the led is not blinking.
I removed the last two statement (while and Txbuf) and added a printf stmt and it loops through. Am I missing something in this USART code?
I am a newbie and any inputs and direction from the forum members is highly appreciated.
Cheers,
Dave