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

Thread: Sharing Pins- Audio Adapter Shield- and Wi Fi Breakbreakout

  1. #1
    Junior Member
    Join Date
    Jan 2019
    Posts
    3

    Sharing Pins- Audio Adapter Shield- and Wi Fi Breakbreakout

    Hello, can I share Teensy 3.2 pins- (11 & 12) on my between the audio adaptor board https://www.pjrc.com/store/teensy3_audio.html and wifi breakout https://learn.adafruit.com/adafruit-...eakout/pinouts ?

    Thank you! Sanone

  2. #2
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    2,960
    Quote Originally Posted by Sanone View Post
    Hello, can I share Teensy 3.2 pins- (11 & 12) on my between the audio adaptor board https://www.pjrc.com/store/teensy3_audio.html and wifi breakout https://learn.adafruit.com/adafruit-...eakout/pinouts ?

    Thank you! Sanone
    You need to use the alternate SPI pins for pins 11 and 13. The alternate pin for 11 (MOSI) is pin 7. The alternate pin for 13 (SCLK) is pin 14. The audio board needs to use pins 11 and 13 for I2S objects, instead of them being used as the default pins for SPI:


    Note, some boards don't work too well being shared with other SPI devices like the SD card and flash memory readers on the audio shield. I've heard that for those boards, you need to have additional hardware (tri-state buffer?). Also, if the wifi driver doesn't have support for SPI_TRANSACTIONS, you may need to add that as well.

  3. #3
    Junior Member
    Join Date
    Jan 2019
    Posts
    3
    Quote Originally Posted by MichaelMeissner View Post
    You need to use the alternate SPI pins for pins 11 and 13. The alternate pin for 11 (MOSI) is pin 7. The alternate pin for 13 (SCLK) is pin 14. The audio board needs to use pins 11 and 13 for I2S objects, instead of them being used as the default pins for SPI:


    Note, some boards don't work too well being shared with other SPI devices like the SD card and flash memory readers on the audio shield. I've heard that for those boards, you need to have additional hardware (tri-state buffer?). Also, if the wifi driver doesn't have support for SPI_TRANSACTIONS, you may need to add that as well.
    Thank you Michael, I will try this and let you know.

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,084
    Open any of the Audio library examples which use the SD card, like File > Examples > Audio > WavFilePlayer.

    You'll see these 2 lines.

    Code:
      SPI.setMOSI(SDCARD_MOSI_PIN);
      SPI.setSCK(SDCARD_SCK_PIN);
    You need these in setup(), before you do anything with SPI. These configure which pins will be used for SPI.

    Then connect to pins 7, 12, 14 for MOSI, MISO, SCK. Connect the other signals to any unused pins. Avoid using the pins the audio shield needs for I2C and I2S digital audio.

  5. #5
    Junior Member
    Join Date
    Jan 2019
    Posts
    3
    Quote Originally Posted by PaulStoffregen View Post
    Open any of the Audio library examples which use the SD card, like File > Examples > Audio > WavFilePlayer.

    You'll see these 2 lines.

    Code:
      SPI.setMOSI(SDCARD_MOSI_PIN);
      SPI.setSCK(SDCARD_SCK_PIN);
    You need these in setup(), before you do anything with SPI. These configure which pins will be used for SPI.

    Then connect to pins 7, 12, 14 for MOSI, MISO, SCK. Connect the other signals to any unused pins. Avoid using the pins the audio shield needs for I2C and I2S digital audio.
    Thank you, In your docs in addition to the 2 I2C pins you have the audio chip using 9,11,13,22,23, if I'm understanding correctly I can use any free digital pins to replace any of those? And similarly Can 10 for the SD card and 6 for the memory chip be swapped out with any other digital pins?

Posting Permissions

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