I am currently in the process of designing a Bluetooth voice modulator.
Project GitHub
Project Site documenting test boards.
Hardware in use:
Teensy 3.2 - PJRC
Audio Adaptor Board for Teensy - PJRC
Silicon Labs WT32i (datasheet here).
The proposed functionality is as follows:
This configuration would seem to require that the Teensy act as a Master to two I2S slave devices (the SGTL5000 on the Audio Adaptor Board and the WT32i).
This would seem somewhat akin to the quad-channel audio mentioned in this post.
Documented on Sparkfun (although this is for quad-output which doesn't seem to be what I need).
And, of course, possibly the very little documentation provided with the AudioInputI2SQuad (i2s_quad) function of the Teensy Audio Library.
Indeed, the description of this function states:
Here is a simplified diagram that is representative of the proposed configuration:
As per the audio tutorial and Audio Library tutorial video, the Teensy is perfectly capable of reading a WAV file from an SD card upon a GPIO event and playing this audio through the headphone out of the Audio Adaptor Board.
This satisfies points 1, 2, 5, and 6 of the above-listed proposed functionality list, leaving only points 3 and 4:
3. The WT32i will act as a slave, receiving its clock signals from the Teensy.
4. The Teensy will pass the data from the WT32i I2S to the SGTL5000 which will play this audio through the headphone out of the Audio Adaptor Board.
From section 9.3 of the WT32i's datasheet regarding the I2S interface:
So the WT32i is perfectly capable of acting as a slave and receiving clocks from an outside source.
The pinout on the WT32i is as such:
View attachment 8030
(Note that earlier versions of the datasheet, like those on Mouser, have the pins incorrectly numbered. The most recent datasheet can be found here.)
The WT32i documentation uses different vernacular for its I2S signals than Teensy does.
From the I2S Wiki page it would seem that the I2S Word Select line on the WT32i corresponds to the LRCLK line of the Teensy:
And that the the WT32i's "I2S Clock" would correspond to the Teensy's Bit Clock (BCLK).
Here is my best guess at a netlist:
QUESTIONS:
Are there any particularly well documented examples of using the Teensy to read data from an external I2S slave (along with or other than the SGTL5000)?
Can the clock signals from an I2S Master (The Teensy) simply be tied to multiple Slaves (WT32i and SGTL5000) or is some other configuration required?
It would seem so, but I'm having a difficult time confirming this absolutely.
The Teensy to Audio Adaptor Board connections are fine. I essentially need to figure out where to route the WT32i's connections.
Is the Teensy expecting the I2S data to be left or right justified?
Can the WT32i's "I2s Data Output" line be connected to the Teensy's RX (13) pin or would it need it's own dedicated pin?
I'm thinking that the Teensy will probably require a unique pin for each I2S Slave (WT32i and SGTL5000) but perhaps I'm over complicating the matter entirely.
I would guess that perhaps the WT32i's "I2S Data Output" pin might need to be routed to Teensy pin 30 on the underside of the board as it is shown as the secondary RX in the AudioInputI2SQuad function.
What might the Teensy Audio System Design Tool configuration function blocks and their connections look like for this type of setup?
Presumably it will require an AudioControlSGTL5000 (sgtl5000) object and a AudioOutputI2S (i2s) object for headphone output as well as an AudioPlaySdWav (playSdWav) object for reading from the SD card.
I would think that I could get away with a single AudioInputI2S (i2s) function to read from the WT32i but perhaps I'm missing something that might require AudioInputI2SQuad (i2s_quad) instead?
My apologies for the confusion, it just doesn't seem terribly well documented anywhere that I can seem to located.
It is quite possible that I am making mountains out of molehills but I'm having a rather difficult time finding appropriate documentation to check my work.
Any assistance or recommendations that anyone can provide would be greatly appreciated!
Project GitHub
Project Site documenting test boards.
Hardware in use:
Teensy 3.2 - PJRC
Audio Adaptor Board for Teensy - PJRC
Silicon Labs WT32i (datasheet here).
The proposed functionality is as follows:
- The Teensy will act as the I2S Master, generating all clocks.
- The SGTL5000 on the Audio Adaptor Board will act as a slave, receiving its clock signals from the Teensy.
- The WT32i will act as a slave, receiving its clock signals from the Teensy.
- The Teensy will pass the data from the WT32i I2S to the SGTL5000 which will play this audio through the headphone out of the Audio Adaptor Board.
- The Teensy, upon receiving a PMW signal or GPIO state, will read a WAV file from a SanDisk SD card on the Audio Adaptor Board.
- The Teensy will play this WAV file through the headphone out of the Audio Adaptor Board.
This configuration would seem to require that the Teensy act as a Master to two I2S slave devices (the SGTL5000 on the Audio Adaptor Board and the WT32i).
This would seem somewhat akin to the quad-channel audio mentioned in this post.
Documented on Sparkfun (although this is for quad-output which doesn't seem to be what I need).
And, of course, possibly the very little documentation provided with the AudioInputI2SQuad (i2s_quad) function of the Teensy Audio Library.
Indeed, the description of this function states:
Receive 16 bit quad (4) channel audio from two audio shields or another I2S devices, using I2S master mode.
Here is a simplified diagram that is representative of the proposed configuration:
As per the audio tutorial and Audio Library tutorial video, the Teensy is perfectly capable of reading a WAV file from an SD card upon a GPIO event and playing this audio through the headphone out of the Audio Adaptor Board.
This satisfies points 1, 2, 5, and 6 of the above-listed proposed functionality list, leaving only points 3 and 4:
3. The WT32i will act as a slave, receiving its clock signals from the Teensy.
4. The Teensy will pass the data from the WT32i I2S to the SGTL5000 which will play this audio through the headphone out of the Audio Adaptor Board.
From section 9.3 of the WT32i's datasheet regarding the I2S interface:
The digital audio interface supports the industry standard formats for I2S, left-justified or righ justified.
The interface shares the same pins as the PCM interface, which means each audio bus is mutually exclusive in its usage.
The internal representation of audio samples within WT32i is 16-bit and data on SD_OUT is limited to 16-bit per channel.
WT32i is not capable of generating the master clock for I2S, so it can only be used as a master with a codec that is capable of producing the master clock from the SCK.
The interface shares the same pins as the PCM interface, which means each audio bus is mutually exclusive in its usage.
The internal representation of audio samples within WT32i is 16-bit and data on SD_OUT is limited to 16-bit per channel.
WT32i is not capable of generating the master clock for I2S, so it can only be used as a master with a codec that is capable of producing the master clock from the SCK.
So the WT32i is perfectly capable of acting as a slave and receiving clocks from an outside source.
The pinout on the WT32i is as such:
View attachment 8030
(Note that earlier versions of the datasheet, like those on Mouser, have the pins incorrectly numbered. The most recent datasheet can be found here.)
The WT32i documentation uses different vernacular for its I2S signals than Teensy does.
From the I2S Wiki page it would seem that the I2S Word Select line on the WT32i corresponds to the LRCLK line of the Teensy:
Word clock line - also called word select (WS) or left right clock (LRCLK)
And that the the WT32i's "I2S Clock" would correspond to the Teensy's Bit Clock (BCLK).
Here is my best guess at a netlist:
WT32i | SGTL5000 | Teensy |
I2S_IN (27) I2S Data Input | Not connected | Not Connected |
I2S_OUT (28) I2s Data Output | I2S_DIN (26) | RX (13) |
I2S_WS (29) I2S Word Select | I2S_LRCLK (23) | LRCLK (23) |
I2S_SCK (30) I2S Clock | I2S_SCLK (24) | BCLK (9) |
QUESTIONS:
Are there any particularly well documented examples of using the Teensy to read data from an external I2S slave (along with or other than the SGTL5000)?
Can the clock signals from an I2S Master (The Teensy) simply be tied to multiple Slaves (WT32i and SGTL5000) or is some other configuration required?
It would seem so, but I'm having a difficult time confirming this absolutely.
The Teensy to Audio Adaptor Board connections are fine. I essentially need to figure out where to route the WT32i's connections.
Is the Teensy expecting the I2S data to be left or right justified?
Can the WT32i's "I2s Data Output" line be connected to the Teensy's RX (13) pin or would it need it's own dedicated pin?
I'm thinking that the Teensy will probably require a unique pin for each I2S Slave (WT32i and SGTL5000) but perhaps I'm over complicating the matter entirely.
I would guess that perhaps the WT32i's "I2S Data Output" pin might need to be routed to Teensy pin 30 on the underside of the board as it is shown as the secondary RX in the AudioInputI2SQuad function.
What might the Teensy Audio System Design Tool configuration function blocks and their connections look like for this type of setup?
Presumably it will require an AudioControlSGTL5000 (sgtl5000) object and a AudioOutputI2S (i2s) object for headphone output as well as an AudioPlaySdWav (playSdWav) object for reading from the SD card.
I would think that I could get away with a single AudioInputI2S (i2s) function to read from the WT32i but perhaps I'm missing something that might require AudioInputI2SQuad (i2s_quad) instead?
My apologies for the confusion, it just doesn't seem terribly well documented anywhere that I can seem to located.
It is quite possible that I am making mountains out of molehills but I'm having a rather difficult time finding appropriate documentation to check my work.
Any assistance or recommendations that anyone can provide would be greatly appreciated!
Last edited: