现在需要使用28335的XINTF去对一并行外设发出控制信号。但在我配置好xintf和gpio之后。给zone7的地址赋值。。。却是没有反应。我用示波器观测D0口,如果程序正常的话此引脚应该输出的是方波,但我观测到的只是3.3V的高电平
void main(void)
{ short temp=0; InitSysCtrl(); DINT; IER=0x0000; IFR=0x0000; InitPieCtrl(); InitPieVectTable(); initledgpio(); init_zone7(); LED1off; LED2off; while(1) { temp++; if(temp==1) { uint16* p=(uint16*)0x20000 *p=0x00000001; LED1on; LED2off; } if(temp==2) { temp=0; uint16* p=(uint16*)0x20000 *p=0x00000001; LED1off; LED2on; } delay(10000); } } void init_zone7(void) { EALLOW; SysCtrlRegs.PCLKCR3.bit.XINTFENCLK = 1; InitXintf16Gpio(); XintfRegs.XINTCNF2.bit.XTIMCLK = 0; XintfRegs.XINTCNF2.bit.WRBUFF = 3; XintfRegs.XINTCNF2.bit.CLKOFF = 0; XintfRegs.XINTCNF2.bit.CLKMODE = 0; XintfRegs.XTIMING7.bit.XWRLEAD = 1;//写建立等待状态周期=1XTIMCLK XintfRegs.XTIMING7.bit.XWRACTIVE = 2;//写激活等待周期=2XTIMCLK XintfRegs.XTIMING7.bit.XWRTRAIL = 1;//写追踪等待周期=1XTIMCLK XintfRegs.XTIMING7.bit.XRDLEAD = 1;//读建立等待状态周期=1XTIMCLK XintfRegs.XTIMING7.bit.XRDACTIVE = 3;//读激活等待周期=3XTIMCLK XintfRegs.XTIMING7.bit.XRDTRAIL = 0;//读追踪等待周期=0XTIMCLK XintfRegs.XTIMING7.bit.X2TIMING = 0; XintfRegs.XTIMING7.bit.USEREADY = 0; XintfRegs.XTIMING7.bit.READYMODE = 0; // 1,1 = x16 数据线(采用) // 0,1 = x32 数据线 XintfRegs.XTIMING7.bit.XSIZE = 3; EDIS; //占用N+1个指令周期 asm(" RPT #7 || NOP"); }
|