summaryrefslogtreecommitdiff
path: root/board/kuldax
diff options
context:
space:
mode:
authorben chen <ben.chen2@quanta.corp-partner.google.com>2022-10-28 14:38:26 +0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-11-04 04:46:29 +0000
commit1ce62eb825053fcc11ed4b1b53b48b0f0afb6b23 (patch)
tree3dc85adb79d3bc9455fb5eff96e8da27558df119 /board/kuldax
parent3dcbbe1f41af95beb807f5f4f01143a6b7d3f88f (diff)
downloadchrome-ec-1ce62eb825053fcc11ed4b1b53b48b0f0afb6b23.tar.gz
kuldax: modify ADC channel 3 configuration
modify ADC channel 3 IMON scale, be sure the retuened value will not overflow integer. V,rsense = 0.005 * 1 V,ina_output = 50 * 0.005 (or 50/200) = 0.25v V,ec = (20/(20+8.66)) * 0.25 = 0.17446v To scale the result to 1amp then V,ec * 1/((20/(20+8.66))*50/200) ,or V,ec * 143/25. BUG=b:255902516 BRANCH=none TEST=use "adc" console command check value. Change-Id: I1e76b93cb85edd3c4096f1413d6d4313c6eb8583 Signed-off-by: Ben Chen <ben.chen2@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3990465 Reviewed-by: Derek Huang <derekhuang@google.com> Reviewed-by: Daniel Coggin <dcoggin@google.com> Commit-Queue: Derek Huang <derekhuang@google.com> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
Diffstat (limited to 'board/kuldax')
-rw-r--r--board/kuldax/sensors.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/board/kuldax/sensors.c b/board/kuldax/sensors.c
index 96f49de8a3..a41d5be713 100644
--- a/board/kuldax/sensors.c
+++ b/board/kuldax/sensors.c
@@ -46,11 +46,11 @@ const struct adc_t adc_channels[] = {
.factor_mul = ADC_MAX_VOLT * 39,
.factor_div = (ADC_READ_MAX + 1) * 5,
},
- [ADC_PPVAR_IMON] = { /* 872.3 mV/A */
+ [ADC_PPVAR_IMON] = { /* 20/(20+8.66)*50/200 */
.name = "PPVAR_IMON",
.input_ch = NPCX_ADC_CH3,
- .factor_mul = ADC_MAX_VOLT * 1433,
- .factor_div = (ADC_READ_MAX + 1) * 1250,
+ .factor_mul = ADC_MAX_VOLT * 143,
+ .factor_div = (ADC_READ_MAX + 1) * 25,
},
};