我想把CY7C68013A配置成slave FIFO模式,异步内部48MHz时钟,2端口OUT,6端口IN,FLAGA表示EP2已空,FLAGD表示EP6已满,目前从示波器中观测发现FLAGA的电平在从电脑输入数据到端口2的过程中,电平不变。
void TD_Init(void) // Called once at startup
{
CPUCS = ((CPUCS & ~bmCLKSPD) | bmCLKSPD1) ;
IFCONFIG |= 0xCB; //内部时钟48MHz,异步不反向
PINFLAGSAB = 0x08; //FLAGA=EP2 EF 已空
SYNCDELAY;
PINFLAGSCD = 0xE0; //FLAGD=EP6 FF 已满
SYNCDELAY;
PORTACFG |= 0x80; //开启FLAGD
EP4CFG = 0x00; //默认值
SYNCDELAY;
EP8CFG = 0x00; //默认值
SYNCDELAY;
EP2CFG = 0xA0; //默认值 激活2端口,输bulk模式,输出,512缓冲区大小
SYNCDELAY;
EP6CFG = 0xE0; //默认值 激活6端口,输bulk模式,输出,512缓冲区大小
// out endpoints do not come up armed
// since the defaults are double buffered we must write dummy byte counts twice
SYNCDELAY;
FIFORESET = 0x80; //复位FIFO
SYNCDELAY;
FIFORESET = 0x02;
SYNCDELAY;
FIFORESET = 0x04
SYNCDELAY;
FIFORESET = 0x06;
SYNCDELAY;
FIFORESET = 0x08;
SYNCDELAY;
FIFORESET = 0x00;
SYNCDELAY;
EP2FIFOCFG = 0x00; //开启Slave FIFO模式下端口2和6
SYNCDELAY;
EP2FIFOCFG = 0x11;
SYNCDELAY;
EP6FIFOCFG = 0x09;
SYNCDELAY;
}
void TD_Poll(void)
{
} |