Page 1 of 1

Raspberry PI2 I2S ADC

Posted: Sat May 20, 2017 11:27 pm
by dard
Hi,
I want to connect I2S capable ADC to RPI2 board. I bought board with TI PCM1802 chip, but cannot find additional tutorial on how to mange it to work with RPI2. I read a lot of posts but still cannot figure how to completely manage it to work with the RPI2.
The board with ADC has following pins: SCK(System clock input), PDW(Power-down control), LRCK(Sampling clock input and output), FSY(Frame synchronous clock input and output), BCK(Bit clock input and output), DOUT, GND, 3.3V, 5,5V. I found how to connect few of these pins, but not a complete solution. I have experience with some SPI ADC but I2S is a bit new to me...

Re: Raspberry PI2 I2S ADC

Posted: Thu Jun 08, 2017 9:28 pm
by dard
Just to add a note. Currently I have connected PCM5102A DAC Sound Card Board and it's working well. I'm curious now if I can add my second ADC PCM1802 board in order to have both DAC and ADC connected to RPI at the same time?

Re: Raspberry PI2 I2S ADC

Posted: Fri Jun 09, 2017 1:42 pm
by flatmax
Hi there,

To setup your ADC, you will want to implement a machine driver for ALSA or use the simple I2S driver configured in the device tree overlay you will make. There is a very long I2S thread on this forum which can assist you ... they are constantly having successes there :)

Check the supported codecs in Linux here. If you find support for your PCM1802 ADC, then you are in luck !
Personally, I would clone the repo with --depth=1 and grep the codecs directory for any mentions of pcm1802 :

Code: Select all

grep -ri pcm1802 sound/soc/codecs
Regarding running bothe the ADC and DAC off the same I2S bus ... nice idea, and yes I think you can !
Only one clock master shall you have. The Pi, the ADC or the DAC ?
Once you know that, you can craft a machine driver to set up all of your chips to work nicely together.
Examples of machine drivers are in this directory here. Oh and there are probably overlays in arch/arm/boot/overlays which implement the simple machine driver for codecs, check it out !

Matt

Re: Raspberry PI2 I2S ADC

Posted: Thu Jun 15, 2017 9:03 pm
by dard
Hi,
I will try this as suggested and inform about the progress. Thanks for the helpful reply!
Regards

Re: Raspberry PI2 I2S ADC

Posted: Tue Nov 28, 2017 4:55 pm
by Lord_potato
Hi! Did you manage to get it work? I want to do basically the same thing on a zero.

Re: Raspberry PI2 I2S ADC

Posted: Sun Jan 21, 2018 6:43 pm
by adc_ukr
"Check the supported codecs in Linux here. If you find support for your PCM1802 ADC, then you are in luck !"

If found support codec. Build kernel with this how to https://www.raspberrypi.org/documentati ... uilding.md
And ... what next step?

Re: Raspberry PI2 I2S ADC

Posted: Sun Jan 21, 2018 10:26 pm
by HiassofT
adc_ukr wrote:
Sun Jan 21, 2018 6:43 pm
If found support codec. Build kernel with this how to https://www.raspberrypi.org/documentati ... uilding.md
And ... what next step?
Create a devicetree overlay to enable the ADC/DAC. Easiest way to do this is via the simple-audio-card driver. Here's a recently added overlay that you can use as an example: https://github.com/raspberrypi/linux/bl ... verlay.dts

Also check the last few pages of the sticky I2S sound thread here where simple-audio-card DT overlays were discussed in detail.

so long,

Hias