msp430几种不同开发平台的对比
msp430-objdump -dSt $^ > ##### -o This option creates a UBROF output file, with a DE>d43DE> 0x15000+0x200-> OSTCBCur-> ! 1. 正版。无限制。 GPL,天下皆知 2. 与gcc系出同源,使用方式极像。 如果用过gcc 查看mspgcc对gcc的扩展 如果没有用过gcc 先了解一下gcc的基本用法,比如 gcc -o hello hell.c gcc -S hell.c 等 然后,mspgcc 其它 goto error; 3. 针对430扩展C语言,汇编能做的,他几乎都能做。 仅在此列出我认为有趣的几个,详情,查手册。 (1)堆栈 mspgcc对堆栈的设置很灵活。你可以为自己保留一定字节的RAM不被C占用。如下声明 int RESERVE_RAM(10) main() 你保留的10字节RAM。 你也可以自己写启动文件,代替标准的启动文件,自己控制进入C语言时的环境。 (2)头文件 在嵌入式开发中,一般会有针对硬件的头文件。其中为特殊功能寄存器定义等。不同的硬件环境,当然需要不同的定义。在mspgcc的开发环境中只需增加 #include 即可。 不同的硬件如何区别?在Makefile文件中或者在编译时说明是哪种430芯片就可以了。这一点,和winavr相同。 (3)中断 中断是硬件的珍贵资源。标准C中似乎没有中断的定义,所以一般采用扩展。mspgcc提供了interrupt关键字,以及控制进入中断方式的选项。比如,下面的中断程序中没有用到诸如R4,R5等其它寄存器,却仍将其在堆栈中保护。 interrupt (ADC_VECTOR) ADC12ISR(void) { ADCresult = ADC12MEM0; // Move results, IFG is cleared } 属性naked修饰后,裸奔。不做任何事情,甚至reti都不执行,所以,得自己控制返回。 interrupt (ADC_VECTOR) __attribute__ ((naked)) ADC12ISR(void) { ADCresult = ADC12MEM0; // Move results, IFG is cleared asm("reti"); } mspgcc中扩展了下面这些属性(参考mspgcc手册)。 reserve(x) When applied to main(), this reserves "x" bytes of RAM above the stack. This cannot be used with C++ (if C++ is supported later on). interrupt(x) Make the function an interrupt service routine for interrupt "x". signal Make an interrupt service routine allow further nested interrupts. wakeup When applied to an interrupt service routine, wake the processor from any low power state as the routine exits. When applied to other routines, this attribute is silently ignored. naked Do not generate a prologue or epilogue for the function. critical Disable interrupts on entry, and restore the previous interrupt state on exit. reentrant Disable interrupts on entry, and always enable them on exit. saveprologue Use a subroutine for the function prologue, to save memory. noint_hwmul Supress the generation of disable and enable interrupt instructions around hardware multiplier code. (4)汇编 mapgcc支持行间汇编。只是,gcc的汇编语言似乎与TI的不尽相同。 4. 烧写 有三种方式 (1) gdb (2) msp430-downloader.exe (3) msp430-jtag.exe 5. 调试 当前,最新版mspgcc没有insight,只有gdb。个人感觉不如IAR直观 前些天接了个任务,要把原来在MCU430x149里面的程序移植并烧写到MCU430x1611里面去,以前没用过430,但它的鼎鼎大名早有耳闻,许多论文、报告上都提到过430。大概的搜了些资料,觉得它最突出的地方莫过于功耗小、速度快,据说以前RAM有点小,现在出了16xx,应该是可以满足一些需求了。虽说430声名在外,可上网搜了一通,却发现有用的资料不多,其实我主要是想找一下开发环境,至少程序方面并没有什么太 大的期望,一来有源代码,二来有手册和用户指南,所以在代码上问题应该不大。 430的开发工具一般都是用的IAR,我问了周围的同事,也都这么说,于是就上网费了n大的劲下了一个IAR For 430 3.41A版的,然后破解、建工程、编译代码,谁知道这时候出问题了,原来代码是用MSPGCC环境编译的,在IAR下错误一大堆。于是就又放弃了IAR,开始搜索MSPGCC,谁知道这个东西的资料少的可怜,按理说是开源软件,用户应该多些,可情景正好相反,鲜有详细的资料,只在利达尔的论坛上有些资料,还都是一两年前的,可能是考虑到开发环境的兼容性,用IAR的占了绝大多数,反正国内用MSPGCC的不多。在摸索了几天,查了n多资料,上了n多网站后(基本上是E文的),终于建立了MSPGCC的编译与仿真环境,下面就是小弟的搭建过程,希望对像我这样的初学者或者对MSPGCC感兴趣的朋友有点用处。 1、从网上下载MSPGCC的安装包(For Windows),可以从这儿下载最新版:http://ms
msp430开发平 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)
