Raspberry Pi Pico as S/PDIF Digital Audio Receiver
on
S/PDIF in 2023: On a Raspberry Pi Pico
Although we took a step backward from that kind of uncompressed PCM audio when we switched to DVD (although we gained multichannel sound), MP3, and the like, equipment such as DVD / Blu-ray players and decent media streaming boxes still commonly have S/PDIF outputs.I’ve been wanting to investigate and take a closer look at S/PDIF for a while, without having to resort to a whole lot of complex circuitry. Hat tip to Anne Barela at Adafruit for finding this: There’s a simplest-of-simple circuit to explore S/PDIF signals (regardless of whether they come in via coax or optical) on a Raspberry Pi Pico, brought to us by Elehobica on GitHub.
Conversion to I2S
A bonus extra feature is that there’s also code to convert from S/PDIF to I2S serial audio format, which is intended for transporting audio between ICs and is available on tiny microcontroller-compatible modules. That means you can pump your digital audio through, for example, a tiny DAC (smaller than a US Quarter) initially designed for bigger Raspberry Pi cousins.
Tailored specifically for the Raspberry Pi Pico, the project is compatible with the RP2040 chip. Comprehensive instructions are provided using Pico SDK 1.4.0, and the process is confirmed to work with Developer Command Prompt for VS 2019 and Visual Studio Code on Windows platforms.
Sample applications included in the project enable users to identify sampling frequencies, display S/PDIF frame details, and convert S/PDIF input into I2S 32-bit output.
To access the project files and learn more, visit Elehobica's GitHub repository at: https://github.com/elehobica/pico_spdif_rx.git.

Discussion (2 comments)