阅读 以下文章可搞定
Ubuntu下搭建MSP430开发环境(MSPGCC)(一)
Programming the MSP430 Launchpad on Ubuntu
msp430G2553程序烧写方法:
#include <msp430g2553.h>
int main (void)
{
volatile int i;
/* Stop watchdog timer */
WDTCTL = WDTPW | WDTHOLD;
/* Setup bit 0 of P1 as output */
P1DIR = 0x01;
/* Setup bit 0 of P1 to 0 */
P1OUT = 0x00;
/* Loop forever */
while (1) {
/* Toggle bit 0 of P1 */
P1OUT ^= 0x01;
/* Just delay */
for (i = 0; i < 0x6000; i++) {}
}
}
运行:
1、msp430-gcc -Os -mmcu=msp430g2553 -o main.elf main.c
2、mspdebug rf2500
3、load main.elf
4、run