ΣSigmaStudio Ask AI Русский Log in

Is it possible to read Bitrate and SampleRate with ADAU1452

SigmaDSP & SigmaStudio UlfH Feb 6, 2025 00:00 1 replies Original on forum ↗
Subscribe
UlfH Question
Feb 6, 2025 00:00

Trying to read Bitrate and SampleRate with ADAU1452. Is this possible?

Want to display this on a screen connected to ESP32.

Have tested with an MCU, ESP32, connected to (SDATA_IN0) i2s_in0.

Does SDATA_IN0 need to be activated in the register?

/Ulf

Audio Signal Processors

adau1452

hardware

sigmastudio

SigmaDSP Audio Processors

DaveThib Reply
Feb 6, 2025 00:00

Hello UlfH

The sample rate is easy to do by making use of the ASRC Ratio registers.

I am not certain if you are using them in your design, but you can set the output rate to a known rate and then send into the ASRC an unknown rate and it will calculate a ratio to translate from the incoming rate to the outgoing rate. If you know the outgoing rate then you can figure out the rate coming in.

Keep in mind that it is possibly asynchronous from other master clocks so the rate might not be a clean integer, it might by 2.2 to 1 or something like that but that can easily be dealt with in software. If the output rate is 48kHz and you see a ratio of 2.3:1 then you know it is 96kHz but the other clock is slightly fast.

On the other hand, the bit clock is another matter and that is much more difficult.

The serial ports have no intelligence in them to tell you if things are set correct or not. They are just simple shift registers that will bring in bits and at the end of the frame transfer them to memory location buffers and then gets transferred into the memory locations where the core picks up the data. If you have it set wrong you get garbage.

If you know what the signals should be I suppose you could set up a port to pick up TDM data and if the bit clock is wrong it will be garbage. If the signal is something like a 1kHz you could setup a notch filter. But, I really have no idea what signals you are expecting to see and expecting to tell the difference between? You might be able to setup two ports for different bit clock rates and one of them will have valid data and the wrong one will not. Or channels will be missing. Again, I am at a loss without more details.

I am attaching a program file I did a while back that looks at the ratio register to tell what the sample rate is.

Dave T

ADAU1452 ASRC Lock Detect and Ratio Detect Example.dspproj