############################################### # High Performance Stereo Recording # --------------------------------------------- # PowerTune mode PTM_R4 is used for high # performance 16-bit audio. # # For normal USB Audio, no hardware change # is required. # # If using an external interface, SW2.4 and # SW2.5 of the USB-ModEVM must be set to # HI and clocks can be connected to J14 of # the USB-ModEVM. # # IN1L/R is routed to the LADC/RADC in a # single-ended manner. ############################################### ############################################### # Software Reset ############################################### # # Select Page 0 w 30 00 00 # # Initialize the device through software reset w 30 01 01 # ############################################### ############################################### # Clock Settings for ADC # --------------------------------------------- # The codec receives: MCLK = 11.2896 MHz, # BLCK = 2.8224 MHz, WCLK = 44.1 kHz ############################################### # # Select Page 0 w 30 00 00 # # NADC = 1, MADC = 2 w 30 12 81 82 # ############################################### ############################################### # Enable Loopback Page 0 register 29 ############################################### # # Loopback enable for stereo audio data w 30 1D 30 # ############################################### ############################################### # Signal Processing Settings for ADC ############################################### # # Select Page 0 w 30 00 00 # # Set the ADC Mode to PRB_P1 w 30 3d 01 # ############################################### ############################################### # Initialize Codec ############################################### # # Select Page 1 w 30 00 01 # # Disable weak AVDD in presence of external # AVDD supply w 30 01 08 # # Enable Master Analog Power Control w 30 02 00 # # Select ADC PTM_R4 w 30 3d 00 # # Set the input powerup time to 3.1ms (for ADC) w 30 47 32 # # Set the REF charging time to 40ms w 30 7b 01 # ############################################### ############################################### # Recording Setup ############################################### # # Select Page 1 w 30 00 01 # # Route IN1L to LEFT_P with 20K input impedance w 30 34 80 # # Route Common Mode to LEFT_M with impedance of 20K w 30 36 80 # # Route IN1R to RIGHT_P with input impedance of 20K w 30 37 80 # # Route Common Mode to RIGHT_M with impedance of 20K w 30 39 80 # # Unmute Left MICPGA, Gain selection of 6dB to make channel gain 0dB # Register of 6dB with input impedance of 20K => Channel Gain of 0dB w 30 3b 0c # # Unmute Right MICPGA, Gain selection of 6dB to make channel gain 0dB # Register of 6dB with input impedance of 20K => Channel Gain of 0dB w 30 3c 0c # # Select Page 0 w 30 00 00 # # Power up LADC/RADC w 30 51 c0 # # Unmute LADC/RADC w 30 52 00 # ############################################### ############################################### # High Performance Stereo Playback # --------------------------------------------- # PowerTune mode PTM_P3 is used for high # performance 16-bit audio. For PTM_P4, # an external audio interface that provides # 20-bit audio is required. # # For normal USB Audio, no hardware change # is required. # # If using an external interface, SW2.4 and # SW2.5 of the USB-ModEVM must be set to # HI and clocks can be connected to J14 of # the USB-ModEVM. # # Audio is routed to both headphone and # line outputs. ############################################### ############################################### # Clock Settings # --------------------------------------------- # The codec receives: MCLK = 11.2896 MHz, # BLCK = 2.8224 MHz, WCLK = 44.1 kHz ############################################### # # Select Page 0 w 30 00 00 # # NDAC = 1, MDAC = 2 w 30 0b 81 82 # ############################################### ############################################### # Signal Processing Settings for DAC ############################################### # # Select Page 0 # w 30 00 00 # # Set the DAC Mode to PRB_P8 - maybe this should # be changed to something else in the future? # The different modes have different power # consumption and use different signal paths and # processing blocks. w 30 3c 08 # # Enable Adaptive Filtering # # Adaptive Filtering allows changing the biquads # on-the-fly. # # This step and setting the EQ/processing blocks # must be done before the DAC is powered up. # # Select Page 44, Enable Adaptive filtering for DAC w 30 00 2c 04 ############################################### ############################################### # Set EQ for DAC # --------------------------------------------- # When Adaptive Filtering is enabled, both DAC # Buffer A and DAC Buffer B need to be written # to with an exact copy of settings to each to # prevent buffer mismatch. Initial settings must # be set before powering up the DAC. Refer to # page 8 of slaa404c.pdf for more info. # # Biquad A will always stay the same. It is just # a high pass filter to get rid of low end. # Biquad D will change based on the preset that # the user selects and will need to power on # with the value set last by the user. # # An example of setting the filters is also on # page 21 of slaa404.pdf. # ############################################### # Biquad A - High-pass first order Butterworth filter # fc = 200 Hz # # Biquad D - default values ############################################### # # Write to Buffer A: # # Biquad A, Left Channel (Page 44, Register 12, C1-C5) w 30 00 2c w 30 0C 7E 33 A8 00 C0 E6 2C 00 00 00 00 00 3E 33 A9 00 00 00 00 00 # # Biquad A, Right Channel (Page 45, Register 20, C33-C37) w 30 00 2D w 30 14 7E 33 A8 00 C0 E6 2C 00 00 00 00 00 3E 33 A9 00 00 00 00 00 # # Biquad D, Left Channel, Default values (Page 44, Register 72, C16-20) w 30 00 2c w 30 48 7F FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 # # Biquad D, Right Channel, Default values (Page 45, Register 80, C48-52) w 30 00 2D w 30 50 7F FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 # # Write to Buffer B: # # Biquad A, Left Channel (Page 62, Register 12, C1-C5) w 30 00 3E w 30 0C 7E 33 A8 00 C0 E6 2C 00 00 00 00 00 3E 33 A9 00 00 00 00 00 # # Biquad A, Right Channel (Page 63, Register 20, C33-C37) w 30 00 3F w 30 14 7E 33 A8 00 C0 E6 2C 00 00 00 00 00 3E 33 A9 00 00 00 00 00 # # Biquad D, Left Channel, Default values (Page 62, Register 72, C16-20) w 30 00 3E w 30 48 7F FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 # # Biquad D, Right Channel, Default values (Page 63, Register 80, C48-52) w 30 00 3F w 30 50 7F FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 # ############################################### ############################################### # Playback Setup ############################################### # # Select Page 1 w 30 00 01 # # De-pop w 30 14 25 # # Route LDAC/RDAC to HPL/HPR w 30 0c 08 08 # # Route LDAC/RDAC to LOL/LOR w 30 0e 08 08 # # Power up HPL/HPR and LOL/LOR drivers w 30 09 3C # # Unmute HPL/HPR driver, 0dB Gain w 30 10 00 00 # # Unmute LOL/LOR driver, 0dB Gain w 30 12 00 00 # # Select Page 0 w 30 00 00 # # DAC => 0dB w 30 41 00 00 # # Power up LDAC/RDAC w 30 3f d6 # # Unmute LDAC/RDAC w 30 40 00 # ###############################################