Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 2 of 2

Thread: USB Serial and Interrupt Latency

  1. #1

    USB Serial and Interrupt Latency

    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

  2. #2
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •