Page 1 of 2

Technical Reference I2S Clock config section is confusing

Posted: Sat Apr 01, 2017 9:20 am
by WiFive
For the configuration of I2S0 peripheral clock output: When PIN_CTRL[3:0] = 0x0, select and
output module clock on the CLK_OUT1 in the IO_MUX Pad Summary;
When PIN_CTRL[3:0] = 0x0 and PIN_CTRL[7:4] = 0x0, select and output module clock on the
CLK_OUT2 in the IO_MUX Pad Summary;
When PIN_CTRL[3:0] = 0x0 and PIN_CTRL[11:8] = 0x0; select and output module clock on the
CLK_OUT3 in the IO_MUX Pad Summary.
For the configuration of I2S1 peripheral clock output: When PIN_CTRL[3:0] = 0xF, select and
output module clock on CLK_OUT1-3. (R/W)
This is confusing.

Re: [Documentation Release] ESP32 Technical Reference

Posted: Sat Apr 01, 2017 5:28 pm
by rudi ;-)
WiFive wrote:
For the configuration of I2S0 peripheral clock output: When PIN_CTRL[3:0] = 0x0, select and
output module clock on the CLK_OUT1 in the IO_MUX Pad Summary;
When PIN_CTRL[3:0] = 0x0 and PIN_CTRL[7:4] = 0x0, select and output module clock on the
CLK_OUT2 in the IO_MUX Pad Summary;
When PIN_CTRL[3:0] = 0x0 and PIN_CTRL[11:8] = 0x0; select and output module clock on the
CLK_OUT3 in the IO_MUX Pad Summary.
For the configuration of I2S1 peripheral clock output: When PIN_CTRL[3:0] = 0xF, select and
output module clock on CLK_OUT1-3. (R/W)
This is confusing.

if you read between the lines:
( without warranty )

For the configuration of I2S0 peripheral clock output:

When PIN_CTRL[3:0] = 0x0
select and output module clock on the CLK_OUT1 in the IO_MUX Pad Summary;
means output clock: CLK_OUT1

When PIN_CTRL[3:0] = 0x0 and PIN_CTRL[7:4] = 0x0
select and output module clock on the CLK_OUT2 in the IO_MUX Pad Summary;
means output clock: CLK_OUT2

When PIN_CTRL[3:0] = 0x0 and PIN_CTRL[11:8] = 0x0
select and output module clock on the CLK_OUT3 in the IO_MUX Pad Summary.
means output clock: CLK_OUT3


For the configuration of I2S1 peripheral clock output:

When PIN_CTRL[3:0] = 0xF
select and output module clock on CLK_OUT1-3. (R/W)
means output clock: CLK_OUT1 CLK_OUT2 CLK_OUT3

one thing is not clear: (R/W)
means perhabs we can read ( check ) and write ( set ) on the register

But to search for a logical connection in register pins would be futile :)

I'm not in the i2s at the moment, i am waiting for the pSRAM module then start i2s

best wishes
rudi ;-)

Re: [Documentation Release] ESP32 Technical Reference

Posted: Sat Apr 01, 2017 8:15 pm
by WiFive
rudi ;-) wrote:
if you read between the lines:
Still confusing in color.

Re: Technical Reference I2S Clock config section is confusing

Posted: Wed Jul 19, 2017 2:39 am
by RoyceP
It sort of feels like getting the I2S peripheral clock out to feed the Master Clock input of an I2S DAC boils down to

Code: Select all

PIN_FUNC_SELECT(PIN_CTRL, CLK_OUT1_S); 
and then you get the clock on GPIO0.

Sound right?

It will be few days before I can actually try it, but I thought I'd check-in on this thread.

Re: Technical Reference I2S Clock config section is confusing

Posted: Wed Jul 19, 2017 4:39 am
by WiFive
Section has not been updated.

Re: Technical Reference I2S Clock config section is confusing

Posted: Thu Jul 20, 2017 5:02 am
by iot-bits.com
Here are settings that work (I used these to play 96kHz 24 bps stereo audio via a codec):
If you want to output clock for I2S0 to
CLK_OUT1, then set PIN_CTRL[3:0] = 0x0
CLK_OUT2, then set PIN_CTRL[3:0] = 0x0 and PIN_CTRL[7:4] = 0x0
CLK_OUT3, then set PIN_CTRL[3:0] = 0x0 and PIN_CTRL[11:8] = 0x0

If you want to output clock for I2S1 to
CLK_OUT1, then set PIN_CTRL[3:0] = 0xF
CLK_OUT2, then set PIN_CTRL[3:0] = 0xF and PIN_CTRL[7:4] = 0x0
CLK_OUT3, then set PIN_CTRL[3:0] = 0xF and PIN_CTRL[11:8] = 0x0

The rest of the bits are not documented, so should be treated as reserved.

Re: Technical Reference I2S Clock config section is confusing

Posted: Thu Jul 20, 2017 9:18 am
by WiFive
Thanks, so bits that are not set to 0 should be set to 1? All 3 nybbles should be either 0 or F?

How do you output I2S0 clock on CLK_OUT1 and I2S1 clock on CLK_OUT2? Or you can only route one clock to gpio matrix?

Re: Technical Reference I2S Clock config section is confusing

Posted: Sat Jul 22, 2017 6:48 pm
by RoyceP

Code: Select all

PIN_FUNC_SELECT(PIN_CTRL, CLK_OUT1_S);
PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO0_U, FUNC_GPIO0_CLK_OUT1);
The above got the clock. It is 40Mhz which is not quite what my DAC wants, but that is another story.

Re: Technical Reference I2S Clock config section is confusing

Posted: Sat Jul 22, 2017 7:12 pm
by WiFive
RoyceP wrote:

Code: Select all

PIN_FUNC_SELECT(PIN_CTRL, CLK_OUT1_S);
I dont think that is a proper call and maybe luck if it worked the way you wanted.

Re: Technical Reference I2S Clock config section is confusing

Posted: Sat Jul 22, 2017 7:24 pm
by RoyceP
io_mux_reg.h, beginning at line 115, through at least line 131, suggest to me that the call is proper.