This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

PCM5252: SPI configuration issues

Part Number: PCM5252


Hi guys,

I am currently trying to connect PCM 5252 DAC to SPartan-6 FPGA, so I need to write an SPI protocol.

The problem is that I don't fully understand what is said in the datasheet, so I want to clarify if I understood right:

When SPI mode is used (MODE1 is pulled to DVDD), it is stated that there is the audio data input  DIN (pin 28) and there is MOSI -Input data for SPI (pin 17), which is used to program registers. At the same very moment, section 8 of this datasheet describes the usage of DIN (pin 28) only as I2S port and does not mention anything about using audio data with SPI. The SPI is only mentioned when it comes down to programming DSP registers. So there is a hole in my understanding of how to use SPI, in spite of the fact that SPI and I2S are mutually exclusive protocols and I don't know how to write audio words to DIN using SPI.  Also I did not find how exactly I can control a bit-resolution when I use SPI. When I2S is used, then there are registers to control bit resolution, yet I didn't find anything for SPI.

So my first question is the following: 

1) Just to clarify, SPI and I2S are mutually exclusive. And if that is so, then when SPI protocol is used, registers are programmed via MOSI (pin 17) while the audio words are later supplied to DIN (pin 28), right? 

2) How exactly can I set up a 32-bit resolution when SPI protocol is used? 

Thanks in advance,

Roman.

  • Hi Roman,

    The two interfaces are completely exclusive.

    The audio data is conveyed to the PCM via BCK, SCLK, LRCK, and DIN.

    The device configuration registers can be controlled with the SPI interface, using MS, MC, MISO, and MOSI:

    MC - master clock, this is the SPI clock

    MS - master select, this is the chip select

    MOSI - master-out, slave-in - this is the data from the master

    MISO - master-in, slave-out - this is the data from the PCM to the master.

    The device natively supports 32-bit audio data based on the I2S audio format.  The default data format is standard I2S, which is a left-justified format that already supports 32-bit.

    Thanks,

    Paul

  • Hi Paul,

    Thank you for a quick reply. 

    "The audio data is conveyed to the PCM via BCK, SCLK, LRCK, and DIN."

    That is true, but that is made only by: I2S, LJ (left-justified), TDM, DSP. Do I understand you right, that if I am using an SPI configuration, then I have no other option but to use TDM/DSP (since I2S/LJ and SPI are mutually exclusive) ??

    Roman.

  • If you are using SPI, the format of the data is controlled by a register, not a hardware pin.  This register is found below:

  • Thank you, Paul!

    Yes, I figured it out earlier today thanks to your first reply. Thank you for your help!