Hi have a sample code for initializing the Sampling frequency for a DAC in which the values are as given below:-
P=1, R=1, J=8, D=1920, NDAC=2, MDAC=8, DOSR=128. This value is selected so as to have a MCLK of 12MHz.
The Sampling frequency is 48KHz ( DAC_FS).
But as per the values given in datasheet, the values for a MCLK of 12MHz should be as follows:-
P=1, R=1, J=7, D=1680, NDAC=2, MDAC=7, DOSR=128.
The formula given as per the datasheet is
DAC_FS = ( CODEC_CLKIN) / ( NDAC * MDAC * DOSR )
CODEC_CLKIN = (PLL _CLKIN * R * J.D) / ( P )
PLL_CLKIN = MCLK = 12MHz.
The final obtained value of the DAC_FS is same with both the set the values. But my question is do we really have to deviate from the datasheet values or is there a specific reason for the value change ?
Noel,
It depends on what is the PRB_P or PRB_R resource class (RC) requirement is. The setting in the datasheet is ok. The sample code settings make it easier to change from one sample rate to another by just changing DOSR values (for DAC side) and MADC values (for ADC side).
Regards,
J-
Thank you very much for the solution J Arbona. Sorry from my side for the late response. Your response was really helpful.