![]() If the device is writing data to the pipe faster than the application can read from it, I'm sure that's going to cause problems. This essentially means that the rate at which data is read from the pipe is limited to the rate that the application can poll it. There's a 1ms timeout to prevent the application from hanging if there's no data to read. I exported a receiveMessage function and, originally, every time this was called it allocated a 64-byte buffer and requested 64 bytes of data from the BULK 2 In pipe using WinUsb_ReadPipe. The driver I created was more-or-less based on the example code on Microsoft's site. The device and driver use the two standard control endpoints (physical endpoints 0 and 1) and additionally use two bulk endpoints:īoth of these have a maximum packet size of 64 bytes. I'm finding it harder to debug issues with USB relative to (say) CAN because of how the protocol works, but I believe the issue is with the PC-side driver that I wrote to interface with the device. Communication is configured to use full-speed USB 2.0 protocol, so I have a transmission rate of around 12 MHz. However, I'd like to make it work with a 0% drop rate at much higher speeds (preferably at a rate of a few dozen to a few hundred microseconds between each message). I think that the majority of the code is in place, and communication generally works fine so long as it's slow (> ~5ms per message). I'm trying to write code to make it so that a microcontroller can communicate over USB with a PC. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |