This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

i2S SCLK and LRCK nRF52832 DK

Any updates on this from anyone? Please advise

Hi,

The i2S microphone that I am using requires a over sampling rate fixed at 64 therefore the WS signal (LRCLK on nrf52) must be BCLK/64 and therefore synchronized to the BCLK (SCLK on nrf52). This translates to valid BCLK frequencies from 2.048MHz to 4.096MHz and sampling rates from 32kHz to 64kHz, respectively.

The data format is I2S, 24 bit, 2's complement.

My question is, how do I obtain these frequencies with the nrf52832 DK?

The rules for the SCLK and LRCLK on nRF52 are as follows:

  1. LRCK = MCK/CONFIG.RATIO
  2. SCK = 2 * LRCK * CONFIG.SWIDTH
  3. CONFIG.RATIO/(2 * SWIDTH) needs to be an integer

Since 2 * CONFIG.SWIDTH = 2 * 24 = 48, equation (2) becomes SCK = 48 * LRCK. Based on our requirements, we want this ratio to be 64.

Any insights on how to make this work?

Thanks.

Parents
  • Hi,

    Note that the specification is only valid up to 4 MHz MCK, so lets chose that for simplicity, ie. CONFIG.MCKFREQ 32MDIV8. You also have SWIDTH set to 24 bit, so we chose the ratio that gives an integer and fulfills your specification, ie. CONFIG.RATIO 96X. This way we get a LRCLK of ~42 kHz and an SCK of 2.048 MHz.

    Does this not work for you?

    Best regards,

    Øyvind

  • Based on the vendor, the microphone has been used before with nordic. Perhaps the CONFIG.SWIDTH that I'm using is incorrect. They let me know that:

    "WS should be derived from BCLK, and the mic expects to occupy 32 bits (one WS phase) for every 64 clocks (there could be a stereo pair, each occupying a different 32 bits depending on the Select line). Reminder that WS is LRCK and BCK is SCK."

    I have used a 24bit SWIDTH. Based on their response above and the datasheet, do you have any suggestion for the SWIDTH?

Reply
  • Based on the vendor, the microphone has been used before with nordic. Perhaps the CONFIG.SWIDTH that I'm using is incorrect. They let me know that:

    "WS should be derived from BCLK, and the mic expects to occupy 32 bits (one WS phase) for every 64 clocks (there could be a stereo pair, each occupying a different 32 bits depending on the Select line). Reminder that WS is LRCK and BCK is SCK."

    I have used a 24bit SWIDTH. Based on their response above and the datasheet, do you have any suggestion for the SWIDTH?

Children
No Data
Related