Other Parts Discussed in Thread: SN74LVC1G125
Hello everybody,
I'm trying to get the SRC4392 to work properly on my design. Using port A and or B as slave ports there is no problem to get them on TX output, coax and optical. Even passtrought from A to B I2S works.
There is a microcontroller that controls all the I2C stuff for the SRC4392, unfortunately, I'm stuck somewhere with the inputs. There is no way to make them work, neither doing a DIR-DIT bypass. I tried to follow some forum explanations on the init code, but no luck. This is my init routine:
# set register page to 0 (Control and Status Registers) bus.write_byte_data(address, 0x7f, 0x00) # port A setup as slave with I2S data format bus.write_byte_data(address, 0x03, 0x01) bus.write_byte_data(address, 0x04, 0x00) # port B setup as master with I2S data format, SRC as data source, MCLK as clock source, clock divider 128 bus.write_byte_data(address, 0x05, 0x39) bus.write_byte_data(address, 0x06, 0x00) # DIR setup using MCLK, set to mute audio for loss of lock condition, RXCKO disabled # Default input is RX1 bus.write_byte_data(address, 0x0d, 0x08) bus.write_byte_data(address, 0x0e, 0x00) # PLL1 setup for 24.576MHz P=2 J=8 D=0 bus.write_byte_data(address, 0x0f, 0x22) bus.write_byte_data(address, 0x10, 0x00) bus.write_byte_data(address, 0x11, 0x00) # set GPO1 to enable 22.5792 Clock bus.write_byte_data(address, 0x1b, 0x01) # set GPO2 to enable 24.576 Clock bus.write_byte_data(address, 0x1c, 0x01) # set GPO3 to use MCLK 24.576 (set to 0x00 to use 22.5792) bus.write_byte_data(address, 0x1d, 0x01) # set GPO4 to use RXCKI 24.576 (set to 0x00 to use 22.5792) bus.write_byte_data(address, 0x1e, 0x01) # SRC setup is default with port A as the input data source # MCLK is the ref clock source, AUTODEM enabled (use 0x2d, 0x02 to play audio from the S/PDIF coax input and 0x00 for PORT A I2S) bus.write_byte_data(address, 0x2d, 0x02) bus.write_byte_data(address, 0x2e, 0x20) bus.write_byte_data(address, 0x2f, 0x00) # DIT setup with the SRC as the input data source and MCLK as master clock # clock divider is 128 to set the output frame rate # block start is an output and valid audio is indicated # c and u data will not be updated bus.write_byte_data(address, 0x07, 0x1c) bus.write_byte_data(address, 0x08, 0x00) bus.write_byte_data(address, 0x09, 0x00) # set left channel colume -3.5dB bus.write_byte_data(address, 0x30, 0x07) # set right channel colume -3.5dB bus.write_byte_data(address, 0x31, 0x07) # power up all blocks bus.write_byte_data(address, 0x01, 0x3f)
I also tried to add this at the end of the init file:
# DIT setup for 192KHz bus.write_byte_data(address, 0x07, 0x1c) bus.write_byte_data(address, 0x08, 0x08) bus.write_byte_data(address, 0x7f, 0x02) bus.write_byte_data(address, 0x2e, 0xee) bus.write_byte_data(address, 0x2f, 0xff) bus.write_byte_data(address, 0x7f, 0x00) bus.write_byte_data(address, 0x08, 0x00) bus.write_byte_data(address, 0x7f, 0x02) bus.write_byte_data(address, 0x2e, 0x01) bus.write_byte_data(address, 0x2f, 0x01) bus.write_byte_data(address, 0x7f, 0x00) # Reset bus.write_byte_data(address, 0x01, 0x80)
But no luck, only works when selecting input from Port A or B. Audio input sample rate is the same as used on MCLK and RXCKI clocks, so should work.. but nothing.
This is my input/output schematic, just in case there's something wrong.. (I don't think so anyway):
I also have another question regarding sample rate input detection. My design has two clocks for 44.1 and 48 sample rate frequencies. I can switch them separately on/off and use one or another separately for MCLK and RXCKI. How can I aut-detect the input sample rate to switch between RXCKI 22.5792 or 24.576 clock?
Thanks!
Oriol.