• Home
  • pcDuino
  • WiKi
  • Store
  • Distributors
  • Home
  • pcDuino
  • WiKi
  • Store
  • Distributors
HomepcDuinoArduino-ish ProgramADCAXP 209 Internal temperature
Previous Next

AXP 209 Internal temperature

Posted by: Yang , August 27, 2014

ADC Measurement Values

First register is high 8 bits, second is lower 4 (lower 5 for battery discharge current).

Channel Registers 000h Step FFFh
ACIN Voltage 56h, 57h 0 mV 1.7 mV 6.9615 V
ACIN Current 58h, 59h 0 mA 0.625 mA 2.5594 A
VBUS voltage 5Ah, 5Bh 0 mV 1.7 mV 6.9615 V
VBUS Current 5Ch, 5Dh 0 mA 0.375 mA 1.5356 A
Internal Temperature 5Eh, 5Fh -144.7 C 0.1 C 264.8 C
Temperature Sensor Voltage 62h, 63h 0 mV 0.8 mV 3.276 V
APS (IPSOUT) Voltage 7Eh, 7Fh 0 mV 1.4 mV 5.733 V
Battery Voltage 78h, 79h 0 mV 1.1 mV 4.5045 V
Battery Discharge Current 7Ah, 7Bh 0 mA 0.5 mA 4.095 A
Battery Charge Current 7Ch, 7Dh 0 mA 0.5 mA 4.095 A

temperature.sh

#!/bin/sh
#read Internal Temperature	5Eh, 5Fh	(0x000)-144.7 C	->	264.8 C(0xFFF) , 0.1°C / bit
TEMPERATURE_LSB=$(i2cget -y -f 0 0x34 0x5f)
TEMPERATURE_MSB=$(i2cget -y -f 0 0x34 0x5e)

echo $TEMPERATURE_MSB $TEMPERATURE_LSB

TEMPERATURE_BIN=$(( $(($TEMPERATURE_MSB << 4)) | $(($TEMPERATURE_LSB & 0x0F))))
TEMP_DEGC=$(echo "($TEMPERATURE_BIN/10)-144.7"|bc)

echo $TEMP_DEGC"°C"

2010-01-01-002937_660x464_scrot 2010-01-01-002122_660x464_scrot

Tags: ADC

Share!
Tweet

Yang

About the author

Leave a Reply Cancel reply

You must be logged in to post a comment.

Category

  • Home
  • pcDuino
  • WiKi
  • Store
  • Distributors