Part Number: MSP430G2231
Other Parts Discussed in Thread: MSP-FET
Hi there,
I am trying to load a program to an MSP430G2231 device via Spy-Bi-Wire interface using MSP-FET.
I have inherited the board (ie not my hardware design but I understand it has been used successfully in the past).
The MSP-FET is new (purchased via RS last week), serial number 19010144A (2nd generation)
The first time I tried to load the program I got an Load program error, saying data verification error occurred, with values at address x do not match.
I just tried reloading and it seemed to work ok (debug console started, and said processor was running).
Then I tried making a small change to the program and loading again, and initially i got a "can't detect device" error. I had to disconnect the MSP-FET and power cycle the board and then reconnect before I could connect. But now I get the data verification error every time I try and program it. The address of verification error seems to change between 0xF800 and 0xFFF0, but I can't work out any logic behind what determines which address is the error.
The program is extremely simple - I am just initialising the ports and setting a GPIO pin as output and high. Entire user source code is:
#include <msp430.h>
int main(void)
{
WDTCTL = WDTPW | WDTCNTCL; // reset watchdog timer
// Port 1 initialisation
//P1.0 n/c++
P1DIR &= ~(1<<0); //P1.0 set to input
P1REN |= (1<<0); // P1.0 enable pull up/down resistor
P1OUT &= ~(1<<0); //P1.0 pull down
//P1.1 n/c
P1DIR &= ~(1<<1); //P1.1 set to input
P1REN |= (1<<1); // P1.1 enable pull up/down resistor
P1OUT &= ~(1<<1); //P1.1 pull down
//P1.2 Watchdog_Feedback pin - connected directly to main microprocessor input (STM32F429 PE4)
P1DIR |= (1<<2); //P1.2 set to output
P1REN &= ~(1<<2); // P1.2 disable pull up/down resistor
P1OUT &= ~(1<<2); //P1.2 set low (0)
//P1.3 KICK_WATCHDOG pin - connected directly to main microprocessor output (STM32F429 PE3)
P1DIR &= ~(1<<3); //P1.3 set to input
P1REN |= (1<<3); // P1.3 enable pull up/down resistor
P1OUT &= ~(1<<3); //P1.3 pull down
//P1.4 n/c
P1DIR &= ~(1<<4); //P1.4 set to input
P1REN |= (1<<4); // P1.4 enable pull up/down resistor
P1OUT &= ~(1<<4); //P1.4 pull down
//P1.5 n/c
P1DIR &= ~(1<<5); //P1.5 set to input
P1REN |= (1<<5); // P1.5 enable pull up/down resistor
P1OUT &= ~(1<<5); //P1.5 pull down
//P1.6 n/c
P1DIR &= ~(1<<6); //P1.6 set to input
P1REN |= (1<<6); // P1.6 enable pull up/down resistor
P1OUT &= ~(1<<6); //P1.6 pull down
//P1.7 n/c
P1DIR &= ~(1<<7); //P1.7 set to input
P1REN |= (1<<7); // P1.7 enable pull up/down resistor
P1OUT &= ~(1<<7); //P1.7 pull down
//Port 2 initialisation
//Start by setting P2 pins 6 & 7 to be GPIO as they are set to primary module function (XIN / XOUT) on reset
//NB although user guide talks about P2SEL2 register, it isn't implemented according to datasheet.
P2SEL &= ~0xC0; //clear P2SEL bits 6 & 7
//P2.6 n/c
P2DIR &= ~(1<<6); //P2.6 set to input
P2REN |= (1<<6); // P2.6 enable pull up/down resistor
P2OUT &= ~(1<<6); //P2.6 pull down
//P2.7 Controls +GND_SWITCHED net. Low (0) for +GND_SWITCHED to be pulled high, High (1) for +GND_SWITCHED to be connected to 0V.
//When low, the relay outputs are effectively disabled - no 0V for coils.
//When high, the relay outputs are enabled - coils will function as normal.
P2DIR |= (1<<7); //set P2.7 to output
P2REN &= ~(1<<7); // P2.7 disable pull up/down resistor
P2OUT |= (1<<7); //set P2.7 high - enable relays
//P2OUT &= ~(1<<7); //**OCP** temp
while(1)
{
WDTCTL = WDTPW | WDTCNTCL; // reset watchdog timer
}
}
The error messages I get are:

![]()
The hardware schematic showing jtag interface is:

Can you give me any clues as to what the problem might be?
Many thanks,
Oliver.