USB low-full-high speed peripherals Forum Discussions
hi
i use i2c_hw.c and i comment DBG, but error happened.. like this
//#define DBG
what am i do ? could you please check the code again?
I2C_HW.C(43): warning C236: '_I2CWrite': different length of parameter lists
I2C_HW.C(114): error C202: 'sub_type': undefined identifier
I2C_HW.C(116): error C202: 'sub_type': undefined identifier
I2C_HW.C(158): error C202: 'sub_type': undefined identifier
I2C_HW.C(168): error C202: 'sub_type': undefined identifier
I2C_HW.C(208): error C202: 'i': undefined identifier
I2C_HW.C(210): error C202: 'i': undefined identifier
Show LessHi.
I have some question about using i2c_hw.c form USBTV example.
1.As i know, i2c is need initalize firstly. can i use EZUSB_InitI2C?
2.If i use Device ID is 0x40 and Slave address is 0x63,these are need right shift (>>1) ?
3.Am i just replace from EZUSB_WriteI2C to I2CWrite?
Show LessHi,
I'm working with a CY7C68013A-FX2LP. We started with the provided mass storage device example firmware and added a second interface that uses endpoint 1.
We use winusb to communicate over this second interface, with a custom protocol, when the device receives something on endpoint 1 it results in an I2C transaction / GPIO wiggling.
This works perfectly as it is, I plug in the dongle, it loads it's firmware, enumerates, the windows "what shall we do with this mass storage thing" pops up. I run my windows code to do a set of sample transactions over the second interface, which runs as expected.
I can also read, write and delete from the mass storage device correctly.
However I have a problem if I am doing a mass storage transfer (say writting 50MB to the dongle) and running my custom code at the same time. The first request tends to go through OK (sending 01 00), however the second request fails. Debugging has told me that the bytes I send are on the wire (02 00 0A). The EP1 OUT BUSY bit is 0 in the EP01STAT register, meaning there is data to read. However the EP1OUTBC register is 0. Meaning there is no data to read. If I ignore this and read 10 bytes anyway fromthe EP1OUTBUF buffer, I see (01 00 .....) which matches the first packet I read in.
After this request fails, about 1s later the USB reset interrupt fires and the device resets (although the mass storage transfer continues running). This doesn't always happen, but it does quite often. Also using a USB analyser I was unable to see a reset condition on the line.
So as far as I can tell, I send a request, it's defintiely on the wire, the dongle receives it and notifies that it has been received, yet the buffer and byte count registers haven't been updated.
USB descriptors: http://slexy.org/view/s21Tk2YNtj
Endpoint setup: http://slexy.org/view/s20U5otzq5
EP1 poll code: http://slexy.org/view/s21itwaq6L (the autoptrs are commented out for debugging, the problem happens either way).
Apologies if any of the code is messy / un-needed, I've been trying not to touch stuff that works, with the aim of tidying it all up later.
Any help would be greatly appeciated, as I can't figure out where to go from here.
Show LessHi
Can i handle device id in I2c function of EZUSB.LIB?
I think there is not i2c device address handle function in EZUSB.LIB.
So is there any way how to use device address ?
I think there is only EZUSB_WriteI2C and EZUSB_ReadI2C.
Show LessHi.
I working i2c with fx2lp.
My i2c chip address is 0x23. and i2c address 8bit and data 8bit.
I want write address 0x18 , data 0x37. So how do i make i2c command line?
Could you please let me know where is not correct and how can i fix?
Firmware :
BOOL DR_VendorCmnd( void )
{
BYTE addr;
BYTE fail;
BYTE count;
BYTE tmp;
WORD wValue;
WORD wIndex;
wValue = SETUPDAT[2];
wValue |= SETUPDAT[3]<<8;
wIndex = SETUPDAT[4];
wIndex |= SETUPDAT[5]<<8;
switch (SETUPDAT[1])
{
case VENDOR_CMD1:
EZUSB_InitI2C();
Cmd1[0] = 0x02;
while(EZUSB_WriteI2C(0x23 >> 1, 0x01, Cmd1) != I2C_OK) {
;
}
EZUSB_WaitForEEPROMWrite(0x23 >> 1);
Cmd1[0] = 0x37;
while(EZUSB_WriteI2C(0x18 >> 1, 0x01, Cmd1) != I2C_OK) {
;
}
EZUSB_WaitForEEPROMWrite(0x18 >> 1);
EZUSB_ReadI2C(0x18 >> 1, 0x01, Cmd1);
EP0BUF[0] = Cmd1[0];
EP0BCH = 0;
EP0BCL = 1;
EP0CS |= bmHSNAK; // Acknowledge handshake phase of device request
break;
default:
return(TRUE);
}
return(FALSE);
}
PC application side :
if(init_USB()){
ept0 = USBDevice->ControlEndPt;
ept0->Target = TGT_DEVICE;
ept0->ReqType = REQ_VENDOR;
ept0->Direction = DIR_FROM_DEVICE;
ept0->ReqCode = 0xDA;
ept0->Value = ii;
ept0->Index = 0x00;
unsigned char buf[2];
ZeroMemory(buf,2);
LONG buflen = 2;
ept0->Read(buf,buflen);
UpdateData(FALSE);
}
Please let me know where am i do fix ?
Show Less1)Hardware enviroment
Our board use CY7C68013A as synchronouse slave fifo, and a fpga as master.
CY7C68013A's CLKOUT at 12MHz, and FPGA's PLL use as input, output 40Mhz as CY7C68013A's IFCLK.
EEPROM is blank.
2)firmware and modification
use Cypress Suite USB 3.4.7\Firmware\Bulkloop example, and only modify BulkLoop.c as follow:
// CPUCS = ((CPUCS & ~bmCLKSPD) | bmCLKSPD1) ;
// CPUCS = (CPUCS & ~bmCLKSPD) |bmCLKSPD0; //24MHz
CPUCS = CPUCS & ~bmCLKSPD ; //12MHz CLKOUT
// set the slave FIFO interface to 48MHz
//IFCONFIG |= 0x40;
IFCONFIG = 0x03; //slave fifo, sync, external
3)host pc
windows 7 32bit.
Cypress Suite USB 3.4.7
CY3684_EZ-USB_FX2LP_DVK
Hi
What if i use xferloop to get data from camera in Hsync active low( idle state- not included data),
What happen in windows application?
And what is best way to use xferloop in above circumstance?
Show LessCypress Semiconductor introduced a single-chip solution that integrates a wireless radio with touch-sensing circuitry for wireless mice, trackpads, remote controls, presenter tools, and other Human Interface Devices (HIDs). The new PRoC™-UI (Programmable Radio-on-a-Chip–User Interface) solution combines 2.4-GHz proprietary WirelessUSB™-NL Radio with Cypress’s CapSense® and Automotive Multitouch capacitive touch technologies. This combination enables user interface functionality in wireless devices, including gestures supported by the upcoming Windows 8 applications.
Show Less
Cypress Semiconductor announced that ITON Technology, Ltd., a leading PC peripheral and component manufacturer in China, has selected Cypress’s 2.4-GHz WirelessUSB™-NL radio-on-a-chip for its complete module for wireless mice. The module includes firmware, providing customers with a turnkey solution to create their own end-products.
Cypress's 2.4-GHz WirelessUSB™-NL Radio-on-a-Chip Powers ITON's Turnkey Module for Wireless Mice
Show Less