使用Cyconsole给68013发送数据一直失败,用的是slave-fifo,AUTOOUT=1模式,EP2OUT端点,端点FIFO状态也一直显示为空,固件代码如下,除了之一部分其余的我都是使用的官方模板,没有改动,不知这样可不可行,求各位大侠支招了
void TD_Init(void) // Called once at startup
{
REVCTL=0X03;
CPUCS = 0x12; // CLKSPD[1:0]=10, for 48MHz operation, output CLKOUT
// set the slave FIFO interface to 48MHz
SYNCDELAY;
FIFORESET=0x80; // activate NAK-ALL to avoid race conditions
SYNCDELAY;
FIFORESET=0x02; // reset, FIFO 2
SYNCDELAY;
FIFORESET=0x04; // reset, FIFO 4
SYNCDELAY;
FIFORESET=0x06; // reset, FIFO 6
SYNCDELAY;
FIFORESET=0x08; // reset, FIFO 8
SYNCDELAY;
FIFORESET=0x00; // deactivate NAK-ALL
SYNCDELAY;
IFCONFIG = 0xcb; // slave FIFO Async
SYNCDELAY;
EP2CFG=0xA2; // out 512-bytes bulk 2*buf
SYNCDELAY;
EP6CFG=0x02;
SYNCDELAY;
EP4CFG=0x02; //clear the valid bits on EP4 EP6and EP8
SYNCDELAY;
EP8CFG=0x02;
SYNCDELAY;
EP2FIFOCFG=0x00; //AUTOOUT=0,WORDWIDE=0
// core needs to see AUTOOUT=0 to AUTOOUT=1 switch to arm endp's
SYNCDELAY;
EP2FIFOCFG=0x10; //EP2 is AUTOOUT=1, WORDWIDE=0(8 bit)
SYNCDELAY;
PINFLAGSAB=0x00;
SYNCDELAY;
PINFLAGSCD=0x00;
SYNCDELAY;
PORTACFG = 0x80; // used PA7/FLAGD/SLCS as a FLAGD
SYNCDELAY;
FIFOPINPOLAR=0x00;
} |