USB Serial and Interrupt Latency

Status
Not open for further replies.

tlb

Well-known member
I am running USB serial to a Windows PC from a Teensy 2.0 running at 16 MHz, using the C libraries. I am doing both send and receive at a fairly low data rate, less than 100 bytes/sec.

How will this affect my interrupt latency rate? I would like to get an interrupt latency rate of 10's of usec from a hardware interrupt, otherwise I will have to add some additional hardware support.

Thanks,

tlb
 
Since there was no answer, I set up an experiment to measure the latency. I did set up a timer interrupt to interrupt on compare. The first operation in the interrupt routine was to read the timer. The difference in this value and the compare value gave me the interrupt latency.

Depending on the code, the smallest and most common value was between 25 and 30 clock cycles. Soon I would see some values come in up to 80 cycles, and if I let if run long enough I would see values up to about 110 clock cycles.

This is running the Teensy C serial routines, talking to pyserial under Windows XP, sending about 100 bytes every quarter of a second. On the PC, both the pyserial and a wxPython GUI thread are running.

So it looks like it is acceptable for my application under typical conditions, with plans for error detection if the latency does ever become excessive.

tlb
 
Status
Not open for further replies.
Back
Top