Is there a Teensy 4.1 Reference Book ?

Hi,

I would like to know if it exist a Teensy Reference Book, describing all the available functions ?

Or a place where I could find all the functions: for example, for the FIR component, or the various SPDIF inputs ?...

Thanks,
P.S.: I work on a project with a Teensy 4.1
 
Hi,

I would like to know if it exist a Teensy Reference Book, describing all the available functions ?

Or a place where I could find all the functions: for example, for the FIR component, or the various SPDIF inputs ?...

Thanks,
P.S.: I work on a project with a Teensy 4.1

I'm not aware of one, but there are various places scattered around this site and others that can give some information. Lets see:
 
Great ! Your spreadsheet is incredible: I cannot imagine how many hours it took to complete this work ...

But I have not found in your spreadsheet (nor elsewhere) a clear identification of the pins used for I2S(1) and I2S(2) on the Teensy 4.1 board ?

I have read somewhere that there are two I2S buses on the Teensy 4.1, each of them can be used as Input and as Output, and I have read also that "it is simple to transform a I2S bus to an SPDIF bus"....

For my current project, I need to identify the pins of each I2S bus...

Thank you !
 
Great ! Your spreadsheet is incredible: I cannot imagine how many hours it took to complete this work ...

But I have not found in your spreadsheet (nor elsewhere) a clear identification of the pins used for I2S(1) and I2S(2) on the Teensy 4.1 board ?

I have read somewhere that there are two I2S buses on the Teensy 4.1, each of them can be used as Input and as Output, and I have read also that "it is simple to transform a I2S bus to an SPDIF bus"....

For my current project, I need to identify the pins of each I2S bus...

Thank you !

You found the answer already, but for anybody else curious, the pinout card lists all of the sound related pins in yellow. The ones with '1' in the name are the first I2S bus, and the ones with the '2' in the name are the second I2S bus. I have these same names in the sound columns BF (Teensy 4.0) and BF (Teensy 4.1). The MQS* and S/PDIF pins are for different sound related actions. To recap:

  • I2S1 pins
  • MCLK1: 23
  • BCLK1: 21
  • LRCLK1: 20
  • OUT1A: 7 (alternative on Teensy 4.1, pin 39)
  • OUT1B: 32
  • OUT1C: 9
  • OUT1D: 6
  • IN1: 8 (alternative on Teensy 4.1, pin 38)

  • I2S2 pins
  • MCLK2: 33
  • BCLK2: 4
  • LRCLK2: 3
  • OUT2: 2
  • IN2: 5

  • MQS pins
  • MQSR: 10
  • MQSL: 12

  • S/PDIF pins
  • S/PDIF OUT: 14
  • S/PDIF IN: 15

IIRC, while I2S1 has 5 pins that the pinout card lists 4 as being outputs, and 1 as being input, you can actually change them around if you dig into the depth of the user manual. I2S2 only has 2 pins.

While the 2 I2S buses can also do S/PDIF, I suspect it would be better to use the pins that have direct hardware S/PDIF support (pins 14 and 15).

Now, the spreadsheet wasn't written in one shot. I've been tweaking it over time. I've been using Teensys since the original Teensy 3.0 kickstarter. As we got into the 3.5/3.6, and then the LC, and finally the 4.0/4.1, the main use was to assist me in laying out prototype boards that I can plop a Teensy 3.2 or 3.5, and know what pins I should connect, etc.
 
well ... your last message is a bit confusing for me (I exclusively work on the Teensy 4.1), so I believe that I have missed some points !
Therefore I have 2 more questions:

Q1:
You write:
while I2S1 has 5 pins that the pinout card lists 4 as being outputs, and 1 as being input, you can actually change them around if you dig into the depth of the user manual.
I2S2 only has 2 pins.

Why do you say that I2S2 has only 2 pins, whereas you list:
I2S2 pins
MCLK2: 33
BCLK2: 4
LRCLK2: 3
OUT2: 2
IN2: 5

Q2:
You write:
While the 2 I2S buses can also do S/PDIF, I suspect it would be better to use the pins that have direct hardware S/PDIF support (pins 14 and 15).

This is important for my project, because the input is always SPDIF, and the output will be SPDIF in most cases, but I2S in a few cases, and SPI in a few others.

If I understand what you mean, I should use the pin 14 for the SPDIF input (named SPDIF IN) and pin 15 for SPDIF OUT: this is exactly what I plan to do when the Input and the Output are both SPDIFs.

But when my Output is I2S, is there any restriction to use I2S1 or I2S2 as Output ? I believe there is none, but...

More interesting for me: do you have a link that can provide information on how to use the I2S ports to act as SPDIF ?

Thank you
 
well ... your last message is a bit confusing for me (I exclusively work on the Teensy 4.1), so I believe that I have missed some points !
Therefore I have 2 more questions:

Q1:
You write:


Why do you say that I2S2 has only 2 pins, whereas you list:
I2S2 pins
MCLK2: 33
BCLK2: 4
LRCLK2: 3
OUT2: 2
IN2: 5

Q2:
You write:


This is important for my project, because the input is always SPDIF, and the output will be SPDIF in most cases, but I2S in a few cases, and SPI in a few others.

If I understand what you mean, I should use the pin 14 for the SPDIF input (named SPDIF IN) and pin 15 for SPDIF OUT: this is exactly what I plan to do when the Input and the Output are both SPDIFs.

But when my Output is I2S, is there any restriction to use I2S1 or I2S2 as Output ? I believe there is none, but...

More interesting for me: do you have a link that can provide information on how to use the I2S ports to act as SPDIF ?

Thank you

Paul, FrankB, or somebody more familiar probably should explain it better, but what I meant by ports is the non-specific pins that can be configured for either input or output. I didn't include MCLK, LRCLK, and BCLK since those are required for I2S. In theory, with I2S1, since there are 5 pins that that can be configured, you could have 5 outputs and no inputs, or 4 inputs and 1 output, etc. By default, 1 pin is configured for input, and 1 for output, and the other 3 pins are not used. The 2nd I2S port only has 2 pins (i.e. 1 output, 1 input, 2 outputs, or 2 inputs).

Ultimately, you are going to have to dive into the iMX RT1060 reference manual (https://www.pjrc.com/teensy/IMXRT1060RM_rev2.pdf), pages around 2065 through 2151, if you are going to do more than the library provides. I've only used the library for I2S1 and I2S2 with the standard input/output pins.

If you go into the audio design tool (https://www.pjrc.com/teensy/gui/), and add the various I2S and S/PDIF inputs and outputs to the project, when you click on them, on the right side is the documentation for the parameters and such. The input/output spdif1 is S/PDIF over I2S1, output spdif2 is S/PDIF over I2S2, input/output spdif3 uses the hardware pins, and input spdif_async resamples the S/PDIF3 input to make it fit into the standard I2S data rates. All I know about this is what the gui tool documents.
 
Paul, FrankB, or somebody more familiar probably should explain it better, but what I meant by ports is the non-specific pins that can be configured for either input or output. I didn't include MCLK, LRCLK, and BCLK since those are required for I2S. In theory, with I2S1, since there are 5 pins that that can be configured, you could have 5 outputs and no inputs, or 4 inputs and 1 output, etc. By default, 1 pin is configured for input, and 1 for output, and the other 3 pins are not used. The 2nd I2S port only has 2 pins (i.e. 1 output, 1 input, 2 outputs, or 2 inputs).
Close but ... I2S1 (SAI1 within the chip) has 5 I/O lines, but one is always Tx and one always Rx, so the 5+0 and 0+5 configurations are unavailable. I2S2 (SAI2) can only be 1+1; see pages 1962 and 1963 in the Reference Manual. There's no library support for more than one input line on I2S1, but AudioOutputI2S, AudioOutputI2SQuad, AudioOutputI2SHex and AudioOutputI2SOct, support up to 4 output lines (each carrying 2 audio streams).

I've been playing about with S/PDIF, related to another thread (https://forum.pjrc.com/threads/70814-Modify-audio-on-the-fly-can-do), and have removed some of the restrictions on combinations of audio I/O, specifically the synchronous S/PDIF objects AudioInputSPDIF3 and AudioOutputSPDIF3 vs. the I2S objects. If you're happy to use AsyncAudioInputSPDIF3 then you don't need to worry, but if it's of use then you can find an experimental branch of the Audio library at https://github.com/h4yn0nnym0u5e/Audio/tree/feature/sync-SPDIF-IO2.
 
You really should be looking at the design tool.

https://www.pjrc.com/teensy/gui/

If you haven't used it before, and how it works isn't clear, check out the audio tutorial.

https://www.pjrc.com/store/audio_tutorial_kit.html

The design tool is explained starting on page 8 of the PDF. There's also a walkthrough video if you'd prefer to see it.

Each type of audio input and output is represented on the left side of the design tool, and they're documented in the right side panel as you click on each. The design tool documentation clearly explains the specific pins used. Other important details are also documented there. You initially asked for a reference book, and as far as audio is concerned, the design tool documentation really is the best reference for all things audio on Teensy.

You'll see there are many I2S inputs and outputs available, covering all the supported combinations of the pins discussed so far on this thread. You could spend a lot of time reading the IMXRT reference manual and studying the pin mux features, but ultimately that's just not a good use of your time unless you intend to write your own audio drivers (or entire audio library). Ultimately you'll end up using the existing library, so you might as well focus your effort on the features offered by the design tool, since that's the existing code you'll end up using.

The design tool also "knows" about the specific resources each input and output requires. If you place 2 or more onto the canvas which have conflicting resource requirements, you'll see little yellow warning icons appear. Clicking those icons will show a (probably cryptic) message about the conflict. Spending just a few minutes to find the inputs and outputs you design and putting them onto the canvas to check whether they are able to work together can save you a lot of frustration later.
 
There's no library support for more than one input line on I2S1
My bad ... as Paul says, there is support for up to 8 audio inputs (via 4 input pins) on I2S1:

You really should be looking at the design tool.
<snip/>
Each type of audio input and output is represented on the left side of the design tool, and they're documented in the right side panel as you click on each. The design tool documentation clearly explains the specific pins used. Other important details are also documented there. You initially asked for a reference book, and as far as audio is concerned, the design tool documentation really is the best reference for all things audio on Teensy.

You'll see there are many I2S inputs and outputs available, covering all the supported combinations of the pins discussed so far on this thread.
<snip/>
The design tool also "knows" about the specific resources each input and output requires. If you place 2 or more onto the canvas which have conflicting resource requirements, you'll see little yellow warning icons appear. Clicking those icons will show a (probably cryptic) message about the conflict. Spending just a few minutes to find the inputs and outputs you design and putting them onto the canvas to check whether they are able to work together can save you a lot of frustration later.
As ever, good advice, taken by too few! Some caution is needed, because older objects' documentation, typically pre-Teensy 4.x, tends not to mention the extra I/O added with Teensy 4.x, or does so but in a potentially confusing way. If something "conflicts with I2S", it may not be apparent to the new user that you can still use I2S2, for example.

With my revised objects I have tried to update the Design Tool documentation to reflect the new behaviour, but I'm open to suggestions on how to clarify my explanations!
 
Kindly mention that one here, so well can all know.... :( :(

Hard to do, because no-one can predict how someone else might misinterpret or be confused by documentation. An example is this thread: https://forum.pjrc.com/threads/71271-Distributed-DSP-and-I2S-TDM?p=314178#post314178. The I2S stereo output (AudioOutputI2S) documentation says "Only one I2S input and one I2S output object may be used." Sort of no longer true, if you have a Teensy 4.x, because they give you the ability to use an AudioOutputI2S2 object (pretty similar to the TDM object discussion).

Maintaining documentation is a hard, time-consuming and pretty thankless task...
 
Hard to do, because no-one can predict how someone else might misinterpret or be confused by documentation. An example is this thread: https://forum.pjrc.com/threads/71271-Distributed-DSP-and-I2S-TDM?p=314178#post314178. The I2S stereo output (AudioOutputI2S) documentation says "Only one I2S input and one I2S output object may be used." Sort of no longer true, if you have a Teensy 4.x, because they give you the ability to use an AudioOutputI2S2 object (pretty similar to the TDM object discussion).

Maintaining documentation is a hard, time-consuming and pretty thankless task...


Totally agree
 
Back
Top