Other Parts Discussed in Thread: MSP430F5438A
Hello,
I am working with MSP430F5438A REV D on Experimenters board by TI. I want to do serial communication using USCI_A1 module in polling mode (by checking UCBUSY bit in UCA1STAT register). The baud rate is 9600 with ACLK= 32.768KHz. Here is the code for the the same. My IDE is Code Composer Studio v5.2
#include <msp430f5438a.h>
void main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
P5DIR |= 0x01; // Set P1.0 to output direction
P1DIR |= 0x01; // Set P1.0 to output direction
UCA1CTL1 |= (1<<0); // reset the UART and hold in logic high state
UCA1MCTL &= ~(1<<0); // UCOS16 = 0 for low baud rate
P5SEL |= (1<<6); // P5.6 as TxD
P5SEL |= (1<<7); // P5.7 as RxD
/* UCA1CTLW0 = 0x4120; */
UCA1CTL1 |= 0x41; // clock source for BRclk= ACLK
UCA1CTL0 |= 0x20; // parity disable, MSB first, 8bit data, 1 stop bit, UART mode, Asynchronous mode
UCA1BR0 = 3; // for baud rate of 9600 with ACLK=32.768KHz
UCA1BR1 = 3;
UCA1IE |= 0x03; // transmit and receive interrupt enable
UCA1CTL1 &= ~(1<<0); // release USCI for operation
while(1)
{
UCA1TXBUF=65; // start transmitting the data
while(UCA1STAT & 0x01); // wait for transmit complete
volatile unsigned int i; // volatile to prevent optimization
P1OUT ^= 0x01; // Toggle P1.0 using exclusive-OR
i = 10000; // SW Delay
do i--;
while(i != 0);
}
}
But I am not able to do communication. The program gets stuck at line
while(UCA1STAT & 0x01);
While debugging, in registers window I get error as "Cannot Read the register" which are related to USCI_A1 UART. They are memory mapped registers.In some other forum related to OMAP I read that it can be a problem with GEL file.
Is it so? Or any problem with code? Or any problem with REV D series? What can be the problem?