Setting up ADAU1781 to work as an audio codec through Raspberry Pi's GPIO pins


I would like to create an i2s audio i/o hat for the Raspberry Pi using the ADAU1781. The end product has the following requirements:

-Works through the Pi's GPIO pins, rather than a usb interface

-Is recognizable as an audio device by alsa, showing up after aplay -l command in terminal

-Provides low latency audio in and out

-Preferably can be made to run in mono rather than stereo, but this is not a deal breaker

I am using the Raspberry Pi 3 model B (here is the pinout:https://www.element14.com/community/servlet/JiveServlet/previewBody/73950-102-10-339300/pi3_gpio.png )

I would like to know which pins of each chip I need to connect in order to set up i/o and proper clocking, and the steps I need to take on the Pi's linux system for it to recognize the ADAU1781 as an audio device in alsa.

  • 0
    •  Analog Employees 
    on Jun 28, 2016 10:13 PM

    Hello Emmett,

    What do you have as a system clock? Do you have an MCLK source on the PCB? So I assume you do not have an MCLK in the system so you will have to have the Pi produce one. Can it produce a 12.288MHZ signal?

    You could probably use GPIO04, 17, 27,22, 18 to produce the I2S clocks and MCLK and read/send the data. Now I do not know the Raspberry Pi very well so you need to look up and see if those pins are capable of generating the signals you need.

    Assuming 48kHz fs:

    You will need 12.288 MHZ MCLK

    48kHZ LRCLK

    3.072 MHZ BCLK signals.

    Then you will need one port for serial data in and one for serial data out.

    If the Pi is the master then it should be simpler I think.

    For your Linux question you should ask it on this part of the forum:

    Linux and Microcontroller Device Drivers

    Dave T