[求助] 430单片机程序很多报错 找不到改正方法。急求啊。

七七八八   2015-5-14 23:54 楼主
Building configuration: adc12 - Debug
Updating build tree...
12864.c  
Error[Pe020]: identifier "CS1" is undefined C:\Users\Administrator\Desktop\AD\新建文件夹\12864.c 92
Error[Pe020]: identifier "CS2" is undefined C:\Users\Administrator\Desktop\AD\新建文件夹\12864.c 93
Error while running C/C++ compiler
main.cpp  
Error[Pe127]: expected a statement C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 51
Error[Pe020]: identifier "CALDCO_16MHZ" is undefined C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 68
Error[Pe020]: identifier "CALBC1_16MHZ" is undefined C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 69
Error[Pe020]: identifier "ADC10CTL0" is undefined C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 70
Error[Pe020]: identifier "ADC10SHT_2" is undefined C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 70
Error[Pe020]: identifier "ADC10ON" is undefined C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 70
Error[Pe020]: identifier "ADC10CTL1" is undefined C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 71
Error[Pe020]: identifier "ADC10AE0" is undefined C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 72
Error[Pe020]: identifier "ADC10SC" is undefined C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 74
Error[Pe020]: identifier "TA1CTL" is undefined C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 75
Error[Pe020]: identifier "TA1CCTL0" is undefined C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 76
Error[Pe020]: identifier "TA1CCR0" is undefined C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 77
Warning[Pe177]: variable "num" was declared but never referenced C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 65
Error[Pe077]: this declaration has no storage class or type specifier C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 99
Warning[Pe609]: this kind of pragma may not be used here C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 98
Error[Pe065]: expected a ";" C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 99
Warning[Pe012]: parsing restarts here after previous syntax error C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 122
Error[Pe077]: this declaration has no storage class or type specifier C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 123
Error[Pe247]: variable "max" has already been defined (at line 15) C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 123
Error[Pe077]: this declaration has no storage class or type specifier C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 123
Error[Pe247]: variable "i" has already been defined (at line 16) C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 123
Error[Pe077]: this declaration has no storage class or type specifier C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 123
Error[Pe247]: variable "n" has already been defined (at line 18) C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 123
Error[Pe077]: this declaration has no storage class or type specifier C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 124
Error[Pe247]: variable "TACTL @ 0x160" has already been defined (at line 493 of "D:\tools\IAR EW430\MSP430开发板经济版  BSL编程 MSP430F149单片机  C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 124
学习板实验板\相关软件\MSP430编译开发软件\新建文件夹\430\inc\msp430f149.h")
Error[Pe065]: expected a ";" C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 124
Error[Pe077]: this declaration has no storage class or type specifier C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 125
Error[Pe247]: variable "TACCR0 @ 0x172" has already been defined (at line 503 of "D:\tools\IAR EW430\MSP430开发板经济版  BSL编程 MSP430F149单片机  C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 125
学习板实验板\相关软件\MSP430编译开发软件\新建文件夹\430\inc\msp430f149.h")
Warning[Pe068]: integer conversion resulted in a change of sign C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 125
Error[Pe077]: this declaration has no storage class or type specifier C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 126
Error[Pe247]: variable "P1IE @ 0x25" has already been defined (at line 270 of "D:\tools\IAR EW430\MSP430开发板经济版  BSL编程 MSP430F149单片机 学习板实验板\ C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 126
相关软件\MSP430编译开发软件\新建文件夹\430\inc\msp430f149.h")
Error[Pe065]: expected a ";" C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 126
Error[Pe077]: this declaration has no storage class or type specifier C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 127
Error[Pe247]: variable "TACCTL0 @ 0x162" has already been defined (at line 495 of "D:\tools\IAR EW430\MSP430开发板经济版  BSL编程 MSP430F149单片机  C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 127
学习板实验板\相关软件\MSP430编译开发软件\新建文件夹\430\inc\msp430f149.h")
Error[Pe169]: expected a declaration C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 128
Warning[Pe606]: this pragma must immediately precede a declaration C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 129
Warning[Pe606]: this pragma must immediately precede a declaration C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 138
Warning[Pe012]: parsing restarts here after previous syntax error C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 187
Error[Pe077]: this declaration has no storage class or type specifier C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 188
Error[Pe147]: declaration is incompatible with "__cc_version2 void lcd_dis_letter(unsigned char, unsigned char, unsigned char, char)" (declared at line 15 of "C:\ C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 188
Users\Administrator\Desktop\AD\新建文件夹\12864.h")
Error[Pe018]: expected a ")" C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 188
Error[Pe077]: this declaration has no storage class or type specifier C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 189
Error[Pe247]: variable "lcd_dis_letter" has already been defined (at line 188) C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 189
Error[Pe018]: expected a ")" C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 189
Error[Pe077]: this declaration has no storage class or type specifier C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 190
Error[Pe147]: declaration is incompatible with "__cc_version2 void lcd_dis_num(unsigned char, unsigned char, unsigned char, char)" (declared at line 14 of "C:\ C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 190
Users\Administrator\Desktop\AD\新建文件夹\12864.h")
Error[Pe018]: expected a ")" C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 190
Error[Pe077]: this declaration has no storage class or type specifier C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 191
Error[Pe247]: variable "lcd_dis_num" has already been defined (at line 190) C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 191
Error[Pe018]: expected a ")" C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 191
Error[Pe077]: this declaration has no storage class or type specifier C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 192
Error[Pe247]: variable "lcd_dis_num" has already been defined (at line 190) C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 192
Error[Pe018]: expected a ")" C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 192
Error[Pe077]: this declaration has no storage class or type specifier C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 193
Error[Pe247]: variable "lcd_dis_num" has already been defined (at line 190) C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 193
Error[Pe018]: expected a ")" C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 193
Error[Pe077]: this declaration has no storage class or type specifier C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 194
Error[Pe247]: variable "lcd_dis_num" has already been defined (at line 190) C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 194
Error[Pe018]: expected a ")" C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 194
Error[Pe169]: expected a declaration C:\Users\Administrator\Desktop\AD\新建文件夹\main.cpp 195
Error while running C/C++ compiler

Total number of errors: 55
Total number of warnings: 7

回复评论 (6)

这个没人帮得了你,一堆的变量没定义,是不是哪个头文件没有包含成功?
连CALDCO_16MHZ都没定义,那肯定是环境配置得不对了……要么就是选错芯片了。
点赞  2015-5-15 01:31
很可能是没有包含头文件。
点赞  2015-5-15 11:08
头文件不对 有部分错误应该是 其他有的是括号啊 分号啊 之类
点赞  2015-5-15 12:21
用的430f149.然后 头文件有io430.h   msp430f149.h 这个里面我看了一下没有ADC10的定义。可能缺少什么头文件啊。
点赞  2015-5-15 12:44
引用: dontium 发表于 2015-5-15 11:08
很可能是没有包含头文件。

其实就是一个ADC12测正弦信号频率和峰值的程序。
点赞  2015-5-15 12:46
引用: 常见泽1 发表于 2015-5-15 12:21
头文件不对 有部分错误应该是 其他有的是括号啊 分号啊 之类

用的430f149.然后 头文件有io430.h   msp430f149.h 这个里面我看了一下没有ADC10的定义。可能缺少什么头文件啊。就是一个测正弦信号的程序
点赞  2015-5-15 12:49
电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 京公网安备 11010802033920号
    写回复