No.34630 作者:nust10 邮件: ID:2056 登陆:2次 文章数:2篇 最后登陆IP:218.2.137.59 最后登陆:2003/6/20 9:12:18 注册:2002/5/9 10:36:00 财富:12 发帖时间:2003/6/16 22:18:18 发贴者IP:218.2.137.41 标题:nust10:80c196kb 的奇怪现象,谢谢 ! 摘要:No.3463080c196kb 的奇怪现象,谢谢 ! he CPU I use is 80c196KB 16, 8 bit data bus. My problem is about writing an value to a memory-mapped I/O. I define as the following: #define SBAUD 0xc0a 1. I write this code: *(unsigned char *)SBAUD=0x08; It does'twork. The value in I/O 0xc0a is 0x00,not 0x08. 2. I write this code two times: *(unsigned char *)SBAUD=0x08; *(unsigned char *)SBAUD=0x08; It can work. The value in I/O 0xc0a is 0x08. 3. If I write this code: *(unsigned char *)SBAUD=0x08; *(unsigned char *)SBAUD=0x08; *(unsigned char *)SBAUD=0x09; It works wrong. The value in I/O 0xc0a is 0x08,not 0x09. 4. If I write this code: *(unsigned char *)SBAUD=0x08; *(unsigned char *)SBAUD=0x08; *(unsigned char *)SBAUD=0x09; *(unsigned char *)SBAUD=0x09; It works well. The ......
>>返回讨论的主题
|