iwqt1983 发表于 2014-10-29 17:13 
你用法的不对吧,估计很少这样用F28335的IO的,一般置位或是清零或是反转,还处在传统51的思想里面 ...
虽然TI文档建议使用GPxSET, GPxCLEAR, and GPxTOGGLE来设置IO输出,但上面的程序中也不会出现TI文档中说的使用GPxDAT的问题吧。
为什么那个赋值语句重复一遍就可以呢? 为什么插入一个延时就可以呢? 为什么不是全不可以?只是有一些有时候呢?
ad9_rest=0; 的汇编代码是 AND @0x0, #0xf7ff 难道有问题?
TI的文档中的建议如下,但我上面的应用不会出现其所说的情况。
When using the GPxDAT register to change the level of an output pin, you should be cautious not to accidentally change the level of another pin. For example, if you mean to change the output latch level of GPIOA0 by writing to the GPADAT register bit 0, using a read-modify-write instruction. The problem can occur if another I/O port A signal changes level between the read and the write stage of the instruction. You can also change the state of that output latch. You can avoid this scenario by using the GPxSET, GPxCLEAR, and GPxTOGGLE registers to load the output latch instead.
|