Hi,
Can anyone explain how below conversation works?
clarke1.As =_IQ15toIQ((AdcResult.ADCRESULT0<<3)-_IQ15(0.50))<<1;
Piccolo devices have 12-bit ADC and 16-bit ADC registers. The AdcResult.ADCRESULT registers are right justified for Piccolo devices; therefore, the measured phase current value is firstly left shifted by three to convert into Q15 format (0 to 1.0), and then converted to ac quantity (± 0.5) following the offset subtraction. Finally, it is left shifted by one (multiplied by two) to normalize the measured phase current to ± 1.0 pu.
How do I get -1 to +1 range for given 0 to 2^12 counts?