Post Go back to editing

ADCC Codes

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.

ADCC_simple.zip
  • 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.

  • Hi Phil,

    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.

    Thanks,

    Prashant

  • Hi Prashant,

    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?

    Thanks,

    Phil

  • Hi Prashant,

    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?

    -Phil

  • Hi Prashant,

    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!

    Thanks,

    -Phil

  • Hi Prashant,

    I removed the jumpers JP1 and JP4 and enabled the internal reference which works fine as well.

    Thanks,

    Phil

  • Hi Phil,

    Glad to hear that it is working now correctly. Yes...you can either use internal reference or external reference for ADC, as explained in http://ez.analog.com/message/118252.

    Here are some tips for debugging ADCC applications: http://ez.analog.com/message/118284 . I will plan to add this one to it.

    Thanks,

    Prashant

  • Hello,

    I am not able to dump the code into flash itself. I tried the given zip file as it is and tried debug and download option.  I got the error which I have attached