Ubuntu下MSP430开发环境搭建

来源:互联网 发布:mac怎么输入大写字母 编辑:程序博客网 时间:2024/06/05 19:14

阅读 以下文章可搞定

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



原创粉丝点击