How to output 12.288MHz MCLK with nRF5340 Audio

I tried the following settings to output 12.288MHz I2S MCLK with nRF5340 Audio, but it did not work as expected.

The I2S settings I want to output are as follows.

MCLK: 12.288MHz
BICLK: 3.072MHz
LRCK: 480kHz
Bit width: 32bit

1. Set to output using bypass function
static nrfx_i2s_config_t cfg = {
/* Pins are configured by pinctrl. */
.skip_gpio_cfg = true,
.skip_psel_cfg = true,
.irq_priority = DT_IRQ(I2S_NL, priority),
.mode = NRF_I2S_MODE_MASTER,
.format = NRF_I2S_FORMAT_I2S,
.alignment = NRF_I2S_ALIGN_LEFT,
.ratio = NRF_I2S_RATIO_256X,
.mck_setup = 0xAAAAA000,
.channels = NRF_I2S_CHANNELS_STEREO,
.clksrc = NRF_I2S_CLKSRC_ACLK,
.enable_bypass = true,
.sample_width = NRF_I2S_SWIDTH_32BIT,
};

Result: MCLK, BICK, and LRCK have the expected waveforms and BLE is connected, but synchronization is not possible (LED2 does not light up).

2. Set to output without using the bypass function.
static nrfx_i2s_config_t cfg = {
/* Pins are configured by pinctrl. */
.skip_gpio_cfg = true,
.skip_psel_cfg = true,
.irq_priority = DT_IRQ(I2S_NL, priority),
.mode = NRF_I2S_MODE_MASTER,
.format = NRF_I2S_FORMAT_I2S,
.alignment = NRF_I2S_ALIGN_LEFT,
.ratio = NRF_I2S_RATIO_256X,
.mck_setup = 0xAAAAA000,
.channels = NRF_I2S_CHANNELS_STEREO,
.clksrc = NRF_I2S_CLKSRC_ACLK,
.enable_bypass = false,
.sample_width = NRF_I2S_SWIDTH_32BIT,
};

Result: No waveforms are output from MCLK, BICK, and LRCK, and BLE is connected but cannot be synchronized (LED 2 does not light up).

I have the following questions.

a) Is there a range in which mck_setup can be set?
b) Why does synchronization not work when using the bypass function?
c) Please tell me the range in which the I2S MCLK can be output on the nRF5340

Parents Reply
  • Hi again,

    Here's some more information from the Audio team w.r.t your questions

    Since the MCLK request by customer is 12.288MHz

    • that is the maximum output rate which nRF5340 MCLK can achieve
    • so we should enable "bypass" mode. And the MCLK will just output the clock from the internal clock source directly

    This exaplained why customer found there's no waveform once if the bypass mode is disabled.

    a) Is there a range in which mck_setup can be set?


    If you customer would like to use 12.288MHz for MCLK, then we have to use bypass mode, and MCKFREQ will be ignore
    Ref:

     

    b) Why does synchronization not work when using the bypass function?

    We would need device logs to be able to say anything regarding this. See https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-2-debugging/ for more information about how to debug and get out logs

    c) Please tell me the range in which the I2S MCLK can be output on the nRF5340

    The maximum MCK frequency is 12.288MHz

    Additionally we strongly recommend that you use NCS 2.7.0 instead of NCS 2.5.0.

    Kind regards,
    Andreas

Children
No Data
Related