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.
Hello,
I have a question regarding the use of the ADC SOCs.
There are two pins I need to read, A0 and A2. I would like to use the same SOC (SOC0) to convert both pins in order to make the conversion process as fast as possible. Is this possible if the pins are in the same module? My code implementation is not working. However, it does work to use the same SOC for pins within different ADC modules (e.g., pins A2 and B2).
I am able to convert pins A0 and A2 successfully using different SOCs (SOC0 and SOC1), however this takes a bit longer than I would like for it to take, so I would like to use the same SOC.
The other thing I noticed is that the function call to read the ADC result is ADC_readResult(uint32_t resultBase, ADC_SOCNumber socNumber). From this function you can see that the arguments passed into the function are the resultBase (e.g., ADCARESULT_BASE) and the SOC number (e.g., ADC_SOC_NUMBER0). Basically, there is no way for the function to distinguish between the individual pins in the ADC module if the same SOC is used for pins within the same ADC module.
So, is it possible to use the same SOC for two pins in the same ADC module?
Thank you,
Ryan
Ryan,
No, each SOC is tied to a singular ADC input pin. This is a limitation of the ADC, in that there is only one sample and hold circuit per ADC so only one pin can be sampled at a given time.
You have implemented simultaneous sampling the correct way by spreading it across different ADCs. Keep in mind that the SOC0 on ADCA and SOC0 on ADCB can be fed from the same trigger so the samples are truly simultaneous.
If you implemented this on one ADC then the conversions would be on SOC0/SOC1, fed from the same trigger, but happen back to back vs simultaneously.
Best,
Matthew