主题中讨论的其他器件: MSP-FET
你(们)好!
我正在尝试使用 MSP-FET 通过 Spy-Bi-Wire 接口将程序加载到 MSP430G2231器件。
我继承了该电路板(即、不是我的硬件设计、但我知道它在过去已成功使用)。
MSP-FET 是新产品(上周通过 RS 购买)、序列号19010144A (第二代)
当我第一次尝试加载程序时、出现了一个加载程序错误、内容是发生了数据验证错误、地址 x 处的值不匹配。
我刚刚尝试了重新加载、看上去一切正常(调试控制台已启动、并且说处理器正在运行)。
然后、我尝试对程序进行小幅更改并再次加载、最初出现"无法检测到器件"错误。 我必须断开 MSP-FET 并对电路板进行下电上电、然后才能进行连接。 但现在我每次尝试对其进行编程时都会收到数据验证错误。 验证错误的地址似乎在0xF800和0xFFF0之间变化、但是我不能弄清楚确定哪个地址是错误的任何逻辑。
该程序非常简单-我只是初始化端口并将 GPIO 引脚设置为输出和高电平。 整个用户源代码为:
#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
}
}
我收到的错误消息是:

![]()
显示 JTAG 接口的硬件原理图为:

您能否给我有关问题可能是什么的线索?
非常感谢、
奥利弗.