Hello,
I work with a FX2LP board (CY7C68016A). I try to communicate with the device in SLAVE FIFO mode and AUTO mode.
This is my initialization:
/***************************************************************************************************************/
void TD_Init(void) // Called once at startup
{
CPUCS = 0x0A; // CLKSPD[1:0]=10, for 24 MHz operation, output CLKOUT
IFCONFIG = 0x6F; // external clock source,24 MHZ drive IFCLK, asynchronous slave FIFO mode
PINFLAGSAB = 0xAE; // FLAGA Empty flag EP6 - FlagB FULL flag EP6
SYNCDELAY;
PINFLAGSCD = 0xE0; // FLAGD - EP2 Emtpy flag
SYNCDELAY;
PORTACFG |= 0x80;
EP4CFG = 0x02; //clear the valid bits on ep4 and ep8
SYNCDELAY;
EP8CFG = 0x02;
SYNCDELAY;
EP2CFG = 0xA0; // OUT, 512-bytes, 4x, bulk
SYNCDELAY;
EP6CFG = 0xE0; // IN, 512-bytes, 4x, bulk
SYNCDELAY;
FIFORESET = 0x80; // activate NAK-ALL to avoid race conditions
SYNCDELAY; // see TRM section 15.14
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
// handle the case where we were already in AUTO mode...
// ...for example: back to back firmware downloads...
SYNCDELAY; //
EP2FIFOCFG = 0x00; // AUTOOUT=0, WORDWIDE=0
// core needs to see AUTOOUT=0 to AUTOOUT=1 switch to arm endp's
SYNCDELAY; //
EP2FIFOCFG = 0x10; // AUTOOUT=1, WORDWIDE=0
SYNCDELAY; //
EP6FIFOCFG = 0x4C; // AUTOIN=1, ZEROLENIN=1, WORDWIDE=0, INFM = 1;
SYNCDELAY;
Rwuen = TRUE; // Enable remote-wakeup
EE_Page_Size = 0; // Set the page size to 0, so we know to calculate it on an EEPROM write
// Determine I2C boot eeprom device address; addr = 0x0 for 8 bit addr eeproms (24LC00)
I2C_Addr = SERIAL_ADDR | ((I2CS & 0x10) >> 4); // addr=0x01 for 16 bit addr eeprom (LC65)
// Indicate if it is a dual byte address part
DB_Addr = (BOOL)(I2C_Addr & 0x01); // ID1 is 16 bit addr bit - set by rocker sw or jumper
}
/***************************************************************************************************************/
When I tried to send 1 byte with CyConsole the "bulk OUT" failed.
I'm new and I need help to know why I can't transfer just 1 byte on the device.
In addition I tested the device with "bulkloop.hex" and the device work, so I assume I have a problem in my device configuration.
Best regards
Thierry
|