In my application, everything I am using 32 bit integers exclusively. I would like to use the 32 bit mode in the sgtl5000 as well.
As far as I can tell the following lines of code from the i2s library are already transferring things in 32 bit mode:
I2S1_TCR4 = I2S_TCR4_FRSZ((2 - 1)) | I2S_TCR4_SYWD((32 - 1)) | I2S_TCR4_MF | I2S_TCR4_FSD | I2S_TCR4_FSE | I2S_TCR4_FSP;
I2S1_TCR5 = I2S_TCR5_WNW((32 - 1)) | I2S_TCR5_W0W((32 - 1)) | I2S_TCR5_FBT((32 - 1));
I2S1_RCR4 = I2S_RCR4_FRSZ((2 - 1)) | I2S_RCR4_SYWD((32 - 1)) | I2S_RCR4_MF | I2S_RCR4_FSE | I2S_RCR4_FSP | I2S_RCR4_FSD;
I2S1_RCR5 = I2S_RCR5_WNW((32 - 1)) | I2S_RCR5_W0W((32 - 1)) | I2S_RCR5_FBT((32 - 1));
When I view the Din and Dout sgtl5000 signals on an oscilloscope, 32 bit data is being sent from the ADC and I can write 32 bit data to the DAC. However, the library control_sgtl5000.cpp sets the device for 16 bit operation with this instruction:
write(CHIP_I2S_CTRL, 0x0030); // SCLK=64*Fs, 16bit, I2S format
//write(CHIP_I2S_CTRL, 0x0000); // SCLK=64*Fs, 32bit, I2S format
When I use the commented out line enabling 32 bit mode, the Din and Dout are the same as when it is set for 16 bit operation.
Am I missing something, or does the sgtl5000 always input/output 32 bit data? Or is there a way you can get to 192 kHz if you use 16 bit mode only?
As far as I can tell the following lines of code from the i2s library are already transferring things in 32 bit mode:
I2S1_TCR4 = I2S_TCR4_FRSZ((2 - 1)) | I2S_TCR4_SYWD((32 - 1)) | I2S_TCR4_MF | I2S_TCR4_FSD | I2S_TCR4_FSE | I2S_TCR4_FSP;
I2S1_TCR5 = I2S_TCR5_WNW((32 - 1)) | I2S_TCR5_W0W((32 - 1)) | I2S_TCR5_FBT((32 - 1));
I2S1_RCR4 = I2S_RCR4_FRSZ((2 - 1)) | I2S_RCR4_SYWD((32 - 1)) | I2S_RCR4_MF | I2S_RCR4_FSE | I2S_RCR4_FSP | I2S_RCR4_FSD;
I2S1_RCR5 = I2S_RCR5_WNW((32 - 1)) | I2S_RCR5_W0W((32 - 1)) | I2S_RCR5_FBT((32 - 1));
When I view the Din and Dout sgtl5000 signals on an oscilloscope, 32 bit data is being sent from the ADC and I can write 32 bit data to the DAC. However, the library control_sgtl5000.cpp sets the device for 16 bit operation with this instruction:
write(CHIP_I2S_CTRL, 0x0030); // SCLK=64*Fs, 16bit, I2S format
//write(CHIP_I2S_CTRL, 0x0000); // SCLK=64*Fs, 32bit, I2S format
When I use the commented out line enabling 32 bit mode, the Din and Dout are the same as when it is set for 16 bit operation.
Am I missing something, or does the sgtl5000 always input/output 32 bit data? Or is there a way you can get to 192 kHz if you use 16 bit mode only?