6590|13

87

帖子

0

TA的资源

一粒金砂(初级)

楼主
 

关于C语言地址指针的问题 [复制链接]

比如C51可作如下定义:
 code uchar x[4]={ //x定义在代码区
0x01,0x02,
0x03,0x04,
};
uchar xdata *p            //指针P定义在外部RAM
#define pflag XBYTE[0x0200] //pflag定义在外部RAM 200H处
#define Px((unsigned char volatile *) 0x20800L) //指针PX指向外部RAM 800H

请问MSP430利用C语言对以上定义如何实现
敬请指教

最新回复

INTERRUPT FUNCTIONS AND VECTORS The syntax for defining interrupt functions changed from version 1.x. Version 1.x syntax The syntax when defining interrupt functions using version 1.x: interrupt [vector] void function_name(void); where vector is the vector offset in the vector table. Version 2.x syntax The syntax when defining interrupt functions using version 2.x: #pragma vector=vector __interrupt void function_name(void); where vector is the vector offset in the vector table.  详情 回复 发表于 2004-9-4 09:24
 
点赞 关注

回复
举报

74

帖子

0

TA的资源

一粒金砂(初级)

沙发
 
const unsigned char Add[]={0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA};
 
 

回复

75

帖子

0

TA的资源

一粒金砂(初级)

板凳
 
加入语句:
   const unsigned char 0x2300[]={0xAA,0xAA,0xAA,0xAA,0xAA,0xAA,0xAA};
编译后提示如下(是哪里出错):
Making target Debug...
fet140_ta01.c
c:\program files\iar systems\ew23\430\fet_examples\fet140\c\fet140_ta01.c (42) : Error[16]: Identifier expected
c:\program files\iar systems\ew23\430\fet_examples\fet140\c\fet140_ta01.c (42) : Warning[14]: Type specifier missing; assumed "int"
c:\program files\iar systems\ew23\430\fet_examples\fet140\c\fet140_ta01.c (42) : Error[112]: ',' unexpected
c:\program files\iar systems\ew23\430\fet_examples\fet140\c\fet140_ta01.c (42) : Error[109]: ';' unexpected
Total number of errors: 3
Total number of warnings: 1
 
 
 

回复

66

帖子

0

TA的资源

一粒金砂(初级)

4
 
const unsigned char name[] @ 0x1000 ={0x00,0x00,.......};
 
 
 

回复

74

帖子

0

TA的资源

一粒金砂(中级)

5
 
编译出错提示:
Making target Debug...
fet140_ta01.c
c:\program files\iar systems\ew23\430\fet_examples\fet140\c\fet140_ta01.c (32) : Error[8]: Invalid character encountered: '@'; ignored
c:\program files\iar systems\ew23\430\fet_examples\fet140\c\fet140_ta01.c (32) : Error[32]: Invalid declaration syntax
c:\program files\iar systems\ew23\430\fet_examples\fet140\c\fet140_ta01.c (32) : Error[16]: Identifier expected
c:\program files\iar systems\ew23\430\fet_examples\fet140\c\fet140_ta01.c (32) : Warning[14]: Type specifier missing; assumed "int"
c:\program files\iar systems\ew23\430\fet_examples\fet140\c\fet140_ta01.c (32) : Error[112]: ',' unexpected
c:\program files\iar systems\ew23\430\fet_examples\fet140\c\fet140_ta01.c (32) : Error[109]: ';' unexpected
Total number of errors: 5
Total number of warnings: 1
包含#include <msp430x14x.h> 是否还要包含其它文件
 
 
 

回复

75

帖子

0

TA的资源

一粒金砂(初级)

6
 
你用的是哪个版本?
 
 
 

回复

73

帖子

0

TA的资源

一粒金砂(初级)

7
 
2.31E
 
 
 

回复

54

帖子

0

TA的资源

一粒金砂(初级)

8
 
是否没定义长度啊!!
如:
CONST UNSIGNED CHAR XXX[3]={0x11,0x22,0x33};
 
 
 

回复

73

帖子

0

TA的资源

一粒金砂(初级)

9
 
跟数组长度无关,不知是否如lsdfae04所说跟EW版本有关,编译软件不认识@,如是该装哪个版本,哪里下载,多谢了!
 
 
 

回复

72

帖子

0

TA的资源

一粒金砂(初级)

10
 
到http://www.iar.com  下载最新的3.20A版本。
 
 
 

回复

61

帖子

0

TA的资源

一粒金砂(初级)

11
 
能否提供默认的参CDKEY
 
 
 

回复

79

帖子

0

TA的资源

一粒金砂(初级)

12
 
IAR会发给你的
 
 
 

回复

78

帖子

0

TA的资源

一粒金砂(初级)

13
 
安装3.20A后原来的程序居然编译不通过
interrupt[TIMERA0_VECTOR] void Timer_A (void)
{
P1OUT ^= 0x01;
CCR0 += 50000;
}
不认识interrupt
头文件:#include <msp430x14x.h>
设置:Options-->linker-->confi-->linker command file 选择
$TOOLKIT_DIR$\CONFIG\lnk430F149.xcl
是否哪里设置不对,程序在原来版本下调试通过应该不会有问题。
 
 
 

回复

81

帖子

0

TA的资源

一粒金砂(初级)

14
 

版本不同中断书写格式也不同

INTERRUPT FUNCTIONS AND VECTORS
The syntax for defining interrupt functions changed from version 1.x.
Version 1.x syntax
The syntax when defining interrupt functions using version 1.x:
interrupt [vector] void function_name(void);
where vector is the vector offset in the vector table.
Version 2.x syntax
The syntax when defining interrupt functions using version 2.x:
#pragma vector=vector
__interrupt void function_name(void);
where vector is the vector offset in the vector table.
 
 
 

回复
您需要登录后才可以回帖 登录 | 注册

随便看看
查找数据手册?

EEWorld Datasheet 技术支持

相关文章 更多>>
关闭
站长推荐上一条 1/8 下一条

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: 国产芯 安防电子 汽车电子 手机便携 工业控制 家用电子 医疗电子 测试测量 网络通信 物联网

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved
快速回复 返回顶部 返回列表