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

Thread: Using less pins - Audio library

  1. #1
    Junior Member
    Join Date
    Jul 2021
    Posts
    6

    Using less pins - Audio library

    Hello,
    So in my latest project I am using a Teensy 4.0 with the audio board. I noticed however (more like saw on this pin diagram: https://www.pjrc.com/store/teensy40_card10a_rev2.png ). That almost all the pins are used up by the audio library. But here is the thing. My project only uses I2S for sound input from the line level input jack and I2S for the sound output. No SD card, no nothing.
    So here is my question. Can I free up some of the pins if I just don't use the SD card for example and remove the SD library from my code?
    Thank You.

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    24,766
    Quote Originally Posted by Kuba0040 View Post
    Can I free up some of the pins if I just don't use the SD card for example and remove the SD library from my code?
    Yes. If you don't call SD.begin(10) in your program (even if you do include SD.h) those SPI pins aren't ever used. Well, except the shield as a pullup resistor on pin 10 which may or may not matter if you use pin 10 for something else.

    Likewise, if you only use I2S input and don't create an instance of the I2S output, pin 7 isn't used by the library at all. But if you want both sound in and out, then both data pins are needed.

    Any use of I2S causes the 3 clock pins to transmit I2S clocks. You also have to use I2C to configure the SGTL5000 chip, but of course I2C is a shared bus so you can connect other chips to SDA & SCL, as long as they use a different I2C address.

  3. #3
    Junior Member
    Join Date
    Jul 2021
    Posts
    6
    Thank You

  4. #4
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    9,054
    Quote Originally Posted by Kuba0040 View Post
    Hello,
    So in my latest project I am using a Teensy 4.0 with the audio board. I noticed however (more like saw on this pin diagram: https://www.pjrc.com/store/teensy40_card10a_rev2.png ). That almost all the pins are used up by the audio library. But here is the thing. My project only uses I2S for sound input from the line level input jack and I2S for the sound output. No SD card, no nothing.
    So here is my question. Can I free up some of the pins if I just don't use the SD card for example and remove the SD library from my code?
    Thank You.
    No not that much pins
    Only these:
    Click image for larger version. 

Name:	2021-07-17 16_04_52-Window.png 
Views:	18 
Size:	25.4 KB 
ID:	25289
    They are all mentioned on the audio shield page: https://www.pjrc.com/store/teensy3_audio.html
    So, you want the pins from the first two rows..

    Edit : Plus GND and 3V3 of course.

    There is a schematic which shows the needed pins, too...

    Edit: Ooops Paul was faster

  5. #5
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany
    Posts
    9,054
    Quote Originally Posted by PaulStoffregen View Post
    Well, except the shield as a pullup resistor on pin 10 which may or may not matter if you use pin 10 for something else..
    And pin 15 has a capacitor which may or may not matter.

Posting Permissions

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