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.

CCS/TMS320F28069: ADC sample without interupt

Part Number: TMS320F28069

Tool/software: Code Composer Studio

Hello! I have 4 lines coming into my ADC block on my chip, A0, A2, A3, and A5. These are just some board measurements that i want to read ever now and then, but not continuously. I've looked at a couple examples, but they are all using the PWM to trigger the ADC sample, where as I'm just wanting to call a function that reads a single sample from each of my 4 inputs. Is there a way to do this? I thought I would be able to just set a register high or low, which would enable to ADC conversion, I'd wait for it to finish, and then read from a register to see what value I got, but I'm just not seeing how to do that. Anyways, thought this might already be done out there somewhere so I thought i'd check. Thanks for any input!

-Greg

  • Hi Greg,

    You can use the ADCSOCFRC1 register to trigger the conversions. You should still configure an ADCINT flag be set from the last conversion (probably SOC3) and you will probably want to use late interrupt mode.

    If you want to wait around in the function for the ADC results to be ready, you can just spin-wait on the ADCINT flag (don't enable the interrupt to the PIE).

    You could also use the function to trigger the ADC, but then still use an interrupt to collect the results when the ADC is done (so you don't have to waste time waiting for the ADC to finish).