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
Parents
  • 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

Reply
  • 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

Children
  • 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.

  • Please accept my apologies for looking for the error where it seems not to be,
    you have to be very patient when dealing with novices, but then I miss some detail
    that I cannot understand, I have connected the NRF52832 to the INMP441 with
    Greg's program Tomasch and it works correctly, then I replaced it by connecting it
    with the ICS43434 (which works correctly in an esp32), but I do not get audio in
    the NRF52832, I was trying various values ​​in 25L and 1600L always with 64 between
    them but I have not gotten audio, Maybe I didn't find the right one... I'm sure
    it's something obvious but I'm a newbie, what would I have to do to make it work?
  • I think we need to take a look at the waveforms of actual communication on the I2S lines. Can you grab a couple of scopes with the INMP441(working) and ISC43434(not working)? 

  • Hello haakonsh, while I was meeting a friend to take a look at it with the oscilloscope I found the problem, I am using a MDBT42Q raytac module and it seems that the gpio pins from P022 to 30, both included, are not suitable for frequencies greater than 10khz pwm ,i2s, etc. Curiously, the datasheet page in which this is specified is only in some versions of it, thank you very much for everything, of course this can happen to anyone who does not have an oscilloscope on hand xD, one last question on I really liked ICS43434. Do you know of any similar in quality but with the audio input at the top?

  • Hello,

    Håkon is out of office, but we do not have any experience or overview of other mems sensors no.

    Kenneth

Related