summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2014-06-18 10:10:12 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-06-20 18:27:16 +0000
commit1a4bf7fdaa58d7e05d33bc1faf3fceed8b6ad07a (patch)
tree05e39bb69e2974b4936b0fbebbbee677655fe41e
parent246053495b3663202d34dd1b0b70302c295b32df (diff)
downloadchrome-ec-1a4bf7fdaa58d7e05d33bc1faf3fceed8b6ad07a.tar.gz
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>
-rw-r--r--board/zinger/usb_pd_policy.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/board/zinger/usb_pd_policy.c b/board/zinger/usb_pd_policy.c
index 83737b717b..ee03ec7ccc 100644
--- a/board/zinger/usb_pd_policy.c
+++ b/board/zinger/usb_pd_policy.c
@@ -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 */