ADSP-CM40x processor includes ADC controller (ADCC), which automates the internal ADC sampling process. The ADCC provides an interface that synchronizes the controls between the processor and internal ADC.
1] Attached is the simple ADCC code which samples an ADC channel at low speed such as 100KSPS. The "event spaced" approach is used to sample the ADC channel. Refer Hardware reference Manual for more details about ADCC and event spaced sampling
Refer Readme file and comments in the code for more details.
2] For sampling the ADC at high speed, such as at its maximum sampling rate of 2.631MSPS, the event spaced approach used in above example will not work. For such cases, "maximum throughput" approach should be used, as explained in HRM.
Refer EE-365 "Maximising Sampling rate on ADSP-CM40x processor" application note for more details and associated code.
Can you please confirm if you are running the code as-it-is? I mean, did you make any modifications to it? If not, one thing I suspect is improper reference voltage. I have set external reference voltage in that code (EXT_REF macro in main.h is 1). So, did you install JP1 and JP4 for providing external reference voltage and can you measure ref voltage at those points to confirm 2.5V?
Also check if R204 and R205 resistors are removed. I remember, with those resistors populated, the U6 and U47 regulator provides 2.2V.
I am working with your ADCC code. Thanks for that. But I am getting data which looks funny. I input a constant amplitude 100 Hz sin wave between 380mv and 670mV (measured at input to CM408F extender card). I would expect raw sample data (16 bit shorts) between values of 9960 to17600. But I am seeing 20000 to 58000. The output is a sin wave but it is very non linear (choppy). Can you help me understand this?
Yes. I see the ADCC0_CFG register REFSEL is 1 which would explain the observed behavior.
Thanks for the insight and recommendations. It seems I could also set REFSEL to 0 and use the internal reference. Are there any issues with using the internal reference?
Just to follow up. Yes. Installing the jumpers did the trick. Based on my measured results and input waveform, I confirm the presence of the external 2.5 Vdc reference. Looks great!