Page 1 of 1

I2S0 I2S1 Pin Query question

Posted: Fri May 12, 2017 11:09 am
by rudi ;-)
Hi Guys,

just in time sort out I2S and deeper audio for design code framework -
but i am little confused about the Pin Table:
I2S0_I2S1.jpg
I2S0_I2S1.jpg (221.57 KiB) Viewed 6812 times
i was not gone in detail further ( names and pins and signals ) just in time - but do we miss here not more as 2 SoC _ pins or is there a typo ?

best wishes
rudi ;-)

Re: I2S0 I2S1 Pin Querry question

Posted: Fri May 12, 2017 11:45 am
by WiFive

Code: Select all

#define I2S1I_BCK_IN_IDX			164
#define I2S1I_BCK_OUT_IDX			164
#define I2S1I_WS_IN_IDX			165
#define I2S1I_WS_OUT_IDX			165

Re: I2S0 I2S1 Pin Querry question

Posted: Sat May 13, 2017 9:22 pm
by BuddyCasino
Yeah looks like WS and BCK are duplicated and should be DATA_OUT and DATA_IN instead?

Re: I2S0 I2S1 Pin Querry question

Posted: Sat May 13, 2017 9:48 pm
by rudi ;-)
I also had this presumption, that made me thoughtful -

btw cause left channel only perhabs this "new" code in ESP-IDF look good - try this

Code: Select all

i2s_set_dac_mode(I2S_DAC_CHANNEL_BOTH_EN);
have a look we can enable left and right separately, right? do you know, can we this do with I2S0 and I2S1 ?

I2S0 channel 1 (25) is right and I2S0 channel 2 (26) is left -

Code: Select all


typedef enum {
    I2S_DAC_CHANNEL_DISABLE  = 0,    /*!< Disable I2S built-in DAC signals*/
    I2S_DAC_CHANNEL_RIGHT_EN = 1,    /*!< Enable I2S built-in DAC right channel, maps to DAC channel 1 on GPIO25*/
    I2S_DAC_CHANNEL_LEFT_EN  = 2,    /*!< Enable I2S built-in DAC left  channel, maps to DAC channel 2 on GPIO26*/
    I2S_DAC_CHANNEL_BOTH_EN  = 0x3,  /*!< Enable both of the I2S built-in DAC channels.*/
    I2S_DAC_CHANNEL_MAX      = 0x4,  /*!< I2S built-in DAC mode max index*/
} i2s_dac_mode_t;

enable pins: DAC1
enable pins: DAC2

Code: Select all

    SET_PERI_REG_MASK(SENS_SAR_DAC_CTRL1_REG, SENS_DAC_DIG_FORCE_M);
    SET_PERI_REG_MASK(SENS_SAR_DAC_CTRL1_REG, SENS_DAC_CLK_INV_M);

    SET_PERI_REG_MASK(RTC_IO_PAD_DAC1_REG, RTC_IO_PDAC1_DAC_XPD_FORCE_M);
    SET_PERI_REG_MASK(RTC_IO_PAD_DAC1_REG, RTC_IO_PDAC1_XPD_DAC_M);

    CLEAR_PERI_REG_MASK(RTC_IO_PAD_DAC1_REG, RTC_IO_PDAC1_RUE_M);
    CLEAR_PERI_REG_MASK(RTC_IO_PAD_DAC1_REG, RTC_IO_PDAC1_RDE_M);

    SET_PERI_REG_MASK(RTC_IO_PAD_DAC2_REG, RTC_IO_PDAC2_DAC_XPD_FORCE_M);
    SET_PERI_REG_MASK(RTC_IO_PAD_DAC2_REG, RTC_IO_PDAC2_XPD_DAC_M);

    CLEAR_PERI_REG_MASK(RTC_IO_PAD_DAC2_REG, RTC_IO_PDAC2_RUE_M);
    CLEAR_PERI_REG_MASK(RTC_IO_PAD_DAC2_REG, RTC_IO_PDAC2_RDE_M);


now i studdy , where we connect a digital Microfon ( ICS..) on which pins and
how we setup I2S0 ( or need to activate I2S1 ? ) ..if difference rate/freq/sample

edit: more informativ


best wishes
rudi ;-)