Thanks a lot Brice.
That is very useful to me.
best regards,
Ambrogio
iw2fvo
North Italy
Thanks a lot Brice.
That is very useful to me.
best regards,
Ambrogio
iw2fvo
North Italy
Good day Brice,
I used for years the program you have sent to me and it worked well sine I had the need to know the bus voltage only.
Now I am interested in getting the power and the current in addition to the voltage.
I have to read a max current of 3A and I used a 0.1 ohm shunt resistor.
By applying the formula I did set the currentLSB= 100uA/bit and the calibration at 4096 dec ( 1000h).
The real current into the load is about 50 mA and the power is 248 mW calculated by hand calculator.
My Pic gives the following results:
CONFIG: 8191
SHUNT VOLAGE: 501
BUS VOLTAGE: 4.968
POWER: 125
CURRENT: 501
CALIBRATION: 4096
the bus volt is OK but current and power are not_OK.
I read the data sheet but I am not able to find the solution at the moment.
I think there is a scaling problem somewhere around ... current is 10 times more , power is the double .. shunt_volt is 100 time more.
I will appreciate very much if You could help me in find out a solution.
Thanks in advance for the assistance.
regards,
Ambrogio
ps: when we write the calculated CAL value ( 4096 dec ) do we have to take into account that bit_0 is not used and so write 8192 or just write 4096 in the relevant register?
Bookmarks