LTC2943具溫度電壓和電流測(cè)量功能的多節(jié)電池電量測(cè)量芯片_第1頁
LTC2943具溫度電壓和電流測(cè)量功能的多節(jié)電池電量測(cè)量芯片_第2頁
LTC2943具溫度電壓和電流測(cè)量功能的多節(jié)電池電量測(cè)量芯片_第3頁
已閱讀5頁,還剩34頁未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、LTC2943 -具溫度、電壓與電流測(cè)量功能的多節(jié)電池電量測(cè)量芯片特點(diǎn)可測(cè)量累積的電池充電與放電電量3、6V至20V工作范圍可適合多種電池應(yīng)用14位ADC負(fù)責(zé)測(cè)量電池電壓、電流與溫度1%電壓、電流與充電準(zhǔn)確度 =t50mV檢測(cè)電壓范圍高壓側(cè)檢測(cè)適合任何電池化學(xué)組成與容量的通用測(cè)量I2C / SMBus 接口可配置警報(bào)輸出/充電完成輸入靜態(tài)電流小于120卩A小外形8引腳3mm x 3mm DFN圭寸裝典型應(yīng)用3.3VCHARGERDD卩P2kLTC2943 SENSE+ ALCCSDASENSE-SCLGNDTMULTICEl I三 LI-ION1A LOADTotal Charge Error

2、 vsDifferential Sense VoltageOJ110100sense (mV)294a TAO It描述LTC?2943可測(cè)量便攜式產(chǎn)品應(yīng)用中的電池充電狀態(tài)、電池電壓、電池電流及其自身溫度。其具有寬輸入電壓范圍,因而可與高達(dá)20V的多節(jié)電池配合使用。一個(gè)精準(zhǔn)的庫侖計(jì)量器負(fù)責(zé)對(duì)流經(jīng)位于電池正端子與負(fù)載或充電器之間的一個(gè)檢測(cè)電阻器電流進(jìn)行積分運(yùn)算。電池電壓、電流與溫度利用一個(gè)內(nèi)部 14位無延遲增量累加 No Latency 男ADC來測(cè)量。測(cè)量結(jié)果被存儲(chǔ)于 可通過內(nèi)置I2C / SMBus接口進(jìn)行存取的內(nèi)部存放器中。LTC2943具有針對(duì)所有4種測(cè)量物理量的可編程高門限與低門限。如

3、果超過了某個(gè)編程門限,那么該器件將采用SMBus警報(bào)協(xié)議或通過在內(nèi)部狀態(tài)存放器中設(shè)定一個(gè)標(biāo)記來傳送警報(bào)信號(hào)。LTC2943僅需采用單個(gè)低阻值檢測(cè)電阻器以設(shè)定測(cè)量電流范圍。應(yīng)用電開工具電動(dòng)自行車便攜式醫(yī)療設(shè)備視頻攝像機(jī)程序:#inelude vArduino 、h#inelude vstdint 、h#inelude Linduino 、h#inelude LT_I2C 、h#include UserInterface 、h#include QuikEval_EEPROM、h#include LTC2943、h#include / Function Declarationvoid print_t

4、itle(); / Print the title blockvoid print_prompt(); / Print the Promptvoid store_alert_settings();/ Store the alert settings to the EEPROMint8_t restore_alert_settings(); / Read the alert settings from EEPROM/! The delay/! The delay between#define AUTOMATIC_MODE_DISPLAY_DELAY 1000 between readings i

5、n automatic mode#define SCAN_MODE_DISPLAY_DELAY 10000 readings in scan modeconst float resistor = 、 100;/! resistor value on demo board/ Error stringCheck I2C Address 、 ; /! Errorconst char ack_error = Error: No Acknowledge message/ Global variablesstatic int8_t demo_board_connected;/! Set to 1 if t

6、he board is connectedstatic uint8_t alert_code = 0;/! Value stored or read from ALERTregister 、 Shared between loop() and restore_alert_settings()/! Initialize Linduinovoid setup()char demo_name = DC1812; /! Demo Board Name stored in QuikEval EEPROMquikeval_I2C_init();/! Configure the EEPROM I2C por

7、t for 100kHzquikeval_I2C_connect();/! Connects to main I2C portSerial 、 begin(115200);/! Initialize the serial port to the PCprint_title();demo_board_connected = discover_demo_board(demo_name); if (demo_board_connected)print_prompt();elsedemo_board_connected = true;Serial、 println(Did not read ID St

8、ring, attempting to proceed anyway nPlease ensure I2C lines of Linduino are connected to the LTC device);/! Repeats Linduino loopvoid loop()int8_t ack = 0;/! I2C acknowledge indicatorstatic uint8_t user_command; /! The user input command static uint8_t mAh_or_Coulombs = 0;static uint8_t celcius_or_k

9、elvin = 0;static uint16_t prescalar_mode = LTC2943_PRESCALAR_M_4096;static uint16_t prescalarValue = 4096;static uint16_t alcc_mode = LTC2943_ALERT_MODE;/! Do nothing if the demo board is not/! Do nothing if serial is not available/! Read user input commandif (demo_board_connected) connectedif (Seri

10、al 、 available()user_command = read_int(); if (user_command != m)Serial 、 println(user_command);Serial 、 println();ack = 0;switch (user_command) /! Prints the appropriate submenucase 1:ack |= menu_1_automatic_mode(mAh_or_Coulombs, celcius_or_kelvin, prescalar_mode, prescalarValue, alcc_mode); /! Aut

11、omatic Modebreak;case 2:ack |= menu_2_scan_mode(mAh_or_Coulombs, celcius_or_kelvin, prescalar_mode, prescalarValue, alcc_mode); /! Scan Modebreak;case 3:ack |= menu_3_manual_mode(mAh_or_Coulombs, celcius_or_kelvin, prescalar_mode, prescalarValue, alcc_mode); /! Manual Modebreak;case 4:ack |= menu_4_

12、sleep_mode(mAh_or_Coulombs, prescalar_mode, prescalarValue, alcc_mode);/! Sleep Modebreak;case 5:ack |= menu_5_shutdown_mode();/! Shutdown Modebreak;case 6:ack |= menu_6_settings(&mAh_or_Coulombs, &celcius_or_kelvin, &prescalar_mode, &prescalarValue, &alcc_mode); /! Settings Modebreak;/! If ack is n

13、ot recieved printif (ack != 0) an error 、Serial 、 println(ack_error);Serial 、print(F(Il*);println(F(n*);print_prompt();/ Function Definitions /! Print the title block void print_title()Serial 、*n);*n);Serial 、 print(F(* DC1812A Demonstration ProgramSerial 、print(F(*Serial 、 print(F(* This program co

14、mmunicates with the LTC2943 Multicell Coulomb *n);Serial 、 print(F(* Counter found on the DC1812A demo board、*n);Serial 、 print(F(* Set the baud rate to 115200 and select the newline terminator *n);Serial 、print(F(*n);/! Print the Prompt void print_prompt()Serial 、 print(F(n1-Automatic Moden);Serial

15、 、 print(F(2-Scan Moden);Serial 、 print(F(3-Manual Moden);Serial 、 print(F(4-Sleep Moden);Serial 、 print(F(5-Shutdown Moden);Serial 、 print(F(6-Settingsn);Serial 、 print(F(Enter a command: ); /! Automatic Mode int8_t menu_1_automatic_mode(int8_t mAh_or_Coulombs, int8_t celcius_or_kelvin ,uint16_t pr

16、escalar_mode, uint16_t prescalarValue, uint16_t alcc_mode) /! return Returns the state of the acknowledge bit after the I2C address write 0=acknowledge, 1=no acknowledge 、int8_t LTC2943_mode;int8_t ack = 0;LTC2943_mode = LTC2943_AUTOMATIC_MODE|prescalar_mode|alcc_mode ; /! Set the control register o

17、f the LTC2943 to automatic mode as well as set prescalar and AL#/CC# pin values 、ack |= LTC2943_write(LTC2943_I2C_ADDRESS, LTC2943_CONTROL_REG, LTC2943_mode); /! Writes the set mode to the LTC2943 control registerdo Serial 、print(F(H*nn);uint8_t status_code, hightemp_code, lowtemp_code; uint16_t cha

18、rge_code, current_code, voltage_code, temperature_code;ack |= LTC2943_read_16_bits(LTC2943_I2C_ADDRESS,LTC2943_ACCUM_CHARGE_MSB_REG, &charge_code); /! Read MSB and LSB Accumulated Charge Registers for 16 bit charge codeack |= LTC2943_read_16_bits(LTC2943_I2C_ADDRESS,LTC2943_VOLTAGE_MSB_REG, &voltage

19、_code); /! Read MSB and LSB Voltage Registers for 16 bit voltage codeack |= LTC2943_read_16_bits(LTC2943_I2C_ADDRESS,LTC2943_CURRENT_MSB_REG, ¤t_code); /! Read MSB and LSB Current Registers for 16 bit current codeack |= LTC2943_read_16_bits(LTC2943_I2C_ADDRESS,LTC2943_TEMPERATURE_MSB_REG, &tem

20、perature_code); /! Read MSB and LSB Temperature Registers for 16 bit temperature codeack |= LTC2943_read(LTC2943_I2C_ADDRESS, LTC2943_STATUS_REG, &status_code);/! Read Status Register for 8 bit status codefloat charge, current, voltage, temperature;if(mAh_or_Coulombs)charge = LTC2943_code_to_coulomb

21、s(charge_code, resistor, prescalarValue); /! Convert charge code to Coulombs if Coulomb units are desired 、Serial 、 print(Coulombs: );Serial 、print(F( Cn);else/!charge = LTC2943_code_to_mAh(charge_code, resistor, prescalarValue);Convert charge code to mAh if mAh units are desired、Serial 、 print(mAh:

22、 );Serial 、 print(charge, 4);Serial 、print(F( mAhn);current = LTC2943_code_to_current(current_code, resistor);/!Convert current code to Amperesvoltage = LTC2943_code_to_voltage(voltage_code); /! Convert voltage code to VoltsSerial 、 print(F(Current );Serial 、 print(current, 4);Serial 、print(F( An);S

23、erial 、print(F(Voltage );Serial 、 print(voltage, 4);Serial 、print(F( Vn);if(celcius_or_kelvin) temperature = LTC2943_code_to_kelvin_temperature(temperature_code);/! Convert temperature code to kelvinSerial 、 print(F(Temperature );Serial 、 print(temperature, 4);Serial 、print(F( Kn);elsetemperature =

24、LTC2943_code_to_celcius_temperature(temperature_code);/! Convert temperature code to celciusSerial 、 print(F(Temperature );Serial 、 print(temperature, 4);Serial 、print(F( Cn);checkAlerts(status_code); /! Check status code for Alerts 、 If an Alert has been set, print out appropriate message in the Se

25、rial Prompt 、Serial 、 print(F(m-Main Menunn);Serial 、 flush();delay(AUTOMATIC_MODE_DISPLAY_DELAY); /! Delay for 1s before next pollingwhile (Serial 、 available() = false | (ack); /! if Serial isnot available and an NACK has not been recieved, keep polling the registers、read_int(); / clears the Seria

26、l 、 availablereturn(ack);/! Scan Mode int8_t menu_2_scan_mode(int8_t mAh_or_Coulombs , int8_t celcius_or_kelvin ,uint16_t prescalar_mode,uint16_t prescalarValue, uint16_t alcc_mode) /! return Returns the state of the acknowledge bit after the I2C address write 0=acknowledge, 1=no acknowledgeint8_t L

27、TC2943_mode;int8_t ack = 0;LTC2943_mode = LTC2943_SCAN_MODE|prescalar_mode|alcc_mode ;/! Set the control mode of the LTC2943 to scan mode as well as set prescalar and AL#/CC# pin values 、Serial 、 println();ack |= LTC2943_write(LTC2943_I2C_ADDRESS, LTC2943_CONTROL_REG, LTC2943_mode);/! Writes the set

28、 mode to the LTC2943 control registerdoSerial 、print(F(H*nn);uint8_t status_code;uint16_t charge_code, current_code, voltage_code, temperature_code;/! Read MSB and LSBack |= LTC2943_read_16_bits(LTC2943_I2C_ADDRESS, LTC2943_ACCUM_CHARGE_MSB_REG, &charge_code); Accumulated Charge Registers for 16 bit

29、 charge codeack |= LTC2943_read_16_bits(LTC2943_I2C_ADDRESS, LTC2943_VOLTAGE_MSB_REG, &voltage_code);/! Read MSB and LSBVoltage Registers for 16 bit voltage codeack |= LTC2943_read_16_bits(LTC2943_I2C_ADDRESS, LTC2943_CURRENT_MSB_REG, ¤t_code);/! Read MSB and LSBCurrent Registers for 16 bit cu

30、rrent codeack |= LTC2943_read_16_bits(LTC2943_I2C_ADDRESS, LTC2943_TEMPERATURE_MSB_REG, &temperature_code); /! Read MSB and LSB Temperature Registers for 16 bit temperature codeack |= LTC2943_read(LTC2943_I2C_ADDRESS, LTC2943_STATUS_REG, &status_code); /! Read Status Registers for 8 bit status codef

31、loat charge, current, voltage, temperature;if(mAh_or_Coulombs)charge = LTC2943_code_to_coulombs(charge_code, resistor, prescalarValue);/! Convert charge code to Coulombs if Coulomb units are desired、Serial 、 print(Coulombs: );Serial 、 print(charge, 4);Serial 、print(F( Cn);elsecharge = LTC2943_code_t

32、o_mAh(charge_code, resistor, prescalarValue);/! Convert charge code to mAh if mAh units are desired、Serial 、 print(mAh: );Serial 、 print(charge, 4);Serial 、print(F( mAhn);current = LTC2943_code_to_current(current_code, resistor); /! Convert current code to Amperesvoltage = LTC2943_code_to_voltage(vo

33、ltage_code);/! Convert voltage code to VoltsSerial 、 print(F(Current );Serial 、 print(current, 4);Serial 、print(F( An);Serial 、print(F(Voltage );Serial 、 print(voltage, 4);Serial 、print(F( Vn);if(celcius_or_kelvin)temperature = LTC2943_code_to_kelvin_temperature(temperature_code); /! Convert tempera

34、ture code to Kelvin if Kelvin units are desired、Serial 、 print(F(Temperature );Serial 、 print(temperature, 4);Serial 、print(F( Kn);elsetemperature = LTC2943_code_to_celcius_temperature(temperature_code); /! Convert temperature code to Celcius if Celcius units are desired、Serial 、 print(F(Temperature

35、 );Serial 、 print(temperature, 4);Serial 、print(F( Cn);checkAlerts(status_code); /! Check status code for Alerts 、 If an Alert has been set, print out appropriate message in the Serial PromptSerial 、 flush();delay(SCAN_MODE_DISPLAY_DELAY);while (Serial 、 available() = false | (ack);read_int(); / cle

36、ars the Serial、 availablereturn(ack);/! Manual Mode int8_t menu_3_manual_mode(int8_t mAh_or_Coulombs ,int8_t celcius_or_kelvin ,uint16_t prescalar_mode, uint16_t prescalarValue, uint16_t alcc_mode) /! return Returns the state of the acknowledge bit after the I2C address write 0=acknowledge, 1=no ack

37、nowledgeint8_t LTC2943_mode;int8_t ack = 0;LTC2943_mode = LTC2943_MANUAL_MODE|prescalar_mode|alcc_mode ;/! Set the control mode of the LTC2943 to manual mode as well as set prescalar and AL#/CC# pin values 、Serial 、 println();ack |= LTC2943_write(LTC2943_I2C_ADDRESS, LTC2943_CONTROL_REG, LTC2943_mod

38、e);/! Writes the set mode to the LTC2943 controlregisterint staleData = 0;/! StaleData Check variable 、 When set to 1 it indicates that stale data is being read from the voltage, current and temperature registers、do Serial 、print(F(H*nn);uint8_t status_code;uint16_t charge_code, current_code, voltag

39、e_code, temperature_code;/! Read MSB and LSBack |= LTC2943_read_16_bits(LTC2943_I2C_ADDRESS, LTC2943_ACCUM_CHARGE_MSB_REG, &charge_code); Accumulated Charge Registers for 16 bit charge codeack |= LTC2943_read_16_bits(LTC2943_I2C_ADDRESS,LTC2943_VOLTAGE_MSB_REG, &voltage_code); /! Read MSB and LSB Vo

40、ltage Registers for 16 bit voltage codeack |= LTC2943_read_16_bits(LTC2943_I2C_ADDRESS, LTC2943_CURRENT_MSB_REG, ¤t_code);/! Read MSB and LSBCurrent Registers for 16 bit current code/! Read MSB and LSBack |= LTC2943_read_16_bits(LTC2943_I2C_ADDRESS, LTC2943_TEMPERATURE_MSB_REG, &temperature_co

41、de); Temperature Registers for 16 bit temperature codeack |= LTC2943_read(LTC2943_I2C_ADDRESS, LTC2943_STATUS_REG, &status_code); /! Read Status Registers for 8 bit status codefloat charge, current, voltage, temperature;if(mAh_or_Coulombs)charge = LTC2943_code_to_coulombs(charge_code, resistor, pres

42、calarValue); /! Convert charge code to Coulombs if Coulomb units are desired、Serial 、 print(Coulombs: );Serial 、 print(charge, 4);Serial 、print(F( Cn);elsecharge = LTC2943_code_to_mAh(charge_code, resistor, prescalarValue); /! Convert charge code to mAh if mAh units are desired、Serial 、 print(mAh: )

43、;Serial 、 print(charge, 4);Serial 、print(F( mAhn);current = LTC2943_code_to_current(current_code, resistor); /! Convert current code to Amperesvoltage = LTC2943_code_to_voltage(voltage_code);/! Convert voltage code to VoltsSerial 、 print(F(Current );Serial 、 print(current, 4);Serial 、print(F( A);if(

44、staleData) Serial 、 print(F( * Stale Data *n);/! If Stale data is inside the register after initial snapshot, Print Stale Data message 、else Serial 、 println();Serial 、print(F(Voltage );Serial 、 print(voltage, 4);Serial 、print(F( V);/! If Stale data is inside the register after initial snapshot, Pri

45、nt Stale Data message 、else Serial 、 println();if(celcius_or_kelvin)temperature = LTC2943_code_to_kelvin_temperature(temperature_code);/! Convert temperature code to Kelvin if Kelvin units are desired、Serial 、 print(F(Temperature );Serial 、 print(temperature, 4);Serial 、print(F( K);elsetemperature =

46、 LTC2943_code_to_celcius_temperature(temperature_code);/! Convert temperature code to Celcius if Celcius units are desired、Serial 、 print(F(Temperature );Serial 、 print(temperature, 4);Serial 、print(F( C);if(staleData) Serial 、 print(F( * Stale Data *n);else Serial 、 println();checkAlerts(status_cod

47、e);/! Check status code for Alerts 、 If an Alert has been set, print out appropriate message in the Serial PromptstaleData = 1;Serial 、 flush();delay(AUTOMATIC_MODE_DISPLAY_DELAY); while (Serial 、 available() = false | (ack);read_int(); / clears the Serial、 availablereturn(ack);/! Sleep Modeint8_t m

48、enu_4_sleep_mode(int8_t mAh_or_Coulombs ,uint16_t prescalar_mode, uint16_t prescalarValue, uint16_t alcc_mode)/! return Returns the state of the acknowledge bit after the I2C address write 0=acknowledge, 1=no acknowledgeint8_t LTC2943_mode;int8_t ack = 0;LTC2943_mode = LTC2943_SLEEP_MODE|prescalar_m

49、ode|alcc_mode ;/! Set the control mode of the LTC2943 to sleep mode as well as set prescalar and AL#/CC# pin values 、Serial 、 println();ack |= LTC2943_write(LTC2943_I2C_ADDRESS, LTC2943_CONTROL_REG, LTC2943_mode);/! Writes the set mode to the LTC2943 control registerdoSerial 、print(F(H*nn);delay(100

50、);uint8_t status_code;uint16_t charge_code;ack |= LTC2943_read_16_bits(LTC2943_I2C_ADDRESS, LTC2943_ACCUM_CHARGE_MSB_REG, &charge_code); /! Read MSB and LSB Accumulated Charge Registers for 16 bit charge codeack |= LTC2943_read(LTC2943_I2C_ADDRESS, LTC2943_STATUS_REG, &status_code);/! Read Status Re

51、gisters for 8 bit status codefloat charge;if(mAh_or_Coulombs)charge = LTC2943_code_to_coulombs(charge_code, resistor, prescalarValue); /! Convert charge code to Coulombs if Coulomb units are desired、Serial 、 print(Coulombs: );Serial 、 print(charge, 4);Serial 、print(F( Cn);elsecharge = LTC2943_code_t

52、o_mAh(charge_code, resistor, prescalarValue); /! Convert charge code to mAh if mAh units are desired 、Serial 、 print(mAh: );Serial 、 print(charge, 4);Serial 、print(F( mAhn);Serial 、 print(F(Current );Serial 、print(F( ADC Sleep 、 n);Serial 、print(F(Voltage );Serial 、print(F( ADC Sleep 、 n);Serial 、 p

53、rint(F(Temperature );Serial 、print(F( ADC Sleep 、 n);Serial 、 print(F(m-Main Menunn);checkAlerts(status_code);Serial 、 flush(); delay(AUTOMATIC_MODE_DISPLAY_DELAY);while (Serial 、 available() = false | (ack);read_int(); / clears the Serial、 availablereturn(ack);/! Shutdown Modeint8_t menu_5_shutdown

54、_mode()/! return Returns the state of the acknowledge bit after the I2C address write 0=acknowledge, 1=no acknowledgeint8_t ack = 0;ack |= LTC2943_write(LTC2943_I2C_ADDRESS, LTC2943_CONTROL_REG, LTC2943_SHUTDOWN_MODE);/! Sets the LTC2943 into shutdownmodeSerial 、 print(LTC2943 Has Been ShutDownn);return(ack);/! Settings Menuint8_t menu

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論