This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28075: ADC Sampling

Part Number: TMS320F28075
Other Parts Discussed in Thread: CONTROLSUITE

Hi,

As I understand from the user guide, ADC is sampled at some trigger and the value is captured in one of SOCs.

But, I am looking to sample the same ADC channel for some number of samples (say, 10) once triggered and the value is intended to capture in the same SOC. I will store the value locally before another sample value. I am wondering if this is possible.

Thank You,
Sagar

  • Hi Sagar,

    You can definitely sample the same channel 10 times from one trigger by configuring 10 SOCs all with the same trigger source and channel select. If you use SOC0 to SOC9 the 10 conversions will go into ADCRESULT0 to ADCRESULT9.
  • Hi Devin,

    Thanks for replying. Yes, I understood that this can be done. My question was to see if I can do this on a single SOC rather 10 different SOCs.
  • In this case you would need to increase the trigger rate by a factor of 10, and then use the CPU, DMA, or CLA to move the conversions somewhere before the next sample occurs.

    There isn't any HW mechanism to accumulate results and there isn't any mechanism to re-trigger multiple conversions from a single master trigger.
  • Well, the trigger source is periodic and that period is constant. I cannot change that.

    Can you please answer this?
    I will read ADC value at 0ms at which trigger occurs. Let's say that next trigger occurs at 100ms. If I read the ADC values at in between values say, at 30ms and 60ms, before next trigger occurs, then will I get the update values?

    Thanks,
    Sagar
  • Hi Sagar,

    The ADC results won't update unless you trigger another conversion.

    If you want exactly timed conversion results, you should use another timing peripheral running at a faster speed to generate the interpolated triggers.  The ePWM module has the hooks to sync up multiple modules.

    If you don't care too much about specific timings of the samples, you can setup the ADC HW to self-trigger repeatedly.  You do this by setting:

    • SOC0 triggers ADCINT1
    • INT1CONT set so that ADCINT1 can be continuously generated
    • ADCINTSOCSEL1.SOC0 = 1 (ADCINT1 triggers SOC0)

    In this case SOC0 triggers ADCINT1 which then re-triggers SOC0, so the ADC converts continuously. Note: you still need some initial trigger to start the process.  If you want to use multiple ADCs, you should trigger them all at the same time so they run in lock-step.  

  • Thanks for the answer Devin.
    If there is any example or anything related application note for the above point, please direct me there.

    I appreciate your response.
  • Hi Sagar,

    I think if you can run and understand the adc_soc_continuous example in ControlSUITE, you should be in good shape to re-factor that example to only use 1 SOC per my above rough guidelines.

    If you want to use multiple ADCs simultaneously, run and understand the adc_soc_software_sync example.  You can then use the simultaneous triggering methodology to start your continuous sampling.

    I guess another possibility, as long as your ISR execution time isn't time critical, would be to just directly software trigger conversions as needed.  You then just spin-wait for them to complete and then read them immediately.  To get some idea on how this works, see the adc_soc_software example.