zinger: update current and voltage sensing gains

On the P2 boards, the operational amplifier gain for current sensing is
exactly x100 rather than x101.
(non-inverter configuration with R1=1.8kOhm R2=178kOhm)

The voltage gain constant had a typo introducing a 10% error.
the voltage divider is 10k/100k,so it's x11 gain.
ie it should be written (10+100)/10 rather than (10+110).

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BRANCH=none
BUG=chrome-os-partner:28331
TEST=make BOARD=zinger
checked manually with a voltmeter and traces.

Change-Id: I8097ab50149fee319efc11ebae75802e8a49a7f8
Reviewed-on: https://chromium-review.googlesource.com/204540
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
Vincent Palatin
2014-06-18 10:10:12 -07:00
committed by chrome-internal-fetch
parent 246053495b
commit 1a4bf7fdaa

View File

@@ -75,9 +75,9 @@ static timestamp_t fault_deadline;
/* Current sense resistor : 5 milliOhm */
#define R_SENSE 5
/* VBUS voltage is measured through 10k / 100k voltage divider = /11 */
#define VOLT_DIV ((10+110)/10)
/* The current sensing op-amp has a x101 gain */
#define CURR_GAIN 101
#define VOLT_DIV ((10+100)/10)
/* The current sensing op-amp has a x100 gain */
#define CURR_GAIN 100
/* convert VBUS voltage in raw ADC value */
#define VBUS_MV(mv) ((mv)*ADC_SCALE/VOLT_DIV/VDDA_MV)
/* convert VBUS current in raw ADC value */