We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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
Hello,
From the MCB2300 USBCDC example I'm trying to write a CDC driver but since I can ready any incoming character, there's no way for me to get the CDC_BulkIn function called on the Endpoint2.
As far as I can see from the example, whenever a character is read from the UART there's a call to USB_WriteEP but what I want is that the CDC_BulkIn function is called automatically requesting data from my internal buffer.
Is there any 'straightforward' way to modify this example in order to get a 'simple' virtual com driver?
Thanks and best regards, Daniel