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

Thread: Interrupt on Serial (USB) receive

  1. #1
    Junior Member
    Join Date
    May 2018
    Location
    Brazil
    Posts
    7

    Interrupt on Serial (USB) receive

    Hello there.

    I have a Teensy 3.6 and I'd like to know if there's any way to prompt an interrupt everytime I receive something through the Serial (USB). I've been searching about it but only seem to find an interrupt for USART (Serial1, Serial2, ...).

  2. #2
    Senior Member brtaylor's Avatar
    Join Date
    Mar 2016
    Location
    Portland, OR
    Posts
    528
    Yes, the interrupt is IRQ_USBOTG.

  3. #3
    Senior Member
    Join Date
    Jan 2013
    Posts
    181
    What is the larger context? What do you want to do in the interrupt handler?

    Locate "serialEvent" in the Teensyduino source code. You'll find it in <arduino-ide-app>/Contents/Java/hardware/teensy/avr/cores/teensy3/usb_serial.h. Would using serialEvent be sufficient for your needs?

  4. #4
    Senior Member
    Join Date
    Jan 2013
    Posts
    181
    I see now that serialEvent is part of standard Arduino, not just Teensyduino. Here's the Arduino documentation for serialEvent().

Posting Permissions

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