Skip to content

elehobica/pico_audio_i2s_32b

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Raspberry Pi Pico 32bit I2S DAC Library

Overview

This library is for Raspberry Pi Pico to support 32bit/Stereo I2S DAC.

  • Bit resolution: 32bit
  • Sampling Frequency: up to 192 KHz

Supported Board and Peripheral Devices

  • Raspberry Pi Pico
  • PCM5102 32bit I2S Audio DAC
  • ES9023 24bit I2S Audio DAC

Pin Assignment

In addition to original connection

Pico Pin # GPIO Function Connection
21 GP16 BCK to PCM5102 BCK (13) / to ES9024 BCK (1)
22 GP17 LRCK to PCM5102 LRCK (15) / to ES9023 LRCK (2)
23 GND GND GND
24 GP18 SDO to PCM5102 DIN (14) / to ES9023 SDI (3)
40 VBUS VCC to VIN of DAC board (5V)

PCM5102_schematic

PCM5102 Board Setting

  • tie PCM5102 SCK (12) to low (bridge short land)
  • H1L (FLT) = L
  • H2L (DEMP) = L
  • H3L (XSMT) = H
  • H4L (FMT) = L

How to build

  • See "Getting started with Raspberry Pi Pico"
  • Put "pico-sdk", "pico-examples" and "pico-extras" on the same level with this project folder.
  • Set environmental variables for PICO_SDK_PATH, PICO_EXTRAS_PATH and PICO_EXAMPLES_PATH
  • Confirmed with Pico SDK 2.0.0
> git clone -b 2.0.0 https://github.com/raspberrypi/pico-sdk.git
> cd pico-sdk
> git submodule update -i
> cd ..
> git clone -b sdk-2.0.0 https://github.com/raspberrypi/pico-examples.git
>
> git clone -b sdk-2.0.0 https://github.com/raspberrypi/pico-extras.git
> 
> git clone -b main https://github.com/elehobica/pico_audio_i2s_32b.git

Windows

  • Build is confirmed with Developer Command Prompt for VS 2022 and Visual Studio Code on Windows environment
  • Confirmed with cmake-3.27.2-windows-x86_64 and gcc-arm-none-eabi-10.3-2021.10-win32
  • Lanuch "Developer Command Prompt for VS 2022"
> cd pico_audio_i2s_32b
> cd samples/xxxxx  # sample project directory
> mkdir build && cd build
> cmake -G "NMake Makefiles" ..
> nmake
  • Put "xxxxx.uf2" on RPI-RP2 drive

Linux

$ cd pico_audio_i2s_32b
$ cd samples/xxxxx  # sample project directory
$ mkdir build && cd build
$ cmake ..
$ make -j4
  • Download "xxxxx.uf2" on RPI-RP2 drive

Macro Definitions in audio_i2s.c

CORE1_PROCESS_I2S_CALLBACK

If defined, i2s_callback_func is processed at Core 1 while main routine and DMA IRQ handler is processed at Core 0. It will be efficient when generating audio data needs computing power. It does not contribute to reduce bus load and even make slightly worse when Core 1 is activated.

Application Example