nRF5340 Audio Dev Kit Output I2S to External HW Codec (MAX98357A)

Hello,

I am currently trying to connect an external hardware codec and amp (Adafruit MAX98357 I2S Class-D Mono Amp) in order to play audio via BLE Audio and I2S using two nRF5340 Audio Dev Kits (ADKs).

I have been able to properly flash the ADKs using the nRF5340 Audio code from the nRF Connect SDK in VS Code and the buildprog.py Python script. I flashed one as the gateway and one as the headset, and was successfully able to play audio through USB to the gateway and listen to it from the headset through a pair of wired headphones. 

I am trying to use the I2S interface header pins (P10, specifically BCLK, FSYNC, DOUT, GND, and a power pin) on the ADK and connect them to the MAX HW codec breakout, but after probing the pins, no signal seems to be coming from them. Only the 1v8 pin seems to be outputting 2V (why 2V?). On a separate note, can you please explain what the difference is between 1V2 and 1V8 is?

I saw the post from Adarsh, but I'm not sure how to complete all of the referenced instructions. For example, I was able to complete the following 

by following instructions from here.

However, I do not know how to do the following instructions:

Could you please provide some more detailed instructions on how to connect an external HW codec?

Thank you! 

Best,

Louie

Parents
  • Elray326 said:

    I would like to know how to connect an external HW codec. Do I need to use the P10 header? If so, how do I configure it?

    You should add the external hw codec to a dts overlay file of the board. Also, (like what was mentioned in one of the cases you linked to) you should create an API to replace the API in hw_codec.h.

    However, I do not know how to do the following instructions:

    I'll go through the steps below:

      To do this it would be best to simply search for the terms in the project using 

    ctrl+shift+F in VSC. You'll find hw_codec_init() in audio_system.c. CS47L63 code can be found all over I guess.

    Create a version of hw_codec_on_board_set() that sets hw_codec_sel to high, and then modify hw_codec_init to run that instead.

    I do not think there are any that comes with the default audio application.
    Elray326 said:
    is there any way to run the external HW codec at 3.3V directly from the Audio Dev Kit?

    Yeah the 5340 can provide 1.8 V to 3.3 V regulated supply for external components. See section 4.7.2 in the product spec for more info on that. Though I do not know how easy this is on the Audio DK itself. I'll have to get back to you on that, but I assume the answer is that it is impossible, and you'll have to get the 3.3 v some other way.

    Regards,

    Elfving

  • Hello Elfving,

    I was able to successfully use the MAX98357A as an external codec for the NRF5340 Audio Dev Kit by removing any relevant code for the cs47l63, particularly by having the function cs47l63_comm_reg_conf_write() in hw_codec.c return 0. I was able to figure this out by using the debugger, setting breakpoints, and figuring out where in the code the board would fault.

    I did not have to add the external hw codec to a dts overlay file, but I did follow the rest of your instructions. 

    Thanks for the help!

    Best,

    Louie

  • No problem, and glad you've gotten it to work! Slight smile

    Regards,

    Elfving

Reply Children
No Data
Related