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.

Using C5505 / C5515 ADC for general purpose measurements

All:

We are planning to use GPAIN3 and GPAIN2 for measuring voltage on our board. There is a voltage divider that sets up the input to the proper range of the ADC.

When setting up the ADC for such a general purpose measurement, it appears that SAR_A2DMeasParamSet (csl function in csr_adc.c) does not apply. Or does it?

Do I need to create a new case for using GPAIN3 and GPAIN2 as general purpose?

Is there some exising code that uses GPAIN3 or GPAIN2 (or even 1 or 0) for external general purpose measurments?

 

Regards,

Todd Anderson

  • All:

    Here is how our present code uses CSL to do a general purpose measurement of GPAIN3:

    1. SAR_init();   - enables SAR module and resets the SAR registers to their default value.

    2. SAR_chanOpen();  - populates the SAR object structure information.

    3. SAR_chanSetup(); - provides the setup parameters to the SAR A/D registers.

    4. SAR_chanCycSet(); - configures single- or continuous-conversion.

    5. SAR_startConversion();  - sets ADC start bit to start the A/D conversion.

    6. SAR_getStatus();  -  checks to see when conversion is complete.

    7. SAR_readData();  - gets ADC conversion results.

    8. SAR_stopConversion();  - stops the ADC conversion.

     

    In order use 2 channels, here is what I propose to do -

    9. SAR_chanClose();  - close selected channel.

    10. SAR_chanOpen(); - open different channel.

    11. SAR_chanSetup(); -  setup different channel.

    12. SAR_chanCycSet(); - set up single or continuous.

    13. SAR_startConversion(); - perform A/D conversion.

    14. SAR_getStatus();  - wait until conversion is done.

    15. SAR_readData(); -  get results.

    16. SAR_stop Conversion.

    ------------------

    I plan to repeat steps 9-16 to select between 2 inputs. Any feedback on this process would be appreciated!

     

    Regards,

    Todd Anderson