Part Number:MSP430G2553
Hello,
I am trying BSL programming for MSP430G2553 using the app note slaa535a.pdf and LPAD_BSL_INTERFACE firmware downloaded from Texas website. I’m able to successfully program led blinky example code to 2553 chip and it works. My issue is when I program the UART loopback example code using bsl programming, it programs successfully but code is not working as expected. Below is the UART example code (I am using launch pad for testing).
//******************************************************************************
// MSP430G2xx3 Demo - USCI_A0, 115200 UART Echo ISR, DCO SMCLK
//
// Description: Echo a received character, RX ISR used. Normal mode is LPM0.
// USCI_A0 RX interrupt triggers TX Echo.
// Baud rate divider with 1MHz = 1MHz/115200 = ~8.7
// ACLK = n/a, MCLK = SMCLK = CALxxx_1MHZ = 1MHz
//
// MSP430G2xx3
// -----------------
// /|\| XIN|-
// | | |
// --|RST XOUT|-
// | |
// | P1.2/UCA0TXD|------------>
// | | 115200 - 8N1
// | P1.1/UCA0RXD|<------------
//
// D. Dang
// Texas Instruments Inc.
// February 2011
// Built with CCS Version 4.2.0 and IAR Embedded Workbench Version: 5.10
//******************************************************************************
#include "msp430g2553.h"
void main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
BCSCTL1 = CALBC1_1MHZ; // Set DCO
DCOCTL = CALDCO_1MHZ;
P1SEL = BIT1 + BIT2 ; // P1.1 = RXD, P1.2=TXD
P1SEL2 = BIT1 + BIT2;
UCA0CTL1 |= UCSSEL_2; // SMCLK
UCA0BR0 = 8; // 1MHz 115200
UCA0BR1 = 0; // 1MHz 115200
UCA0MCTL = UCBRS2 + UCBRS0; // Modulation UCBRSx = 5
UCA0CTL1 &= ~UCSWRST; // **Initialize USCI state machine**
IE2 |= UCA0RXIE; // Enable USCI_A0 RX interrupt
__bis_SR_register(LPM0_bits + GIE); // Enter LPM0, interrupts enabled
}
// Echo back RXed character, confirm TX buffer is ready first
#pragma vector=USCIAB0RX_VECTOR
__interrupt void USCI0RX_ISR(void)
{
while (!(IFG2&UCA0TXIFG)); // USCI_A0 TX buffer ready?
UCA0TXBUF = UCA0RXBUF; // TX -> RXed character
}
Before BSL programming this code is tested and it works when I program using ccs ide (I am getting UART TX and RX interrupts in debug mode). Same code when I program using BSL it is not working as I don’t receive any character in HyperTerminal.
To debug this I approached two methods.
- In the same chip, reprogram led blinky code using BSL approach, code is working.
- Now when I reprogram the same chip again with UART loop back example code using CCS ide in debug mode, I am not getting UART TX and RX interrupts at all (looks like somehow UART interrupts are permanently disabled when we do BSL programming)
Can somebody please help me to debug this issue.
Thank you,
Best regards,
ANKITH BR