Post Go back to editing

192kHz sample rate DAC1/1835 on EZlite-21369 without external clocks

Hi to all,

some people seem to be interested to run the DAC1 of the codec on the EZlite-21369 with a sample rate of 192kHz without external clocks.

Here is an example code, based on an talktru from AD. The code is an DDS with 57kHz sine-wave output, the ADC of the codec runs with 96kHz, these samples are not used, the DAC1 runs with 192kHz and outputs the sine-wave.

CLK and FS for the DAC and the SPORT1 are generated by the PCGA and synchronized with the FS of the ADC. Because the CLK-divider is in bypass-mode, it is impossible to shift the falling edge of the CLK to the falling edge of the FS by the phase register (necessary for I2S-mode).

Therefore, the CLK for the DAC and SPORT1 must be inverted. This is done by the pinbuffer of DAIP20, see SRU-initialisation.

Before running the code, position 4 of SW7 must be switched OFF to disconnect the PB4 from DAIP20-pin.This causes the power-on-self-test of the board to fail. A 10k resistor between DAIP20 and GND solves this problem, but the code also runs if the POST is failing, see PB4 switch discussion.

Best Regards

Lothar Klaas

DDS_Samplerate192kHz.zip
  • Hi,

      Thanks for sharing your code in the forum.

      If i understand correctly the issue is using the PB4 and at the same time using a DAI pin for your application? I see that you still have some DAI pins left to use in your application, apart from DAI 20, wouldn't be possible to use one of those, so that you can use PB4 also?

    From your post, i see you dont have issues in your audio applicaiton itself, but only using the DAI pins, please let me know if otherwise.

    Thanks

    Deepa

  • Hi Deepa,

    the pushbutton4 (PB4) drives the input of an schmitt-trigger, the output of the schmitt-trigger is routed via position4/SW7 to the DAIP20. The default setting of this switch is ON. Using the PB4 requires the DAIP20 pinbuffer to be defined as input.

    In the posted code,  the DAIP20 is defined as output, this requires to disconnect the output of the schmitt-trigger/PB4 from DAIP20 before running the code, position4/SW7 must be switched OFF.

    The PB4 is NOT used and can't be used furthermore, if position4/SW7 is switched OFF.

    Best Regards

    Lothar Klaas

  • Hi,

    I understand you want to use 'invert' functionality that is available for DAI 19 and DAI 20. In your case, you also want to use PB4 connected to DAI 20. Are you also using PB3? If you are not using PB3, then you can use the 'invert' functionality with DAI 19.

    Route the output of PCG to DAI 19 and set the inversion bit for DAI pin 19 in SRU_PIN4. Using this case, you can keep the PB4 always enabled.

    Thanks

    Deepa

  • Hi,

    thank you, but I don't want to use any PBx.

    Bets Reagards 

    Lothar Klaas

  • Hi,

      From the previous posts, somehow i thought you wanted to use the PB4.  So in your case, you can switch OFF the position 4 in SW7, and configure to use the DAI  pin 20 in any direction. I am not sure if you got your question answered.

    Please let me know if you wanted to know something else.

    Thanks

    Deepa

  • Hi,

    thank you, my questions are answered, I don't need any PBx for my application. I was only surprised to see different LED-reaction by switching position4/SW7 on or off, see PB4 switch discussion.

    Best Regards

    Lothar Klaas