MichaelMeissner
Senior Member+
I've been thinking of soldering up a prototype board for Teensy 4.0 that brings out 2 of the three SPI buses (for uncanny eyes) and also brings out sound. Now, generally I do these one-off boards where I have several connection points with the pins laid out in a standard layout and I use a custom (or standard) cable to connect to the various device. That way, I can treat the Teensy as a lego, adding and subtracting parts, but just using the cables to the breakout points, rather than the usual jumbled mess of a breadboard (even on a breadboard, I tend to use custom cut wires to go from the normal pins to the breakout points). For example, in my setup for 3.6, I have a standardized SPI pinout, and for each different display, I make a custom cable that goes from the breakout to the display, since there is a lot of variation in the pinouts on the displays).
Now, in the 3.x era, I tended to only use the prop shield to bring out the hardware DAC to the amplifier in the prop. shield and connect up a cheap mono speaker. Yeah, its not high fidelity, but for a costume prop, it is good enough.
Now, I haven't read the datasheet for the 1062 much, but at a high level, my understanding of the Teensy 4.0's sound capability is:
For the first i2s connection we have:
For the second i2s connection we have:
For the MQS ports we have (which conflicts with the SPI bus):
For S/PDIF we have:
Now while it isn't listed on the pinout cards, I believe the I2S pins on the Teensy 3.2/3.5/3.6 are:
I gather there is currently no support for S/PDIF on the Teensy 4.0. But I might bring out a breakout for accessing Serial3 now and S/PDIF in the future.
For my purposes, the MQS stuff is less interesting, unless I can use just MQSL. I presume there is some ordering issues to use a display and MQSL, where I presume you have to initialize SPI first, do some magic, and then initialize MQSL. If I were to use a prop shield, I suspect I would not connect pin 12 to the prop shield and then do the magic.
So, without using the audio card, it looks like my main option for sound output is to use I2S.
I've bought one of the cheap MAX98357A i2s -> mono speaker chips, and it has the following inputs:
How do I specify in the I2S setup, which of the 4 output pins to use, or do I need to do a deep dive into the manual?
I looked at the examples in 1.47, and most of the examples assume the use of the Audio Shield, with a few using the DAC. Are there Teensy 4.0 (and 3.x) examples out there that do not use the audio shield, but instead directly connect to an I2S output chip?
Is there an example of using a SPI display and MQSL? Due to the prop shield having flash memory and an amplifier built-in, it is rather convenient to use the prop shield, but some of the pins overlap (such as pin 7 being the first I2S output pin and also the flash memory CS pin for the prop shield). But in using MQSL, I give up the ability to use flash memory from the prop shield. So I think I will move MQS off the list of possibilities.
Are there preferred pinouts to use standard cabling for I2S, S/PDIF, and MQS?
Is there a cheap SPI flash memory that connects with through hole connections that is properly tri-stated that I could use to replace the flash on the prop shield? Note, my soldering skills are not really up to SMT soldering, and most of the flash memory chips listed in the SPI flash memory page seem to be obsolete.
Does S/PDIF and MQS work with 3.3v VIN output or do they need 5v (or do they not need ground/VIN outputs)?
I assume Paul can't answer this in a public forum, but is there a timeline for the audio shield that is made directly for the Teensy 4.0 to be announced? The big problem I have with the audio shield is just the size when connected to a Teensy 4.0.
And to really press my luck, it would be nice if there where a prop shield made for the Teensy 4.0 that incorporated I2S and re-arranged the flash/led/audio enable pins to be more friendly for the 4.0.
Thanks in advance.
Now, in the 3.x era, I tended to only use the prop shield to bring out the hardware DAC to the amplifier in the prop. shield and connect up a cheap mono speaker. Yeah, its not high fidelity, but for a costume prop, it is good enough.
Now, I haven't read the datasheet for the 1062 much, but at a high level, my understanding of the Teensy 4.0's sound capability is:
- 2 separate i2s ports;
- 1 MQSR/MQRL Mastering Quality Sound port;
- 1 S/PDIF in/out port;
- 31 PWM pins that with capacitors/resistors can be feed into an amplifier; (and)
- No hardware DAC.
For the first i2s connection we have:
- Master clock (MCLK1) on pin 23;
- Bit clock (BCLK1) on pin 21;
- Left/right channel clock (LRCLK1) on pin 20;
- Input channel on pin 8;
- 4 output channels on pins 7, 32, 9, and 6 (though as Paul mentions elsewhere, it is more complicated and some output pins can be input);
For the second i2s connection we have:
- Master clock (MCLK2) on pin 33;
- Bit clock (BCLK2) on pin 4;
- Left/right channel clock (LRCLK2) on pin 3;
- Input channel on pin 5;
- Output channel on pin 2.
For the MQS ports we have (which conflicts with the SPI bus):
- RIght port (MQSR) on pin 10;
- Left port (MQSL) on pin 12.
For S/PDIF we have:
- S/PDIF input on pin 15;
- S/PDIF output on pin 14.
Now while it isn't listed on the pinout cards, I believe the I2S pins on the Teensy 3.2/3.5/3.6 are:
- Master clock (MCLK) on pin 11;
- Bit clock (BCLK) on pin 9;
- Left/right channel clock (LRCLK) on pin 23;
- Input pin on pin 13;
- Two output pins on pins 22 and 15; (and)
- The 3.5/3.6 have some alternate pins for i2s as well.
I gather there is currently no support for S/PDIF on the Teensy 4.0. But I might bring out a breakout for accessing Serial3 now and S/PDIF in the future.
For my purposes, the MQS stuff is less interesting, unless I can use just MQSL. I presume there is some ordering issues to use a display and MQSL, where I presume you have to initialize SPI first, do some magic, and then initialize MQSL. If I were to use a prop shield, I suspect I would not connect pin 12 to the prop shield and then do the magic.
So, without using the audio card, it looks like my main option for sound output is to use I2S.
I've bought one of the cheap MAX98357A i2s -> mono speaker chips, and it has the following inputs:
- LRCLK;
- BCLK;
- Input (presumably connected to one of the I2S output pins);
- Gain (various connections with resistors or floating to control sound level);
- Shut down (if tied to ground, shuts off the MAX98357A);
- Ground;
- Vin (2.5-5.5v).
How do I specify in the I2S setup, which of the 4 output pins to use, or do I need to do a deep dive into the manual?
I looked at the examples in 1.47, and most of the examples assume the use of the Audio Shield, with a few using the DAC. Are there Teensy 4.0 (and 3.x) examples out there that do not use the audio shield, but instead directly connect to an I2S output chip?
Is there an example of using a SPI display and MQSL? Due to the prop shield having flash memory and an amplifier built-in, it is rather convenient to use the prop shield, but some of the pins overlap (such as pin 7 being the first I2S output pin and also the flash memory CS pin for the prop shield). But in using MQSL, I give up the ability to use flash memory from the prop shield. So I think I will move MQS off the list of possibilities.
Are there preferred pinouts to use standard cabling for I2S, S/PDIF, and MQS?
Is there a cheap SPI flash memory that connects with through hole connections that is properly tri-stated that I could use to replace the flash on the prop shield? Note, my soldering skills are not really up to SMT soldering, and most of the flash memory chips listed in the SPI flash memory page seem to be obsolete.
Does S/PDIF and MQS work with 3.3v VIN output or do they need 5v (or do they not need ground/VIN outputs)?
I assume Paul can't answer this in a public forum, but is there a timeline for the audio shield that is made directly for the Teensy 4.0 to be announced? The big problem I have with the audio shield is just the size when connected to a Teensy 4.0.
And to really press my luck, it would be nice if there where a prop shield made for the Teensy 4.0 that incorporated I2S and re-arranged the flash/led/audio enable pins to be more friendly for the 4.0.
Thanks in advance.
Last edited: