本帖最后由 sundonga 于 2014-6-13 18:54 编辑
大家好,调适DSP6713用到GPIO口,按照例程试了两种方式都没有成功,板子是在GPIO[7]接了一个LED,论文以前有一个帖子https://bbs.21ic.com/icview-36713-1-1.html用的方法一不成功,但没说为什么,在这里只能再问一下了。方法二是这个帖子说的https://bbs.21ic.com/icview-331271-1-1.html。
请问大家是程序哪里有问题吗?
-------------------------------------------------------------------------------------------------
//方法一:
hGpio = GPIO_open(GPIO_DEV0,GPIO_OPEN_RESET);
GPIO_reset(hGpio);
//GPIO_config(hGpio,&MyGPIOCfg);
GPIO_pinEnable(hGpio,GPIO_PIN7);
GPIO_pinDirection(hGpio,GPIO_PIN7,GPIO_OUTPUT);
while(1)
{
GPIO_pinWrite(hGpio,GPIO_PIN7,0);
DSP6713_wait(0xfffff);
GPIO_pinWrite(hGpio,GPIO_PIN7,1);
DSP6713_wait(0xfffff);
}
---------------------------------------------------------------------------------------------------
方法2:
*(unsigned int *)0x01B00000 |=1<<7;
*(unsigned int *)0x01B00004|=1<<7;
while(1)
{
*(unsigned int *)0x01B00008 &=~(1<<7);
DSP6713_wait(0xffff);
*(unsigned int *)0x01B00008|=1<<7;
DSP6713_wait(0xffff);
}
|