Parallel I2S Output?
Posted: 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:
So, I think everything's "connected" correctly. I then set up some more stuff...
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?
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);
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?