Interpreting S/PDIF With A Microcontroller Brings A Few Complications

The common punter shunts audio round with analog 3.5 mm cables, RCA jacks, or Bluetooth frequently. An invaluable same old that hasn’t in reality stricken maximum people is S/PDIF, status for Sony/Phillips Virtual Interface. It’s an invaluable solution to pump virtual audio round over copper cables or optic fiber. (*5*) were given eager about the usual after considering some lengthy cable runs in his house, (*3*)and made up our minds to check out deciphering it.

The objective for [Andrew]’s building efforts used to be the STM32L476 Discovery, which had no SPDIF deciphering {hardware} on board. As an alternative, [Andrew] tinkered with the peripherals he needed to see what would paintings. Finally, a cavalcade of inner timers had been daisy chained to permit the microcontroller to get better a clock from the self-clocked S/PDIF sign. This used to be then used to generate a clock to sync up the onboard SPI {hardware} to in truth learn within the 16-bit PCM knowledge from the S/PDIF sign.

[Andrew]’s unique broader plan used to be to pipe the S/PDIF knowledge to the onboard I2S DAC, regardless that he struggled manipulating the rest assets at the STM chip to take action effectively. Someone wishing to have a Mod can check out [Andrew]’s code over on GitHub. If finished, the STM32L476 would change into an invaluable analog endpoint for S/PDIF streams, permitting you to pump tunes digitally over lengthy distances with out sign degradation. If you already know the important thing to getting it completed, pontificate within the feedback! However, if you wish to have to stand up and working extra temporarily, the Teensy platform has you lined!