Hi,
I tried to run MSP430x54x_uscia0_uart_04.c from Slac227 from TI website
At the Readme file this source is described as USCI_A0, 9600 UART, SMCLK, LPM0, Echo with over-sampling.
I made some changes, like turning on a LED and the LCD Display, however if I use the funtion halLcdClearScreen() and download the code in MSP430F5438, the debugger starts and it never comes the green highlighting on the code. It is like it^s running but you can't debug. By simple removing halLcdClearScreen(), it works again. Does anyone know what is wrong? The same happens with halLcdSetContrast(70) and halLcdPrintXY("test", 0,0,0);
#include "msp430x54x.h"
#include "MSP-EXP430F5438 HAL\hal_MSP-EXP430F5438.h"
void main(void)
{
//Initialize clock and peripherals
halBoardInit();
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
P3SEL = 0x30; // P3.4,5 = USCI_A0 TXD/RXD
UCA0CTL1 |= UCSWRST; // **Put state machine in reset**
UCA0CTL1 |= UCSSEL_2; // SMCLK
UCA0BR0 = 6; // 1MHz 9600 (see User's Guide)
UCA0BR1 = 0; // 1MHz 9600
UCA0MCTL = UCBRS_0 + UCBRF_13 + UCOS16; // Modln UCBRSx=0, UCBRFx=0,
// over sampling
UCA0CTL1 &= ~UCSWRST; // **Initialize USCI state machine**
UCA0IE |= UCRXIE; // Enable USCI_A0 RX interrupt
LED_PORT_OUT ^= LED_1;
halLcdInit();
halLcdBackLightInit();
halLcdSetBackLight(200);
//halLcdSetContrast(70);
//halLcdClearScreen();
__bis_SR_register(LPM0_bits + GIE); // Enter LPM0, interrupts enabled
__no_operation(); // For debugger
halLcdClearScreen();
//halLcdPrintXY("test", 0,0,0);
}
// Echo back RXed character, confirm TX buffer is ready first
#pragma vector=USCI_A0_VECTOR
__interrupt void USCI_A0_ISR(void)
{
switch(__even_in_range(UCA0IV,4))
{
case 0:break; // Vector 0 - no interrupt
case 2: // Vector 2 - RXIFG
LED_PORT_OUT ^= LED_2;
while (!(UCA0IFG&UCTXIFG)); // USCI_A0 TX buffer ready?
UCA0TXBUF = UCA0RXBUF; // TX -> RXed character
break;
case 4:break; // Vector 4 - TXIFG
default: break;
}
}