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

Thread: Dual Serial + Audio on Teensy 3.2?

  1. #1
    Junior Member
    Join Date
    Jan 2021
    Posts
    17

    Dual Serial + Audio on Teensy 3.2?

    Can I have 2 USB serial ports plus audio on the 3.2? I don't need MIDI.

    -Steve

  2. #2
    I'm wondering more or less the same. I'm doing a MIDI controller (which we all know, uses Serial) but want to also output audio.
    One thing for certain tho, might need the audio board, I didn't find a way around it. For my use case (speaker output), it was also true when linking with an amp chip

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    24,098
    Yes, but you will need to edit usb_desc.h to create a custom USB config. See the comments in that file for details.

    Remember there are 2 copies of this file, one for Teensy 3 and the other for Teensy 4, so make sure you're editing the correct file. Easiest way is to add a syntax error and make sure the compiler catches it.

  4. #4
    Junior Member
    Join Date
    Jan 2021
    Posts
    17
    I got that to work. Thank you!

  5. #5
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    24,098
    Maybe consider sharing your usb_desc.h file? Might help others who find this thread.

    If using Quick Reply, click "Go Advanced" to get the full editor which lets you attach a file to your message.

  6. #6
    Junior Member
    Join Date
    Jan 2021
    Posts
    17
    I hijacked USB_MIDI_AUDIO_SERIAL like so:

    Code:
    #elif defined(USB_MIDI_AUDIO_SERIAL)
      #define VENDOR_ID		0x16C0
      #define PRODUCT_ID		0x048D
      #define MANUFACTURER_NAME	{'T','e','e','n','s','y','d','u','i','n','o'}
      #define MANUFACTURER_NAME_LEN	11
      #define PRODUCT_NAME		{'T','e','e','n','s','y',' ','A','u','d','i','o'}
      #define PRODUCT_NAME_LEN	12
      #define EP0_SIZE		64
      #define NUM_ENDPOINTS		7
      #define NUM_USB_BUFFERS	32
      #define NUM_INTERFACE		7
      #define CDC_IAD_DESCRIPTOR	1	// Serial
      #define CDC_STATUS_INTERFACE	0
      #define CDC_DATA_INTERFACE	1
      #define CDC_ACM_ENDPOINT	1
      #define CDC_RX_ENDPOINT	2
      #define CDC_TX_ENDPOINT	2
      #define CDC_ACM_SIZE		16
      #define CDC_RX_SIZE		64
      #define CDC_TX_SIZE		64
      #define CDC2_STATUS_INTERFACE	2	// SerialUSB1
      #define CDC2_DATA_INTERFACE	3
      #define CDC2_ACM_ENDPOINT	3
      #define CDC2_RX_ENDPOINT	4
      #define CDC2_TX_ENDPOINT	4
      #define CDC2_ACM_SIZE		16
      #define CDC2_RX_SIZE		64
      #define CDC2_TX_SIZE		64
      #define AUDIO_INTERFACE	4	// Audio (uses 3 consecutive interfaces)
      #define AUDIO_TX_ENDPOINT     5
      #define AUDIO_TX_SIZE         180
      #define AUDIO_RX_ENDPOINT     6
      #define AUDIO_RX_SIZE         180
      #define AUDIO_SYNC_ENDPOINT	7
      #define ENDPOINT1_CONFIG	ENDPOINT_TRANSMIT_ONLY
      #define ENDPOINT2_CONFIG	ENDPOINT_TRANSMIT_AND_RECEIVE
      #define ENDPOINT3_CONFIG	ENDPOINT_TRANSMIT_ONLY
      #define ENDPOINT4_CONFIG	ENDPOINT_TRANSMIT_AND_RECEIVE
      #define ENDPOINT5_CONFIG	ENDPOINT_TRANSMIT_ISOCHRONOUS
      #define ENDPOINT6_CONFIG	ENDPOINT_RECEIVE_ISOCHRONOUS
      #define ENDPOINT7_CONFIG	ENDPOINT_TRANSMIT_ISOCHRONOUS

Posting Permissions

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