USB low-full-high speed peripherals Forum Discussions
Hi, every one.
I'm using CY7C68013 to implement a data acquisition system.FPGA sends the data flow to the host via USB.The configuration of the USB is as follows: EP2 IN, 512bit, quad buffers, slave fifo, auto in mode, and with an external IFCLK(24Mhz).The writting rate to endpoint is about 2.5MB/s.And the FPGA writes to the endpoint2 continuously unless it is not full.
The host program is based on .NET(C#) .To test transfer speed, i ordered my host to request for data repeat from 68013. The XferSize was set to 256KB,and the host requested for 256KB each time.But the host program occasionally broke down.It can happened during the anytime when executing Xferdata()(maybe the first time or even after 10 mins). The return NtStatus can be "0xC000 0120" or "0xC001 0000".And the string returned by UsbStatusString() was "[state=HALTED status=UNKNOWN]".
I don't know how to map these error codes to the real problems.It seems others seldom using .NET to implement a project. I checked my FPGA program,the firmware and the C# program.But i can't find anything wrong.Maybe I've missed or misunderstood something.Please help me.
Main part of the firmware and C# codes are as follows:
Firmware:
void TD_Init(void) // Called once at startup
{
IFCONFIG |= 0x03; //external clock from FPGA:24 Mhz
SYNCDELAY;
REVCTL = 0x03; //
SYNCDELAY;
EP2CFG = 0xE0; // IN, bulk mode,quad buffering,512bit each buffer
SYNCDELAY;
FIFORESET = 0x80; // reset all FIFO
SYNCDELAY;
FIFORESET = 0x82;
SYNCDELAY;
FIFORESET = 0x84;
SYNCDELAY;
FIFORESET = 0x86;
SYNCDELAY;
FIFORESET = 0x88;
SYNCDELAY;
FIFORESET = 0x00;
SYNCDELAY;
EP2FIFOCFG = 0x09;
SYNCDELAY;
PINFLAGSAB = 0x00; // defines FLAGA as prog-level flag, pointed to by FIFOADR[1:0]
SYNCDELAY; PINFLAGSCD = 0x00; // FLAGC as empty flag, as pointed to by FIFOADR[1:0]
PORTACFG = 0x40; // Enable SLCS
SYNCDELAY;
FIFOPINPOLAR = 0x00; // set all slave FIFO interface pins as active low
SYNCDELAY;
EP2AUTOINLENH = 0x02; // autoin length:512bit
SYNCDELAY;
EP2AUTOINLENL = 0x00;
SYNCDELAY;
EP2FIFOPFH = 0x90;// FLAGA: PKTSTAT = 0,PF asserts if committed packest are more than 2.
SYNCDELAY;
EP2FIFOPFL = 0x00;
}
C# code
int count = 0;
CyBulkEndPoint bulkEndptOut;
private void button1_Click(object sender, EventArgs e)
{
USBDeviceList usbDevices = new USBDeviceList(CyConst.DEVICES_CYUSB);
CyUSBDevice MyDevice = usbDevices[0x04B4, 0x1004] as CyUSBDevice;
if (MyDevice == null)
{
MessageBox.Show("No device attached!");
return;
}
bulkEndptOut = MyDevice.EndPoints[1] as CyBulkEndPoint;
if (bulkEndptOut == null)
{
MessageBox.Show("Can't find endpoint!");
return;
}
bulkEndptOut.XferSize = 4096 * 64 ;// Set XferSzie 256KB
Thread t = new Thread(new ThreadStart(subFun));
t.Start();
}
bool bComplete = true;
void subFun()
{
while (true) //for test only,it's a dead loop
{
int[][][] mData = new int[1][][];
for (int i = 0; i < mData.Length; i++)
{
int len = 256 * 1024;//requset for 256KB each time
byte[] buf = new byte[len];
count++;
bComplete = bulkEndptOut.XferData(ref buf, ref len);
}
}
}
I would like to use multiple configuration descriptors. One of them would have a DirectSound interface (and that interface would not receive data from the Cypress driver), the other would not have that interface and instead the Cypress driver would provide the data that DirectSound would have using the vendor-defined interface.
I have added the extra configuration descriptor (and associated interface/endpoint descriptors) to dscr.a51. I also modified SetupCommand(void) so that SC_GET_DESCRIPTOR / GD_CONFIGURATION (and GD_OTHER_SPEED_CONFIGURATION) will return the correct descriptors. I also modified the ISR's Ures and Highspeed so that they correctly handle switching the configuration types from CONFIG_DSCR to OTHERSPEED_DSCR.
If I manully enter the commands for getting the DirectSound descriptor, I get back the correct descriptor. However, when I send the command for setting the DirectSound descriptor, nothing happens; I don't see a DirectSound device and no data flows to the FX2.
When I look in the CyConsole or the USB Control Center, I can see two configurations, but they're both "configuration 1". I know that my DirectSound config descriptor is set correctly - recall that get descriptor works fine, and shows configuration 2.
Do I need to disconnect and reconnect from the USB using USBCS in order for the new DirectSound configuration descriptor to be seen? Why can't the Control Center or Console see the other configuration descriptor?
Show LessHi, all
Im working with a cmos sensor connected to the slave fifo of 68013, the frame sync signal of the cmos is captured by INT0. In the INT0 service routine, i want to insert some user defined bytes to the cmos data stream. My question is, how can i exactly know how many bytes are in the fifo now? Because the inserted bytes should not overwrite any cmos data that are already in the fifo. Can the EPxBCH:L register or Autopointer be helpful?
Thanks!
Show LessHI, everybody.
now I am use cy7c68013 as a controler and transfer to a sampe system. I use the CPU in 68013 to control ADc. In other to sure the timing of sample, I use a timer.here in my ISR declare for timer 1:
void Timer_RP_Interrupt() interrupt TMR1_VECT
But, after download fireware, I found timer ISR can't work. I checked the TRM of 68013 and searched on the internet, I found the keil will ingore the interrupt TMR1_VECT becase of #pragma NOIV, which tells keil do not generate interrupt vectors, so keil will use USBJMPTB.OBJ to indicate the entry address for usb interrupt. But in USBJMPTB.OBJ , it doesn't tell keil the entry address for timer interrput. and I don't konw how to re-code the USBJMPTB.OBJ.
my question is :how can i use the timer and code a ISR for it. how to code the usbjmptb?
thanks for you read. the best wishes for you!
Show LessI use the Cypress Vend_Ax.hex firmware file (loaded in RAM) to write our own firmware to the EEPROM.
Our own firmware is converted to IIC format using the Hex2bix tool and contains a dummy string for the serial number.
Upon write to the EEPROM, this dummy string will be replaced by an unique serial number.
This is working fine, but the device must be disconnected (or power-down) in order to start with the newly written firmware.
Is it possible to trigger the FX2LP to load the EEPROM by itself? (a sort of hard reset/reboot)
Another possibility I could think of was to load our firmware also to the RAM (using vendor-request 0xA0) after writing to the EEPROM. But then I need to have the hex-format again and change the serial in that version also. Problem is that the characters of the dummy serial doesn't have to be in one consecutive row, which makes the replacement a bit more difficult.
Is it possible to convert the IIC format back to a format I can program to the RAM directly?
What has to be done to do this?
Show LessHi, if two identical FX2-based devices are plugged into the PC, how can I discern one from the other? I do not have the ability to do this in the EEPROM. But as I look through the USB Properties in Device Manager, I see Address is set differently for each device (right click on USB device, go to details, then property = address)
However, this doesn't seem to coincide with the value I get when I look at the device property USBAddress
Can someone shed some light on this? What is the best way to communicate with two identical devices connected to the same PC?
Thanks
Show LessI'm working on a custom board. After connecting the USB cable, Windows displays a "USB Device not recognized" message. In device manager, the VID/PID pair are both 0000. I checked this by reading the "Device Instance Path" field.
I checked the steps given in AN15456. I've checked all the voltages and they are all fine. The rest and Wakeup pins are also correctly set (Wakeup is pulled high). I am also getting the 12 MHz output wave on CLKOUT. The application note suggests that since Wakeup is high, SDA and SCL should be pulled up, which is also done. I do not have an EEPROM on the board so this matches the initial test sequence in the application note. Yet, I cannot get the chip to enumerate.
Is it possible that this is a problem with the chip itself? Should I replace it? Or am I missing something simpler?
Show LessI have two development kits for the PSoC5 (the first touch kit, and the CY8C kit). Both of the development boards have an FX2LP controller on them, which can be used to program the PSoC. I'm assuming this is done by doing some sort of USB to JTAG conversion. Please excuse my question if it seems basic. I'm new to USB, so I would appreciate any help on this:
I want to use one mini-USB port both for programing (JTAG), and communications (e.g. UART, or something that shows up as a com-port on the computer). Is this possible with the FX2LP chip? I'm assuming the FX2LP is a specialized microcontroller that can be programmed to achieve any sort of USB conversions. Is this right? If it's not possible, can I somehow share the miniUSB port between the FX2LP and some sort of FTDI usb-serial chip? It would be great to do this without having to use a jumper or multiple miniUSB ports. Also, does cypress provide firmware for any of these kinds of applications?
thanks!
Show LessHi,
http://www.cypress.com/?rID=59674 is our application note on how to write USB host application in MAC OS. Looking for feedback on anything more that needs to added and any specific that needs more content on.
Feel free to post your feedbacks here.
Cheers,
Anand
Show LessHi!
Here is a quite strange phenomenon which has been confusing me...
Things goes like this:
I feed the Slave FIFO with the external logic FPGA when a key is pressed.
Before the key is pressed down, FIFO_FULL_FLAG is high and FIFO_EMPTY_FLAG is low.
After the key is pressed, FIFO_FULL_FLAG is low and FIFO_EMPTY_FLAG is high. Obviously,it is normal.
However, when I access the data in the SLAVE FIFO through the control pannel, the FIFO_FULL_FLAG remains low and the FIFO_EMPTY_FLAG remains high. \
How can i fix it?
Show Less