自己编了个裸机程序,如下:
为什么delay函数一引入后,就无法仿真了,感觉很怪./*附件为工程和仿真文件,原始路径为 D:My Documents/arm,编译环境为ADS1.2*/
PS: 为什么ADS1.2 C编程时可以不用main函数的?
#define IO0DIR (*((volatile unsigned int *)0xe0028008))
#define IO0CLR (*((volatile unsigned int *)0xe002800c))
#define IO0SET (*((volatile unsigned int *)0xe0028004))
#define IO1DIR (*((volatile unsigned int *)0xe0028018))
#define IO1CLR (*((volatile unsigned int *)0xe002801c))
#define IO1SET (*((volatile unsigned int *)0xe0028014))
#define IO0 IO0CLR = 0x7bffffff; IO0SET
#define IO1 IO1SET = 0xffff0000; IO1CLR
void delay()
{
return; //只是个空函数啊
}
int main(void)
{
int i,t;
int run;
// delay();
while(1)
{
run = 0x00008000;
for(i=0;i<16;i++)
{
run = (run <<1);
IO1 = run;
for(t=0;t<0x3f;t++);
}
for(i=0;i<16;i++)
{
IO1 = run;
run = (run >>1);
for(t=0;t<0x3f;t++);
}
}
return(0);
}
[ 本帖最后由 hgjinwei 于 2008-8-3 23:56 编辑 ]
arm.rar
(2008-08-03 10:26:53, Size: 44.4 KB, Downloads: 3)

最新回复
hgjinwei (2008-8-03 10:35:37)
hgjinwei (2008-8-03 23:56:19)
lwh1119 (2008-8-16 13:59:33)
flfxt (2008-8-17 14:11:24)
liuyimao4858 (2008-9-16 15:16:17)
zhwrobot (2008-11-02 20:27:02)