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

  • Now that we are on the same page, I was wondering if I could program the following: LRCLK = MCLK/RATIO_64 and MCLK = 4MHZ setting Send MCLK as bit serial clock to microphone. This way we get the 64 ratio. But in order to use 64 ratio we have to pick a CONFIG.SWIDTH that 64 is a multiple of.

    Thus, CONFIG.SWIDTH is set to 16 bit because 16 and 24 bit are just resolution settings correct? So we can just use 16 bit for a smaller resolution.

    with CONFIG.SWIDTH set at 16, RATIO_64/(2*16) = INTEGER and we also obtain the 64 ratio. Does that look okay to you?

Reply
  • Now that we are on the same page, I was wondering if I could program the following: LRCLK = MCLK/RATIO_64 and MCLK = 4MHZ setting Send MCLK as bit serial clock to microphone. This way we get the 64 ratio. But in order to use 64 ratio we have to pick a CONFIG.SWIDTH that 64 is a multiple of.

    Thus, CONFIG.SWIDTH is set to 16 bit because 16 and 24 bit are just resolution settings correct? So we can just use 16 bit for a smaller resolution.

    with CONFIG.SWIDTH set at 16, RATIO_64/(2*16) = INTEGER and we also obtain the 64 ratio. Does that look okay to you?

Children
No Data
Related