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

Thread: SGTL5000 audio board codec on SPI bus

  1. #1
    Junior Member
    Join Date
    Jan 2020

    SGTL5000 audio board codec on SPI bus

    Goodmorning everyone. Checking on the datasheet and on the diagram of the Audio Board, I saw that it is possible to interrupt the communication pins TX and RX to mount two audio boards on the same teensy. This is because communication takes place on the I2C BUS and the codec can only have two addresses.
    Would it be theoretically possible instead to switch to codec control via SPI, where pin 31 becomes the Chip select (CS) and therefore have more codecs on SPI BUS?
    Is it possible to share I2S data input and data output pins on the codec bus by selecting them with the CS?
    The same for MLCK, BLCK, LRCK pins?

    Thanks in advance

  2. #2
    The Audio Boards would need a redesign to be able to use SPI for control I am pretty sure. only the control data is sent via I2C. audio is sent via I2S which is a common protocol for sending audio.

    MLCK, BLCK, LRCK are I2S clock signals and are never interrupted even when using two I2S audio boards together. The audio is served to each audio board separately via its own pin

    Is your objective to get more outputs?

  3. #3
    Junior Member
    Join Date
    Jan 2020
    Yes, I would like to make a multichannel system using the audio board codec, using the Teensy audio library.
    cannot the audio data (TX&RX) always be sent on the same bus based on the selection of the right codec via the CS pin? Do they have to be separate for each individual codec?


  4. #4
    Someone else feel free to correct me on this if I am wrong but I am pretty sure each I2S connection needs constant data or it wont work, it doesn't work like SPI.

    I have just spent a lot of time working out what the options for multi out are for my own project...

    if you are on Teensy 3.X you can use the ADAT output in the audio library. See the documentation in the audio system design tool. You can also get ADAT going on Teensy 4.X but you have to replace the adat_output file as per this post..

    The best option is to use TDM and the CS42448 chip for 6 in 8 out as per this article...
    The drawback here is that you need to be able to solder SMD components so I haven't gone down this route.

    I am currently using this solution for 4 outs per teensy and triggering multiple Teensys via serial to get the number of outputs I need... (the specs on this DAC are better than the specs on the CS42448 and much better than the audio shield)!

    This project also looks very interesting I am waiting to hear if JayShoe has it up and running...

    If you need more outputs than that, make sure that the Teensy can actually supply/generate the audio for that many channels at a speed that suits your application.

  5. #5
    Junior Member
    Join Date
    Jan 2020
    Thank you very much, the project is very interesting. I'm going to read it all!

Posting Permissions

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