Hi,
Can any one say as to why people scale 3.3 volts to 4096 & not 4095 when in reality 4096 is a 13 bit value that can never be represented on a 12 bit ADC?
What if 0 to 3.3 is scaled to 0 to 4095 counts? Why not 3.3/4095.0 ?
#if MATH_TYPE == IQ_MATH
#define AdcFsVoltage _IQ(3.3) // ADC full scale voltage
#else // MATH_TYPE is FLOAT_MATH
#define AdcFsVoltage _IQ(3.3/4096.0) // ADC full scale voltage
#endif_iq Result; // ADC result
void main(void){Result = _IQmpy(AdcFsVoltage, _IQ12toIQ( (_iq)AdcResult.ADCRESULT0));
Regards
Raghu