armer_song 发表于 2007-11-1 23:29:48

模拟s3c4510b时 定时器问题

请问哪位大侠帮忙解答一下? 问题如下(skyeye V1.2RC8):

当设置定时器0的TDATA0,时, 写入50000000(好像大于4096就行), 读出只有4095. 同样的代码到真实的机器上测试没有问题。skyeye.conf配置如下:
cpu: arm7tdmi
mach: s3c4510b
mem_bank: map=M, type=RW, addr=0x00000000, size=0x03ff0000
mem_bank: map=I, type=RW, addr=0x03ff0000, size=0x00010000

uart: mod=stdio
# uart 1
uart: mod=pipe, desc=/dev/ttyS1

如果把mem_bank: map=M, type=RW, addr=0x00000000, size=0x03ff0000, 中的0x03ff0000,改成0x3ff7000(TDATA0偏移量:0x6004), 是, 写入和读出的是一样的。但改大(0x3ff7000)后,定时器又启不动. 怪.

附代码片段:
        LDR        R0, =25000000        /* 0.5 s */
        LDR        R1, =TDATA0        /* TDATA0 = 0x3FF6004 */
        STR        R0,

ksh 发表于 2007-11-2 12:40:45

Yes, you can read the source code in arch/arm/mach/skyeye_mach_s3c4510b.c of SkyEye
like the following line:

434               /*we manually set tdata0 register,uclinux's data is so big */
435               io.tdata0 = 0xfff;
436               break;

I guess SkyEye do not like the user set TDATA to a big value. That will cause interrupt be trigger in a long time since simulator is very lower than real hardware.If you like to get more real environment, you can delete the code in 435 line. But for run uClinux on SkyEye , such modification will run very slow....

armer_song 发表于 2007-11-2 14:59:30

原帖由 ksh 于 2007-11-2 12:40 发表 http://www.linuxfans.org/bbs/images/common/back.gif
Yes, you can read the source code in arch/arm/mach/skyeye_mach_s3c4510b.c of SkyEye
like the following line:

434               /*we manually set tdata0 register,uclinux's data is so big * ...

我试一下. 谢谢!

armer_song 发表于 2007-11-4 21:04:51

存在问题

由于定时器最大的定时周期太短(80us), 只要ISR(timer中断服务程序)多花点时间(>80us),可能导致永远执行ISR, 主程序无法执行. 汗
但是为什么skyeye-testsuit中的uclinux等程序正常?
有什么技巧?
页: [1]
查看完整版本: 模拟s3c4510b时 定时器问题