Question
Is it possible that when using USBlib to handle bus enumeration, device setup and providing an endpoint for application logic, to have another endpoint in isochronous mode employing DMA and automatic packet sending?
Proposed architecture
Will it work if I do the following:
- Use tivaware usblib to generate a bulk device, handle endpoints 0, and have endpoints 1 managed to have an easy-to-use communication interface
- Register endpoint 2 in isochronous mode via driverlib's usb interface
- Set up DMA to transfer data from ADC sequencer FIFO to endpoint 2 Transmit FIFO
Background
I have built an ADC application around USBlib bulk device methods. A timer triggers the ADC sequencer every 1600 cycles (the processor running at 100MHz), and after the sequence has finished, the ADC interrupt routine empties the sample FIFO, writes that into a ring buffer.
Simultaneously, the main loop polls the sample count, and if that threshold passes 32, I notify USBlib that 64byte have been written to the ringbuffer, triggering the sending of a packet.
However, when using sequence triggering more often than every 1.6ms (62.5kSam/s), I encounter sporadic ADC FIFO overflows. I assume it is because to the software-based data shuffling that takes place when a transfer is about to happen, happening so that ADC interrupt handling is disabled for the meantime, leading to 2 missed interrupts and a FIFO overflow in the consequence (sequence is 4 samples deep, FIFO is of length 8).
In an attempt to solve this, I'd like to use the DMA engine to automatically get 4x 16bit from the ADC FIFO register and store it in the USB endpoint transmit FIFO; the driverlib usb functionality documentation says the DMA controller is able to do exactly that and that would be much better than the software-buffer driven approach I employ now.
Furthermore, since this is the nature of my application, isochronous mode should be used.
Anyway, I'm afraid that the Driverlib's USB interrupt handler will mix up USB interface and DMA-generated interrupts.
Bonus question
How to make the device appear as USB2.0? Although the tm4c123g datasheet claims USB2 compliance, but to the host it registers as bcdUSB = 1.0 .