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.

TMS320F28027: Example to trigger one ADC conversion and wait for the result

Part Number: TMS320F28027
Other Parts Discussed in Thread: C2000WARE

Is there an example for how to trigger one ADC conversion of one SOC and then wait for the result?

Also, given the errata for first conversion, I imagine it will be something like...

AdcRegs.ADCSOCFRC1.bit.SOC0 = 1; // Dummy
AdcRegs.ADCSOCFRC1.bit.SOC1 = 1;

while (AdcRegs.ADCSOCFLG1.bit.SOC1 == 1) 

;  // wait here

...and since I normally have ADCINT triggered by SOC2, I should have no issue with having to manage interrupts in the above, correct?

Thanks!

  • Hello Mark,

    Is there an example for how to trigger one ADC conversion of one SOC and then wait for the result?

    From what I see in C2000Ware, no there are no examples for this (this device is 16 years old, there isn't much support for software examples at this point). I think this is how you would trigger the SOCs: Configure the SOCs to trigger interrupts once conversion is complete > enable interrupts > use ADCSOCFRC1 to force a software trigger of the SOC > wait for interrupt to trigger with while loop > clear interrupt and read ADC result. Keep in mind you can use interrupts without having an ISR be called.

    ...and since I normally have ADCINT triggered by SOC2, I should have no issue with having to manage interrupts in the above, correct?

    Yes, based on my understanding that should be fine.