5 Replies Latest reply on Aug 12, 2016 8:32 AM by JoMe_264151

    ADC_CountsTo_Volts on PSoC

      I'm using PSoC BLE Pioneer,


      Reading ADC documentation of PSoC I've found this:


      float32 (uint32 chan, int16 adcCounts)




      Converts the ADC output to Volts as a floating point number. For example, if the ADC measured 0.534 volts, the return value would be 0.534. The calculation of voltage depends on the value of the voltage reference. When the Vref is based on Vdda, the value used for Vdda is set for the project in the System tab of the DWR.


      chan: ADC channel number.
      adcCounts: Result from the ADC conversion


      Return Value:
      Result in Volts


      Side Effects:


      My question, why I have to pass ADC channel number?  The channel is already implicit on Resultfrom the ADC conversion.




      My actual reading is:


              Ref_16 = ADC_GetResult16(1u);
              Ref = ADC_CountsTo_Volts(1u, Ref_16);


      so, ADC channel number seem redundant.


      Thanks for help,