We are using the VSENSE2 as the voltage sensing pin to measure the voltage.
I simply taken the sample source code and i programmmed my costom board.It is updating the voltage in milli voltages.I refered the code,in that we are dividing the register reading value in the voltage register by 2 by right shifting the value by one.Please give me the reason for dividing the register value by 2.
Here i am attaching the code where we modify the result register value
// ISENSEL is GND reference
//s16Vdrop = (s16)((-Battery.s32mAFilt)/G_SHUNT);
s16Vdrop = (s16)(Current_mA/G_SHUNT); // Calculated shunt drop voltage
//Battery.u16mV = (VSensor>>1)-s16Vdrop; // Calculating the load voltage
Battery.u16mV = (VSensor>>1) //Here i am not understanding the reason for dividing the register value
// ISENSEH is GND reference
Battery.u16mV = VSensor>>1; // scale to mV and no correction