Hi im currently working on USB drivers for LP2468 MCU.I want to send data to the host PC as fast as I can.Since i dont have much knowledge on USB HID development on the PC end Ive decided to implement USBCDC class which will appear as a virtual comport on PC. In my code i have initialised USB using the following statements
CDC_Init (); /*VCOM Initialization*/ USB_Init( EA_BOARD_LPC24XX ); USB_Connect(TRUE);
After i get USB_Configuration flag when an USB cable is connected i send data to PC using
USB_WriteEP (CDC_DEP_IN,str,len );
Where str is the string i want to write and len is the length
This works as far as I insert a delay between 2 succesive USB writes. If i reduce the delay the MCU hangs.Ive tried increasing the buffer size by sending more data collectively by changing usbpacket size #define USBPKTLEN 1000
i have also commented out the following code as im not using CDC to send data packets to the serial port
void USB_EndPoint2 (DWORD event) {
switch (event) { case USB_EVT_OUT: /// CDC_BulkOut (); /* data received from Host */ break; case USB_EVT_IN: // CDC_BulkIn (); /* data expected from Host */ break; } }
Can someone please suggest what measures can i take to increase the throughput of USBCDC or is there anyway to monitor the status of USB clear to send flag if any Thank you
View all questions in Keil forum