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.

ADC configuration help f28035

Other Parts Discussed in Thread: CONTROLSUITE

Can anybody help me with adc configuration?

I require all 16 channels to be converted in simultaneous mode (A0-B0,A1-B1 ..) at every timer0 interrupt.

And it should generate just one ADC interrupt after completion of all 16 channels.

ADCSAMPLEMODE = -0xff; //correct?

AdcRegs.ADCSOC0CTL.bit.TRIGSEL= 1;
AdcRegs.ADCSOC1CTL.bit.TRIGSEL=  1;
...........
AdcRegs.ADCSOC15CTL.bit.TRIGSEL= 1;

Is it correct to put timer0 to all of them? Timer0 interrupt set at every 80uS as it required to convert all 16 channels at every 80us.

I assume timer0 will trigger ADC-A0 and ADC-B0, how to cascade the remaining 7 pairs?

Sample code would be great help.

Thanks in advance

Joy

  • While there isn't an existing example, that I recall, for all channels, an example does exist for 3 channels all triggered from the same source and generates an interrupt after the last conversion.

    This example is found in controlSUITE in <CONTROLSUITE_INSTALL_DIR>\device_support\f2803x\v126\DSP2803x_examples_ccsv4\adc_soc\Example_2803xAdcSoc.c

    You should be able to extend this to all 16 channels.

  • Thanks for the reply. I will try to modify the sample project for simultaneous sampling.

    One doubt, at present the timer0 was configured to generate interrupt at every 80us and it was generating interrupt as expected. Once I select timer0 as trigger for the ADC, will timer0 interrupt continue working as before? Or is it an exclusive function, trigger ADC, nothing else?

    Thanks and regards

    Joy

  • You should be able to fan out the CPU timer trigger to multiple destinations.

    It may be helpful to note that the PWM timebase can also be used as a periodic counter to trigger the ADC.

  • Joy Philipz said:

    One doubt, at present the timer0 was configured to generate interrupt at every 80us and it was generating interrupt as expected. Once I select timer0 as trigger for the ADC, will timer0 interrupt continue working as before? Or is it an exclusive function, trigger ADC, nothing else?

    Yes, the timer0 interrupt can work as before.  I'm assuming your using CPU Timer 0.  The CPU Timer 0 can start a conversion with the ADC and also interrupt the CPU.

  • Yes, I have seen many example programs use PWM as trigger source. But I prefer running the control loop 3-4 times faster than PWM frequency. So that control outputs are updated and stable as the LPF and PI regulators get more time to settle. And the PWM frequency is comparatively small, 5KHz.

    Cheers

    Joy