要用28335xintf输出16位数据。按照我这样配置,D0口会产生方波的。但是程序写进去之后,接上示波器观察,没反应。程序是运行的,因为led在闪烁。
void main(void)
{
short temp=0;
InitSysCtrl();
DINT;
IER=0x0000;
IFR=0x0000;
InitPieCtrl();
InitPieVectTable();
initled();
init_zone7();
LED1off;
LED2off;
while(1)
{
temp++;
if(temp==1)
{
uint16* p=(uint*)0x20000;
*p=0x00000000;
LED1on; LED2off;
}
if(temp==2)
{
uint16* p=(uint*)0x20000;
*p=0x00000001;
temp=0;
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;
asm(" RPT #7 || NOP");
}
mangui zhang:
相关中文手册 重点看一下
http://www.deyisupport.com/question_answer/microcontrollers/c2000/f/56/t/102745.aspx
要用28335xintf输出16位数据。按照我这样配置,D0口会产生方波的。但是程序写进去之后,接上示波器观察,没反应。程序是运行的,因为led在闪烁。
void main(void)
{
short temp=0;
InitSysCtrl();
DINT;
IER=0x0000;
IFR=0x0000;
InitPieCtrl();
InitPieVectTable();
initled();
init_zone7();
LED1off;
LED2off;
while(1)
{
temp++;
if(temp==1)
{
uint16* p=(uint*)0x20000;
*p=0x00000000;
LED1on; LED2off;
}
if(temp==2)
{
uint16* p=(uint*)0x20000;
*p=0x00000001;
temp=0;
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;
asm(" RPT #7 || NOP");
}
rookiecalf:
回复 mangui zhang:
对照原理图,检查地址配置是否正确。可以对照XINTF时序图,看看哪里出了问题。
要用28335xintf输出16位数据。按照我这样配置,D0口会产生方波的。但是程序写进去之后,接上示波器观察,没反应。程序是运行的,因为led在闪烁。
void main(void)
{
short temp=0;
InitSysCtrl();
DINT;
IER=0x0000;
IFR=0x0000;
InitPieCtrl();
InitPieVectTable();
initled();
init_zone7();
LED1off;
LED2off;
while(1)
{
temp++;
if(temp==1)
{
uint16* p=(uint*)0x20000;
*p=0x00000000;
LED1on; LED2off;
}
if(temp==2)
{
uint16* p=(uint*)0x20000;
*p=0x00000001;
temp=0;
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;
asm(" RPT #7 || NOP");
}
jh chen:
使用的硬件是什么样的?并口输出后连接了什么?
就是一个DSP吗? 直接测量D0应该看不到。你可以用memory查看外部地址的数据,打一个断点。可以看到再变化
要用28335xintf输出16位数据。按照我这样配置,D0口会产生方波的。但是程序写进去之后,接上示波器观察,没反应。程序是运行的,因为led在闪烁。
void main(void)
{
short temp=0;
InitSysCtrl();
DINT;
IER=0x0000;
IFR=0x0000;
InitPieCtrl();
InitPieVectTable();
initled();
init_zone7();
LED1off;
LED2off;
while(1)
{
temp++;
if(temp==1)
{
uint16* p=(uint*)0x20000;
*p=0x00000000;
LED1on; LED2off;
}
if(temp==2)
{
uint16* p=(uint*)0x20000;
*p=0x00000001;
temp=0;
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;
asm(" RPT #7 || NOP");
}
user4244115:
你好,你的D0口是怎样的又原理图吗?没有上拉的话应该测不到信号的,感觉跟硬件关系比较大。
要用28335xintf输出16位数据。按照我这样配置,D0口会产生方波的。但是程序写进去之后,接上示波器观察,没反应。程序是运行的,因为led在闪烁。
void main(void)
{
short temp=0;
InitSysCtrl();
DINT;
IER=0x0000;
IFR=0x0000;
InitPieCtrl();
InitPieVectTable();
initled();
init_zone7();
LED1off;
LED2off;
while(1)
{
temp++;
if(temp==1)
{
uint16* p=(uint*)0x20000;
*p=0x00000000;
LED1on; LED2off;
}
if(temp==2)
{
uint16* p=(uint*)0x20000;
*p=0x00000001;
temp=0;
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;
asm(" RPT #7 || NOP");
}
Yang Jonny:
回复 user4244115:
D0 就是一个GPIO口嘛,我也不清楚要不要接上拉。你试过用xintf去写外设吗?
要用28335xintf输出16位数据。按照我这样配置,D0口会产生方波的。但是程序写进去之后,接上示波器观察,没反应。程序是运行的,因为led在闪烁。
void main(void)
{
short temp=0;
InitSysCtrl();
DINT;
IER=0x0000;
IFR=0x0000;
InitPieCtrl();
InitPieVectTable();
initled();
init_zone7();
LED1off;
LED2off;
while(1)
{
temp++;
if(temp==1)
{
uint16* p=(uint*)0x20000;
*p=0x00000000;
LED1on; LED2off;
}
if(temp==2)
{
uint16* p=(uint*)0x20000;
*p=0x00000001;
temp=0;
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;
asm(" RPT #7 || NOP");
}
Yang Jonny:
回复 jh chen:
我的输出是给到一个并口模式的TFT屏。我看过memory的其实,我用的是XINTF7,对应的ZONE7的某地址,看进去是有数据的,也就是我写入的数据。但按照我上面所说的方法,我可以通过指针修改zone7里面的值,如果我复制0-1-0-1交替的话,D0的输出就是一个方波啊。但是现在就是输不出来。ZONE7地址内是已经把数据给进去的了
要用28335xintf输出16位数据。按照我这样配置,D0口会产生方波的。但是程序写进去之后,接上示波器观察,没反应。程序是运行的,因为led在闪烁。
void main(void)
{
short temp=0;
InitSysCtrl();
DINT;
IER=0x0000;
IFR=0x0000;
InitPieCtrl();
InitPieVectTable();
initled();
init_zone7();
LED1off;
LED2off;
while(1)
{
temp++;
if(temp==1)
{
uint16* p=(uint*)0x20000;
*p=0x00000000;
LED1on; LED2off;
}
if(temp==2)
{
uint16* p=(uint*)0x20000;
*p=0x00000001;
temp=0;
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;
asm(" RPT #7 || NOP");
}
Yang Jonny:
回复 rookiecalf:
哎,心累啊
要用28335xintf输出16位数据。按照我这样配置,D0口会产生方波的。但是程序写进去之后,接上示波器观察,没反应。程序是运行的,因为led在闪烁。
void main(void)
{
short temp=0;
InitSysCtrl();
DINT;
IER=0x0000;
IFR=0x0000;
InitPieCtrl();
InitPieVectTable();
initled();
init_zone7();
LED1off;
LED2off;
while(1)
{
temp++;
if(temp==1)
{
uint16* p=(uint*)0x20000;
*p=0x00000000;
LED1on; LED2off;
}
if(temp==2)
{
uint16* p=(uint*)0x20000;
*p=0x00000001;
temp=0;
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;
asm(" RPT #7 || NOP");
}
Yang Jonny:
回复 mangui zhang:
谢谢版主大人