I2S 32-bit word size in recent sdk

Hi, I'm trying to use an inmp441 microphone with nrf52832, apparently there is or was an incompatibility with this
a long time ago according to this data:

devzone.nordicsemi.com/.../i2s-32-bit-word-size

Has this problem been corrected in recent versions of sdk?
I did not find information about it, thank you very much in advance
  • There's no solution currently provided in NCS, but you can implement the solution found in the link you provided: https://devzone.nordicsemi.com/f/nordic-q-a/15713/i2s-32-bit-word-size/59992.


  • Thank you very much for your prompt response, I tried to compile that old program from nRF5 SDK v13 in sdkv17.02 but there are several problems with nrfx and pwm libraries, it would be great if someone who knows this could offer an updated version of such a useful program

  • It's 2 PWM signals, at 50% duty cycle, where the periods matches the required clock frequencies. It should not be too difficult to port to SDK17: 

    // Define the I2S configuration; running in slave mode and using PWM outputs to provide synthetic SCK and LRCK
        nrf_drv_i2s_config_t config = NRF_DRV_I2S_DEFAULT_CONFIG;
        config.sdin_pin             = I2S_SDIN_PIN;
        config.sdout_pin            = I2S_SDOUT_PIN;
        config.mode                 = NRF_I2S_MODE_SLAVE;
        config.mck_setup            = NRF_I2S_MCK_DISABLED;
        config.sample_width         = NRF_I2S_SWIDTH_24BIT;
        config.channels             = NRF_I2S_CHANNELS_LEFT;                                                    // Set the I2S microphone to output on the left channel
        config.format               = NRF_I2S_FORMAT_I2S;
        err_code                    = nrf_drv_i2s_init(&config, data_handler);                                  // Initialize the I2S driver
        APP_ERROR_CHECK(err_code);
    	
        // 1-channel PWM; 16MHz clock and period set in ticks.
        // The user is responsible for selecting the periods to guve the correct ratio for the I2S frame length
        app_pwm_config_t pwm1_cfg = APP_PWM_DEFAULT_CONFIG_1CH(25L, PWM_I2S_SCK_PIN);                           // SCK; pick a convenient gpio pin
        app_pwm_config_t pwm2_cfg = APP_PWM_DEFAULT_CONFIG_1CH(1600L, PWM_I2S_WS_PIN);                          // LRCK; pick a convenient gpio pin. LRCK period = 64X SCK period
    
        // Initialize and enable PWM's
        err_code = app_pwm_ticks_init(&PWM1,&pwm1_cfg,pwm_ready_callback);
        APP_ERROR_CHECK(err_code);
        err_code = app_pwm_ticks_init(&PWM2,&pwm2_cfg,pwm_ready_callback);
        APP_ERROR_CHECK(err_code);
        app_pwm_enable(&PWM1);
        app_pwm_enable(&PWM2);
        app_pwm_channel_duty_set(&PWM1, 0, 50);                                                                // Set at 50% duty cycle for square wave
        app_pwm_channel_duty_set(&PWM2, 0, 50);
    
        // Instantiate I2S
        err_code = nrf_drv_i2s_start(m_buffer_rx, NULL,                                                        // RX only; "NULL" XMIT buffer
           I2S_BUFFER_SIZE, 0);
        APP_ERROR_CHECK(err_code);

  • Thank you very much for your answer, in the program the frequencies can be adjusted in the compatible range for microphones similar to the ICS43432 or inmp441.
    In the datasheet of the 43432 we find SCK frequency (fSCK) 0.460 to 3.379 MHz but to use an ICS43434 we find 6.25 to 18.75 kHz, it would be like 0.007 Mhz, how could this be adapted? the program does not seem to accept decimals instead of 25L

  • Bulbitron said:
    In the datasheet of the 43432 we find SCK frequency (fSCK) 0.460 to 3.379 MHz but to use an ICS43434 we find 6.25 to 18.75 kHz, it would be like 0.007 Mhz, how could this be adapted?

    From the ICS43434 datasheet:

    "SCK period (tSCP) Input clock period 303(min) 2500(max) ns".

    That's a clock frequency of 400-3300kHz, similar to the ICS43432.

Related