Teensy 4.0 I2S Support

Status
Not open for further replies.
On the pinout reference card, I had to make some compromises for the sake of simplicity and limited space. So the 5 data signals are labeled "IN1, OUT1A, OUT1B, OUT1C, OUT1D", which implies the mode of stereo input and 8 channel output. 1 of these 5 is on a bottom side pad, because again so many difficult trade offs were required in assigning the pinout.

Shouldn't this be labeled as SAI1A, SAI1B, SAI1C, SAI1D, SAI1E, and SAI2IN SAI2OUT? For my project I'm going to be converting some of the outputs as inputs. The OUT1A, OUT1B, OUT1C, OUT1D can be either in or out. However, I'm pretty sure the SAI2 is fixed as an in/out combination (no option for switching them to out/out or in/in), unless I'm mistaken. I also know this is not necessarily supported in software yet.

===============

I just completed a design of a board. I had some success with the breadboard, but loose wires are causing me pain. So i'm going to PCB now and I'm antsy to give it a go. I'll probably order the board later today. I have PCM5242, PCM1865, and ESP32WROOM all on one 4-layer board. There is also an expansion header for the SAI2 ports for future testing. Here is how I have it hooked up.

PCM5242 (balanced/single ended output x2)
- CLOCKS 1 (BCLK1, LRCLK1, MCLK1)
- DATA OUT1A
PCM1865 (balanced/single ended input x4, with mic pre)
- CLOCKS 1
- DATA1 = IN1 (CHANNELS 1 + 2 OF PCM1865)
- DATA2 = OUT1D (PLANNED FOR INPUT AS OPPOSED TO OUTPUT, CHANNELS 3+4 OF PCM1865)
ESP32 (A2DP input or output, not simultaneous)
- CLOCKS 1
- DATA FROM ESP32 TO T4 = OUT1C (WHEN SINK, RECEIVING BT-AUDIO IN, INPUT ON TEENSY)
- DATA TO ESP32 FROM T4 = OUT1B (WHEN SOURCE, SENDING BT-AUDIO OUT)
EXPANSION HEADER
- CLOCKS 2 (BCLK2, LRCLK2, MCLK2)
- DATA OUT = OUT2
- DATA IN = IN2

On the breadboard I've confirmed that the PCM5242 hooked to OUT1A, and the PCM1865 hooked to IN1 is working with the audio passthrough sketch. The rest is unconfirmed but like I said, the breadboard is causing issues. I'm hoping that when this board is built I'll get at the very minimum 2 channels output and 2 channels input working with stability. Then the other two input channels, and the ESP32 will be a project that will require software. Hopefully it's hooked up right at least.

I included a footprint for a 100OHM resistor on both MCLK1 and MCLK2. I'm not sure if it's needed or not. It also seems that there might be a way to "adjust" the MCLK levels in software instead of the resistor?

Once I finish staring at the layout and schematic a little longer I'll order the board and start putting it together for testing. I found a few errors this morning, after about a month or more of designing it (and years of research). I guess sometimes you just need to hit "print" and keep your fingers crossed. :)

Teensy4 - PCM5242 - PCM1865 - ESP32 - Front.jpg
 
I didn't ask anything specific but would love to hear your feedback on my digital audio mixer project details so far. Would a schematic help to get feedback? I haven't decided how far I want to share the full project yet, but I can be convinced. I might just share the schematic and not the PCB, I think Blackaddr did this with his guitar pedal.

I can't find the thread where Paul hooked up a T4 to the CS42448 board. If anyone can link to it I would appreciate it. I thought we had a confirmation that it was working. I would like to review the pinouts with what I posted above to make sure I've at least chosen the right data lines for my project... Lines that will have the most likelyhood to work.

I also plan on sending assembled samples to a few peope who have interest in helping with the software, paid or unpaid. The drivers for the chips I'm using will be open source. I'll also want to integrate with OSC protocol to control the mixer (open sound control). I do realize my project will be as much work in software as it has been in hardware. But I figure having a correctly designed PCB will make it easier to find the help - so that's where I'm at. :)

Any feedback on the board so far?

Edit: that's right, the CS42448 is using TDM and my design opted for non-TDM to utilize all the new SAI lines on the T4. That's why the T4 helped me more forward. I would have needed TDM for my project on the 3.6. The board I've designed can technically be stacked, to get two PCM5242 and two PCM1865's working on the same lines under different addresses with TDM.
 
You might want to create your own separate project thread for discussing your mixer design, it may get more views that way.
 
You might want to create your own separate project thread for discussing your mixer design, it may get more views that way.

Ok, yes. Thanks for pointing that out. My original reply regarding the renaming of SAI ports was on topic but my project wasn't. I'll build one of these and then create a new post with my findings and questions.
 
I just put together my own version of the audio shield on a board, and I'm pretty sure that the rev D schematic that is posted here is incorrect. It lists pin 8 on teensy -> sgtl 5000 pin 26 and pin 7 on teensy -> sgtl 5000 pin 25. I found that I needed to flip those two lines to get audio out of the codec. Other than that everything seems to work hunky dory.
 
I just put together my own version of the audio shield on a board, and I'm pretty sure that the rev D schematic that is posted here is incorrect. It lists pin 8 on teensy -> sgtl 5000 pin 26 and pin 7 on teensy -> sgtl 5000 pin 25. I found that I needed to flip those two lines to get audio out of the codec. Other than that everything seems to work hunky dory.

I think your correct on that. The table above the schematic is correct.
 
Has there been any success in getting quad I2S (quad for both inputs and for outputs) working with Teensy4? If so, has it been folded into the Audio library yet?

(I tried searching the forum, but the search results that I found aren't terribly conclusive. So, forgive me if it is clearly stated somewhere that I missed it.)

I know that there are a couple of ways that quad could be implemented on the T4. So, in addition to having four-channel functionality, I'm also curious as to which approach was taken for the solution.

Thanks,

Chip
 
Status
Not open for further replies.
Back
Top