Parallel I2S Output?

cnlohr
Posts: 65
Joined: Sat Dec 03, 2016 5:39 am

Parallel I2S Output?

Postby cnlohr » Thu Jan 12, 2017 6:32 am

So, I've got single-channel I2S output working quite well, and I am trying to switch to parallel out.

I've configured all of the associated pins as outputs and issued the following:

Code: Select all

    gpio_matrix_out(I2S_D0,    I2S0O_DATA_OUT0_IDX, false,false);
    gpio_matrix_out(I2S_D1,    I2S0O_DATA_OUT1_IDX, false,false);
    gpio_matrix_out(I2S_D2,    I2S0O_DATA_OUT2_IDX, false,false);
    gpio_matrix_out(I2S_D3, I2S0O_DATA_OUT3_IDX, false,false);
So, I think everything's "connected" correctly. I then set up some more stuff...

Code: Select all

    periph_module_enable(PERIPH_I2S0_MODULE);

    SET_PERI_REG_BITS(I2S_LC_CONF_REG(0), 0x1, 1, I2S_IN_RST_S);
    SET_PERI_REG_BITS(I2S_LC_CONF_REG(0), 0x1, 0, I2S_IN_RST_S);
    SET_PERI_REG_BITS(I2S_LC_CONF_REG(0), 0x1, 1, I2S_AHBM_RST_S);
    SET_PERI_REG_BITS(I2S_LC_CONF_REG(0), 0x1, 0, I2S_AHBM_RST_S);
    SET_PERI_REG_BITS(I2S_LC_CONF_REG(0), 0x1, 1, I2S_AHBM_FIFO_RST_S);
    SET_PERI_REG_BITS(I2S_LC_CONF_REG(0), 0x1, 0, I2S_AHBM_FIFO_RST_S);
    SET_PERI_REG_BITS(I2S_CONF_REG(0), 0x1, 1, I2S_TX_RESET_S);
    SET_PERI_REG_BITS(I2S_CONF_REG(0), 0x1, 0, I2S_TX_RESET_S);
    SET_PERI_REG_BITS(I2S_CONF_REG(0), 0x1, 1, I2S_TX_FIFO_RESET_S);
    SET_PERI_REG_BITS(I2S_CONF_REG(0), 0x1, 0, I2S_TX_FIFO_RESET_S);
    SET_PERI_REG_BITS(I2S_CONF_REG(0), 0x1, 0, I2S_TX_SLAVE_MOD_S);  //Needed, otherwise it waits for a clock.
	SET_PERI_REG_MASK(I2S_CONF_REG(0), I2S_TX_MSB_SHIFT);
	WRITE_PERI_REG(I2S_CONF2_REG(0), 0);
	
	//this line is what makes it parallel, right???
	    SET_PERI_REG_BITS(I2S_CONF2_REG(0), 0x1, 1, I2S_LCD_EN_S);

	
	
	
	    SET_PERI_REG_BITS(I2S_CLKM_CONF_REG(0), I2S_CLKM_DIV_A, 1, I2S_CLKM_DIV_A_S);
    SET_PERI_REG_BITS(I2S_CLKM_CONF_REG(0), I2S_CLKM_DIV_B, 1, I2S_CLKM_DIV_B_S);
    SET_PERI_REG_BITS(I2S_CLKM_CONF_REG(0), I2S_CLKM_DIV_NUM, 1, I2S_CLKM_DIV_NUM_S);  //Setting to 0 wrecks it up.
    SET_PERI_REG_BITS(I2S_CONF_REG(0), 0x1, 0, I2S_TX_MONO_S);
    SET_PERI_REG_BITS(I2S_FIFO_CONF_REG(0), 0x1, 1, I2S_DSCR_EN_S);
    SET_PERI_REG_BITS(I2S_FIFO_CONF_REG(0), I2S_TX_FIFO_MOD, 1, I2S_TX_FIFO_MOD_S);
    SET_PERI_REG_BITS(I2S_FIFO_CONF_REG(0), 0x1, 1, I2S_TX_FIFO_MOD_FORCE_EN_S);
    SET_PERI_REG_BITS(I2S_CONF_CHAN_REG(0), I2S_TX_CHAN_MOD, 1, I2S_TX_CHAN_MOD_S);
	SET_PERI_REG_BITS(I2S_SAMPLE_RATE_CONF_REG(0), I2S_TX_BITS_MOD, 8, I2S_TX_BITS_MOD_S);
	SET_PERI_REG_BITS(I2S_SAMPLE_RATE_CONF_REG(0), I2S_TX_BCK_DIV_NUM, 1, I2S_TX_BCK_DIV_NUM_S);  


But, all I ever get (and I've spent several hours trying many different configurations) is ... nothing. Just no signals coming out. Can we get any direction on how to output parallel data via I2S?

ESP_Sprite
Posts: 9764
Joined: Thu Nov 26, 2015 4:08 am

Re: Parallel I2S Output?

Postby ESP_Sprite » Thu Jan 12, 2017 12:53 pm

You may want to look around for the correct signals to use... From a comment in my own test code:
//Because of... reasons... the 16-bit values for i2s1 appear on d8...d23
Yeah, I also have no idea why the HW dev for i2s did that. I think the same goes for I2S0, by the way.

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: Parallel I2S Output?

Postby WiFive » Thu Jan 12, 2017 1:28 pm

ESP_Sprite wrote:You may want to look around for the correct signals to use... From a comment in my own test code:
//Because of... reasons... the 16-bit values for i2s1 appear on d8...d23
Yeah, I also have no idea why the HW dev for i2s did that. I think the same goes for I2S0, by the way.
Left justified?

cnlohr
Posts: 65
Joined: Sat Dec 03, 2016 5:39 am

Re: Parallel I2S Output?

Postby cnlohr » Thu Jan 12, 2017 2:41 pm

@Sprite_TM: I searched google for that comment in quotes and nothing appeared. Can you post your example?

I will shift my efforts, but even D8...16 did not seem to have any data on them when I looked.

Who is online

Users browsing this forum: No registered users and 70 guests