├── UC1701.pdf ├── Electronics ├── openbmsriser.dcm ├── BMS FrontEnd │ ├── ISL94202.dcm │ ├── fp-lib-table │ ├── xt60.pretty │ │ ├── MR30.kicad_mod │ │ └── XT60.kicad_mod │ ├── OpenBMSFrontEnd.pro │ ├── ISL94202.lib │ ├── OpenBMSFrontEnd-cache.lib │ ├── CellFrontend.sch │ └── OpenBMSFrontEnd.sch ├── BMS GUI │ ├── Front Panel.pdf │ ├── fp-lib-table │ ├── Front Panel.pro │ ├── Front Panel-cache.lib │ └── Front Panel.sch ├── Power Dist │ ├── fp-lib-table │ ├── Power Dist.pro │ ├── Power Dist-cache.lib │ └── Power Dist.sch ├── openbmsriser.lib └── BMSFootprints.pretty │ ├── JLX12864G.kicad_mod │ └── OpenBMSRiser.kicad_mod ├── JLX12864G-086.pdf ├── Front Panel Code └── OpenBMS │ ├── gui.c │ ├── timer.c │ ├── timer.h │ ├── gui.h │ ├── setup.h │ ├── spi.h │ ├── main.h │ ├── .ccsproject │ ├── TI_USCI_I2C_master.h │ ├── UC1701.h │ ├── i2c.h │ ├── hardware.h │ ├── targetConfigs │ └── MSP430G2755.ccxml │ ├── spi.c │ ├── .project │ ├── setup.c │ ├── main.c │ ├── ISL94202.h │ ├── i2c.c │ ├── font.h │ ├── UC1701.c │ ├── TI_USCI_I2C_master.c │ ├── lnk_msp430g2755.cmd │ ├── ISL94202.c │ └── .cproject ├── README.md ├── LICENSE.md ├── .gitignore └── Arduino Test └── ISL94202 └── ISL94202.ino /UC1701.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralim/Open-BMS/HEAD/UC1701.pdf -------------------------------------------------------------------------------- /Electronics/openbmsriser.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /JLX12864G-086.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralim/Open-BMS/HEAD/JLX12864G-086.pdf -------------------------------------------------------------------------------- /Electronics/BMS FrontEnd/ISL94202.dcm: -------------------------------------------------------------------------------- 1 | EESchema-DOCLIB Version 2.0 2 | # 3 | #End Doc Library 4 | -------------------------------------------------------------------------------- /Electronics/BMS GUI/Front Panel.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ralim/Open-BMS/HEAD/Electronics/BMS GUI/Front Panel.pdf -------------------------------------------------------------------------------- /Electronics/BMS GUI/fp-lib-table: -------------------------------------------------------------------------------- 1 | (fp_lib_table 2 | (lib (name BMSFootprints)(type KiCad)(uri "../BMSFootprints.pretty")(options "")(descr "")) 3 | ) 4 | -------------------------------------------------------------------------------- /Front Panel Code/OpenBMS/gui.c: -------------------------------------------------------------------------------- 1 | /* 2 | * gui.c 3 | * 4 | * Created on: 27Aug.,2017 5 | * Author: Ben V. Brown 6 | */ 7 | #include "gui.h" 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Front Panel Code/OpenBMS/timer.c: -------------------------------------------------------------------------------- 1 | /* 2 | * timer.c 3 | * 4 | * Created on: 14Jun.,2017 5 | * Author: Ben V. Brown 6 | */ 7 | #include "timer.h" 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Open-BMS 2 | ISL94202 & MSP430 based BMS 3 | 4 | This is the source files for the Open BMS Designed by Ben V. Brown. 5 | Documentation is currently over at [Hackaday.io](https://hackaday.io/project/25512-open-bms). 6 | -------------------------------------------------------------------------------- /Electronics/BMS FrontEnd/fp-lib-table: -------------------------------------------------------------------------------- 1 | (fp_lib_table 2 | (lib (name xt60)(type KiCad)(uri "$(KIPRJMOD)/xt60.pretty")(options "")(descr "")) 3 | (lib (name BMSFootprints)(type KiCad)(uri "$(KIPRJMOD)/../BMSFootprints.pretty")(options "")(descr "")) 4 | ) 5 | -------------------------------------------------------------------------------- /Front Panel Code/OpenBMS/timer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * timer.h 3 | * 4 | * Created on: 14Jun.,2017 5 | * Author: Ben V. Brown 6 | */ 7 | 8 | #ifndef TIMER_H_ 9 | #define TIMER_H_ 10 | #include 11 | 12 | 13 | 14 | 15 | #endif /* TIMER_H_ */ 16 | -------------------------------------------------------------------------------- /Electronics/Power Dist/fp-lib-table: -------------------------------------------------------------------------------- 1 | (fp_lib_table 2 | (lib (name ServoConnectors)(type KiCad)(uri "$(KIPRJMOD)/ServoConnectors.pretty")(options "")(descr "")) 3 | (lib (name conn-test)(type KiCad)(uri "$(KIPRJMOD)/conn-test.pretty")(options "")(descr "")) 4 | ) 5 | -------------------------------------------------------------------------------- /Front Panel Code/OpenBMS/gui.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gui.h 3 | * 4 | * Created on: 27Aug.,2017 5 | * Author: Ben V. Brown 6 | */ 7 | 8 | #ifndef GUI_H_ 9 | #define GUI_H_ 10 | #include "UC1701.h" 11 | 12 | void gui_drawMainScreen(); 13 | 14 | 15 | 16 | #endif /* GUI_H_ */ 17 | -------------------------------------------------------------------------------- /Front Panel Code/OpenBMS/setup.h: -------------------------------------------------------------------------------- 1 | /* 2 | * setup.h 3 | * 4 | * Created on: 11Jun.,2017 5 | * Author: Ben V. Brown 6 | */ 7 | 8 | #ifndef SETUP_H_ 9 | #define SETUP_H_ 10 | #include 11 | #include "hardware.h" 12 | #include "i2c.h" 13 | void setup(); 14 | 15 | 16 | 17 | #endif /* SETUP_H_ */ 18 | -------------------------------------------------------------------------------- /Front Panel Code/OpenBMS/spi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * spi.h 3 | * 4 | * Created on: 26Aug.,2017 5 | * Author: ralim 6 | */ 7 | 8 | #ifndef SPI_H_ 9 | #define SPI_H_ 10 | #include 11 | #include 12 | #include "hardware.h" 13 | 14 | void SPI_init(); 15 | void SPI_tx(uint8_t data); 16 | 17 | #endif /* SPI_H_ */ 18 | -------------------------------------------------------------------------------- /Electronics/BMS FrontEnd/xt60.pretty/MR30.kicad_mod: -------------------------------------------------------------------------------- 1 | (module MR30 (layer F.Cu) (tedit 5922D818) 2 | (fp_text reference REF** (at -10.5 2) (layer F.SilkS) 3 | (effects (font (size 1 1) (thickness 0.15))) 4 | ) 5 | (fp_text value MR30 (at -10 -2) (layer F.Fab) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (pad 3 thru_hole circle (at 0 -3.5) (size 2.8 2.8) (drill 2.3) (layers *.Cu *.Mask)) 9 | (pad 2 thru_hole circle (at 0 0) (size 2.8 2.8) (drill 2.3) (layers *.Cu *.Mask)) 10 | (pad 1 thru_hole circle (at 0 3.5) (size 2.8 2.8) (drill 2.3) (layers *.Cu *.Mask)) 11 | ) 12 | -------------------------------------------------------------------------------- /Front Panel Code/OpenBMS/main.h: -------------------------------------------------------------------------------- 1 | /* 2 | * main.h 3 | * 4 | * Created on: 11Jun.,2017 5 | * Author: Ben V. Brown 6 | */ 7 | 8 | #ifndef MAIN_H_ 9 | #define MAIN_H_ 10 | #include 11 | #include "hardware.h" 12 | #include "setup.h" 13 | #include "i2c.h" 14 | #include "ISL94202.h" 15 | #include "UC1701.h" 16 | #ifndef NDEBUG 17 | // If debugger is attached and software breakpoints are enabled, DEBUG_BREAK will pause execution 18 | #define DEBUG_BREAK _op_code(0x4343) 19 | #else 20 | // Strip out DEBUG_BREAKs in final/release builds 21 | #define DEBUG_BREAK 22 | #endif 23 | 24 | 25 | #endif /* MAIN_H_ */ 26 | -------------------------------------------------------------------------------- /Front Panel Code/OpenBMS/.ccsproject: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /Front Panel Code/OpenBMS/TI_USCI_I2C_master.h: -------------------------------------------------------------------------------- 1 | #ifndef USCI_LIB 2 | #define USCI_LIB 3 | 4 | #define SDA_PIN 0x02 // msp430x261x UCB0SDA pin 5 | #define SCL_PIN 0x04 // msp430x261x UCB0SCL pin 6 | 7 | void TI_USCI_I2C_receiveinit(unsigned char slave_address, unsigned char prescale); 8 | void TI_USCI_I2C_transmitinit(unsigned char slave_address, unsigned char prescale); 9 | 10 | 11 | void TI_USCI_I2C_receive(unsigned char byteCount, unsigned char *field); 12 | void TI_USCI_I2C_transmit(unsigned char byteCount, unsigned char *field); 13 | 14 | 15 | unsigned char TI_USCI_I2C_slave_present(unsigned char slave_address); 16 | unsigned char TI_USCI_I2C_notready(); 17 | 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /Front Panel Code/OpenBMS/UC1701.h: -------------------------------------------------------------------------------- 1 | /* 2 | * UC1701.h 3 | * 4 | * Created on: 26Aug.,2017 5 | * Author: ralim 6 | */ 7 | 8 | #ifndef UC1701_H_ 9 | #define UC1701_H_ 10 | 11 | #include "spi.h" 12 | #include "hardware.h" 13 | #define LCD_CS_LOW() (P3OUT&=~LCD_CS) 14 | #define LCD_CS_HIGH() (P3OUT|=LCD_CS) 15 | #define LCD_CD_LOW() (P3OUT&=~LCD_RS) 16 | #define LCD_CD_HIGH() (P3OUT|=LCD_RS) 17 | void lcd_init(); 18 | void lcd_clear(); 19 | void lcd_sendData(uint8_t d); 20 | void lcd_sendCommand(uint8_t d); 21 | void lcd_printChar(char c); 22 | void lcd_setCursor(uint8_t column, uint8_t line); 23 | void lcd_print(char* string); 24 | void lcd_drawNumber(uint16_t number, uint8_t places); 25 | void lcd_drawVoltage(uint16_t mV); 26 | 27 | #endif /* UC1701_H_ */ 28 | -------------------------------------------------------------------------------- /Front Panel Code/OpenBMS/i2c.h: -------------------------------------------------------------------------------- 1 | /* 2 | * i2c.h 3 | * 4 | * Created on: 11Jun.,2017 5 | * Author: Ben V. Brown 6 | * Nicer I2C wrapper for dealing with devices that use 8 bits for internal address (such as small EEPROMs) 7 | */ 8 | 9 | #ifndef I2C_H_ 10 | #define I2C_H_ 11 | #include 12 | #include "hardware.h" 13 | #include 14 | #include "TI_USCI_I2C_master.h" 15 | #define PRESCALER 20 16 | 17 | void setup_I2C(); 18 | 19 | uint8_t I2C_readReg8(uint8_t slave, uint8_t add); 20 | uint16_t I2C_readReg16(uint8_t slave, uint8_t add); 21 | void I2C_readMany(uint8_t slave, uint8_t startAddress, uint8_t count, 22 | uint8_t* buffer); 23 | 24 | void I2C_writeReg8(uint8_t slave, uint8_t add, uint8_t data); 25 | void I2C_writeReg16(uint8_t slave, uint8_t add, uint16_t data); 26 | 27 | #endif /* I2C_H_ */ 28 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 2 | 3 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 4 | -------------------------------------------------------------------------------- /Front Panel Code/OpenBMS/hardware.h: -------------------------------------------------------------------------------- 1 | /* 2 | * hardware.h 3 | * 4 | * Created on: 11Jun.,2017 5 | * Author: Ben V. Brown 6 | */ 7 | 8 | #ifndef HARDWARE_H_ 9 | #define HARDWARE_H_ 10 | /* 11 | * Defines the hardware details such as IO pins etc 12 | * The hardware consists of : 13 | * 8 Status LEDs 14 | * 3 User buttons 15 | * I2C to the BMS 16 | * TN LCD to show the status of the system 17 | */ 18 | 19 | 20 | #define MOSI (1<<4) 21 | #define MISO (1<<5) 22 | #define SCK (1<<0) 23 | #define LCD_RS (1<<6) 24 | #define LCD_CS (1<<7) 25 | #define LCD_RESET (1<<7) 26 | 27 | #define ISL_INT (1<<0) /*General IRQ from the ISL*/ 28 | #define ISL_FETS_OFF (1<<1) /*If driven high turns off output*/ 29 | #define ISL_SD (1<<2) /*Shutdown - if low then output is off*/ 30 | 31 | #define BUTT1 (1<<5) 32 | #define BUTT2 (1<<6) 33 | #define BUTT3 (1<<7) 34 | 35 | 36 | #endif /* HARDWARE_H_ */ 37 | -------------------------------------------------------------------------------- /Front Panel Code/OpenBMS/targetConfigs/MSP430G2755.ccxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Front Panel Code/OpenBMS/spi.c: -------------------------------------------------------------------------------- 1 | /* 2 | * spi.c 3 | * 4 | * Created on: 26Aug.,2017 5 | * Author: ralim 6 | */ 7 | 8 | #include "spi.h" 9 | #include 10 | 11 | void SPI_init() 12 | { 13 | P3SEL |= 0x31; // P3.0,4,5 USCI_A0 option select 14 | UCA0CTL0 |= UCCKPL | UCMSB | UCMST | UCSYNC; // 3-pin, 8-bit SPI master 15 | UCA0CTL1 |= UCSSEL_2; // SMCLK 16 | UCA0BR0 |= 0x01; // /1 17 | UCA0BR1 = 0; // 18 | UCA0MCTL = 0; // No modulation 19 | UCA0CTL1 &= ~UCSWRST; // **Initialize USCI state machine** 20 | //IE2 |= UCA0TXIE; //enable tx irq 21 | } 22 | void SPI_tx(uint8_t data) 23 | { 24 | UCA0TXBUF = data; 25 | while ((UCA0STAT & UCBUSY)); 26 | while (!(IFG2 & UCA0TXIFG)); 27 | 28 | } 29 | 30 | -------------------------------------------------------------------------------- /Front Panel Code/OpenBMS/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | OpenBMS 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 15 | full,incremental, 16 | 17 | 18 | 19 | 20 | 21 | com.ti.ccstudio.core.ccsNature 22 | org.eclipse.cdt.core.cnature 23 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 24 | org.eclipse.cdt.core.ccnature 25 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 26 | 27 | 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | *.obj 6 | 7 | # Precompiled Headers 8 | *.gch 9 | *.pch 10 | 11 | # Compiled Dynamic libraries 12 | *.so 13 | *.dylib 14 | *.dll 15 | 16 | # Compiled Static libraries 17 | *.lai 18 | *.la 19 | *.a 20 | 21 | # Executables 22 | *.exe 23 | *.out 24 | *.app 25 | 26 | # For PCBs designed using KiCad: http://www.kicad-pcb.org/ 27 | 28 | # Temporary files 29 | *.000 30 | *.bak 31 | *.bck 32 | *.kicad_pcb-bak 33 | *~ 34 | _autosave-* 35 | *.tmp 36 | 37 | # Netlist files (exported from Eeschema) 38 | *.net 39 | 40 | # Autorouter files (exported from Pcbnew) 41 | *.dsn 42 | *.ses 43 | 44 | # Exported BOM files 45 | *.xml 46 | *.csv 47 | Front Panel Code/.metadata/ 48 | Front Panel Code/OpenBMS/Debug/ 49 | Front Panel Code/.jxbrowser-data/ 50 | Front Panel Code/OpenBMS/.launches/OpenBMS.launch 51 | *.prefs 52 | Front Panel Code/OpenBMS/targetConfigs/readme.txt 53 | Front Panel Code/RemoteSystemsTempFiles/ 54 | Electronics/Power Dist/Gerbers/ 55 | *.zip 56 | -------------------------------------------------------------------------------- /Electronics/BMS GUI/Front Panel.pro: -------------------------------------------------------------------------------- 1 | update=18/06/2017 9:31:41 PM 2 | version=1 3 | last_client=kicad 4 | [pcbnew] 5 | version=1 6 | LastNetListRead= 7 | UseCmpFile=1 8 | PadDrill=0.600000000000 9 | PadDrillOvalY=0.600000000000 10 | PadSizeH=1.500000000000 11 | PadSizeV=1.500000000000 12 | PcbTextSizeV=1.500000000000 13 | PcbTextSizeH=1.500000000000 14 | PcbTextThickness=0.300000000000 15 | ModuleTextSizeV=1.000000000000 16 | ModuleTextSizeH=1.000000000000 17 | ModuleTextSizeThickness=0.150000000000 18 | SolderMaskClearance=0.000000000000 19 | SolderMaskMinWidth=0.000000000000 20 | DrawSegmentWidth=0.200000000000 21 | BoardOutlineThickness=0.100000000000 22 | ModuleOutlineThickness=0.150000000000 23 | [cvpcb] 24 | version=1 25 | NetIExt=net 26 | [general] 27 | version=1 28 | [eeschema] 29 | version=1 30 | LibDir= 31 | [eeschema/libraries] 32 | LibName1=power 33 | LibName2=device 34 | LibName3=transistors 35 | LibName4=conn 36 | LibName5=linear 37 | LibName6=regul 38 | LibName7=interface 39 | LibName8=display 40 | LibName9=opto 41 | LibName10=contrib 42 | LibName11=msp430 43 | LibName12=../openbmsriser 44 | LibName13=switches 45 | -------------------------------------------------------------------------------- /Electronics/openbmsriser.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | # 4 | # JLX12864G 5 | # 6 | DEF JLX12864G U 0 40 Y Y 1 F N 7 | F0 "U" 0 750 60 H V C CNN 8 | F1 "JLX12864G" 0 850 60 H V C CNN 9 | F2 "" 0 700 60 H I C CNN 10 | F3 "" 0 700 60 H I C CNN 11 | DRAW 12 | S -350 900 350 -700 0 1 0 N 13 | X ROM_IN 1 -550 550 200 R 50 50 1 1 I 14 | X ROM_OUT 2 -550 450 200 R 50 50 1 1 I 15 | X ROM_SCK 3 -550 350 200 R 50 50 1 1 I 16 | X ROM_CS 4 -550 250 200 R 50 50 1 1 I 17 | X LEDA 5 -550 150 200 R 50 50 1 1 I 18 | X VSS 6 -550 50 200 R 50 50 1 1 I 19 | X VDD 7 -550 -50 200 R 50 50 1 1 I 20 | X SCLK 8 -550 -150 200 R 50 50 1 1 I 21 | X SDA 9 -550 -250 200 R 50 50 1 1 I 22 | X RS 10 -550 -350 200 R 50 50 1 1 I 23 | X ~RESET 11 -550 -450 200 R 50 50 1 1 I 24 | X ~CS 12 -550 -550 200 R 50 50 1 1 I 25 | ENDDRAW 26 | ENDDEF 27 | # 28 | # OpenBMSRiser 29 | # 30 | DEF OpenBMSRiser J 0 40 Y Y 1 F N 31 | F0 "J" 0 0 60 H V C CNN 32 | F1 "OpenBMSRiser" 0 -100 60 H V C CNN 33 | F2 "" 0 0 60 H I C CNN 34 | F3 "" 0 0 60 H I C CNN 35 | DRAW 36 | S -400 50 400 -950 0 1 0 N 37 | X GND 1 -600 -250 200 R 50 50 1 1 I 38 | X SCL 2 -600 -350 200 R 50 50 1 1 I 39 | X SDA 3 -600 -450 200 R 50 50 1 1 I 40 | X ~INT 4 -600 -550 200 R 50 50 1 1 I 41 | X FETsOFF 5 -600 -650 200 R 50 50 1 1 I 42 | X ~SD 6 -600 -750 200 R 50 50 1 1 I 43 | X RGO 7 -600 -850 200 R 50 50 1 1 I 44 | ENDDRAW 45 | ENDDEF 46 | # 47 | #End Library 48 | -------------------------------------------------------------------------------- /Front Panel Code/OpenBMS/setup.c: -------------------------------------------------------------------------------- 1 | /* 2 | * setup.c 3 | * 4 | * Created on: 11Jun.,2017 5 | * Author: Ben V. Brown 6 | */ 7 | 8 | #include "setup.h" 9 | void setup_GPIO(); 10 | //Setup all hardware peripherals as required 11 | void setup() 12 | { 13 | //Setup clock to 1MHz for lower power usage 14 | 15 | DCOCTL = 0; // Select lowest DCOx and MODx settings 16 | //BCSCTL1 = CALBC1_1MHZ; // Set DCO to 8MHz 17 | //DCOCTL = CALDCO_1MHZ; 18 | BCSCTL1 = 0x87; 19 | DCOCTL = 0x20; 20 | //System should now be running with SMCLK=DCO=1MHz 21 | setup_GPIO(); 22 | //Sets up the GPIO to the correct directions and states 23 | //Sets up the UART at 115200 baud 8N1 24 | setup_I2C(); 25 | _EINT(); 26 | } 27 | 28 | void setup_GPIO() 29 | { 30 | //Setting up all the GPIO pins 31 | P2SEL &= ~(BIT6 | BIT7); //enable XIN,XOUT as normal GPIO instead 32 | 33 | P1DIR = LCD_RESET; 34 | P1OUT = LCD_RESET; 35 | P2DIR = 0x00; 36 | P2DIR |= ISL_FETS_OFF; 37 | P2OUT = 0x00; 38 | P3DIR = MOSI | SCK | LCD_CS | LCD_RS; 39 | P3OUT = 0x00; 40 | P4DIR = 0xFF; 41 | P4OUT = 0x01; 42 | P2IES = BUTT1 | BUTT2 | BUTT3; //falling edge 43 | P2IFG = 0x00; //ensure irq flags are reset first 44 | P2IE |= BUTT1 | BUTT2 | BUTT3; 45 | P2OUT |= BUTT1 | BUTT2 | BUTT3; //set to pullup 46 | P2REN |= BUTT1 | BUTT2 | BUTT3; //enable pullup/down 47 | } 48 | -------------------------------------------------------------------------------- /Electronics/Power Dist/Power Dist.pro: -------------------------------------------------------------------------------- 1 | update=7/06/2017 11:53:33 AM 2 | version=1 3 | last_client=kicad 4 | [pcbnew] 5 | version=1 6 | LastNetListRead= 7 | UseCmpFile=1 8 | PadDrill=0.600000000000 9 | PadDrillOvalY=0.600000000000 10 | PadSizeH=1.500000000000 11 | PadSizeV=1.500000000000 12 | PcbTextSizeV=1.500000000000 13 | PcbTextSizeH=1.500000000000 14 | PcbTextThickness=0.300000000000 15 | ModuleTextSizeV=1.000000000000 16 | ModuleTextSizeH=1.000000000000 17 | ModuleTextSizeThickness=0.150000000000 18 | SolderMaskClearance=0.000000000000 19 | SolderMaskMinWidth=0.000000000000 20 | DrawSegmentWidth=0.200000000000 21 | BoardOutlineThickness=0.100000000000 22 | ModuleOutlineThickness=0.150000000000 23 | [cvpcb] 24 | version=1 25 | NetIExt=net 26 | [general] 27 | version=1 28 | [eeschema] 29 | version=1 30 | LibDir= 31 | [eeschema/libraries] 32 | LibName1=power 33 | LibName2=device 34 | LibName3=transistors 35 | LibName4=conn 36 | LibName5=linear 37 | LibName6=regul 38 | LibName7=74xx 39 | LibName8=cmos4000 40 | LibName9=adc-dac 41 | LibName10=memory 42 | LibName11=xilinx 43 | LibName12=microcontrollers 44 | LibName13=dsp 45 | LibName14=microchip 46 | LibName15=analog_switches 47 | LibName16=motorola 48 | LibName17=texas 49 | LibName18=intel 50 | LibName19=audio 51 | LibName20=interface 52 | LibName21=digital-audio 53 | LibName22=philips 54 | LibName23=display 55 | LibName24=cypress 56 | LibName25=siliconi 57 | LibName26=opto 58 | LibName27=atmel 59 | LibName28=contrib 60 | LibName29=valves 61 | LibName30=servo_8way 62 | LibName31=servo_10way 63 | LibName32=mechanical 64 | -------------------------------------------------------------------------------- /Electronics/BMS FrontEnd/OpenBMSFrontEnd.pro: -------------------------------------------------------------------------------- 1 | update=17/06/2017 9:30:24 PM 2 | version=1 3 | last_client=kicad 4 | [pcbnew] 5 | version=1 6 | LastNetListRead= 7 | UseCmpFile=1 8 | PadDrill=0.600000000000 9 | PadDrillOvalY=0.600000000000 10 | PadSizeH=1.500000000000 11 | PadSizeV=1.500000000000 12 | PcbTextSizeV=1.500000000000 13 | PcbTextSizeH=1.500000000000 14 | PcbTextThickness=0.300000000000 15 | ModuleTextSizeV=1.000000000000 16 | ModuleTextSizeH=1.000000000000 17 | ModuleTextSizeThickness=0.150000000000 18 | SolderMaskClearance=0.000000000000 19 | SolderMaskMinWidth=0.000000000000 20 | DrawSegmentWidth=0.200000000000 21 | BoardOutlineThickness=0.100000000000 22 | ModuleOutlineThickness=0.150000000000 23 | [cvpcb] 24 | version=1 25 | NetIExt=net 26 | [general] 27 | version=1 28 | [eeschema] 29 | version=1 30 | LibDir= 31 | [eeschema/libraries] 32 | LibName1=power 33 | LibName2=device 34 | LibName3=transistors 35 | LibName4=conn 36 | LibName5=linear 37 | LibName6=regul 38 | LibName7=74xx 39 | LibName8=cmos4000 40 | LibName9=adc-dac 41 | LibName10=memory 42 | LibName11=xilinx 43 | LibName12=microcontrollers 44 | LibName13=dsp 45 | LibName14=microchip 46 | LibName15=analog_switches 47 | LibName16=motorola 48 | LibName17=texas 49 | LibName18=intel 50 | LibName19=audio 51 | LibName20=interface 52 | LibName21=digital-audio 53 | LibName22=philips 54 | LibName23=display 55 | LibName24=cypress 56 | LibName25=siliconi 57 | LibName26=opto 58 | LibName27=atmel 59 | LibName28=contrib 60 | LibName29=valves 61 | LibName30=ISL94202 62 | LibName31=../openbmsriser 63 | LibName32=mechanical 64 | -------------------------------------------------------------------------------- /Electronics/Power Dist/Power Dist-cache.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | # 4 | # CONN_01X02 5 | # 6 | DEF CONN_01X02 J 0 40 Y N 1 F N 7 | F0 "J" 0 150 50 H V C CNN 8 | F1 "CONN_01X02" 100 0 50 V V C CNN 9 | F2 "" 0 0 50 H I C CNN 10 | F3 "" 0 0 50 H I C CNN 11 | $FPLIST 12 | Pin_Header_Straight_1X* 13 | Pin_Header_Angled_1X* 14 | Socket_Strip_Straight_1X* 15 | Socket_Strip_Angled_1X* 16 | $ENDFPLIST 17 | DRAW 18 | S -50 -45 10 -55 0 1 0 N 19 | S -50 55 10 45 0 1 0 N 20 | S -50 100 50 -100 0 1 0 N 21 | X P1 1 -200 50 150 R 50 50 1 1 P 22 | X P2 2 -200 -50 150 R 50 50 1 1 P 23 | ENDDRAW 24 | ENDDEF 25 | # 26 | # CONN_01X04 27 | # 28 | DEF CONN_01X04 J 0 40 Y N 1 F N 29 | F0 "J" 0 250 50 H V C CNN 30 | F1 "CONN_01X04" 100 0 50 V V C CNN 31 | F2 "" 0 0 50 H I C CNN 32 | F3 "" 0 0 50 H I C CNN 33 | $FPLIST 34 | Pin_Header_Straight_1X* 35 | Pin_Header_Angled_1X* 36 | Socket_Strip_Straight_1X* 37 | Socket_Strip_Angled_1X* 38 | $ENDFPLIST 39 | DRAW 40 | S -50 -145 10 -155 0 1 0 N 41 | S -50 -45 10 -55 0 1 0 N 42 | S -50 55 10 45 0 1 0 N 43 | S -50 155 10 145 0 1 0 N 44 | S -50 200 50 -200 0 1 0 N 45 | X P1 1 -200 150 150 R 50 50 1 1 P 46 | X P2 2 -200 50 150 R 50 50 1 1 P 47 | X P3 3 -200 -50 150 R 50 50 1 1 P 48 | X P4 4 -200 -150 150 R 50 50 1 1 P 49 | ENDDRAW 50 | ENDDEF 51 | # 52 | # Mounting_Hole 53 | # 54 | DEF Mounting_Hole MK 0 40 Y Y 1 F N 55 | F0 "MK" 0 200 50 H V C CNN 56 | F1 "Mounting_Hole" 0 125 50 H V C CNN 57 | F2 "" 0 0 50 H I C CNN 58 | F3 "" 0 0 50 H I C CNN 59 | $FPLIST 60 | Mounting?Hole* 61 | Hole* 62 | $ENDFPLIST 63 | DRAW 64 | C 0 0 50 0 1 50 N 65 | ENDDRAW 66 | ENDDEF 67 | # 68 | #End Library 69 | -------------------------------------------------------------------------------- /Electronics/BMSFootprints.pretty/JLX12864G.kicad_mod: -------------------------------------------------------------------------------- 1 | (module JLX12864G (layer F.Cu) (tedit 5946565A) 2 | (fp_text reference REF** (at 0 0.5) (layer F.SilkS) 3 | (effects (font (size 1 1) (thickness 0.15))) 4 | ) 5 | (fp_text value JLX12864G (at 0 -0.5) (layer F.Fab) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_line (start -22 21.5) (end -22 -21.5) (layer F.SilkS) (width 0.15)) 9 | (fp_line (start 22 21.5) (end -22 21.5) (layer F.SilkS) (width 0.15)) 10 | (fp_line (start 22 -21.5) (end 22 21.5) (layer F.SilkS) (width 0.15)) 11 | (fp_line (start -22 -21.5) (end 22 -21.5) (layer F.SilkS) (width 0.15)) 12 | (pad 1 thru_hole circle (at 14.224 -20) (size 1.6 1.6) (drill 0.9) (layers *.Cu *.Mask)) 13 | (pad 2 thru_hole circle (at 11.684 -20) (size 1.6 1.6) (drill 0.9) (layers *.Cu *.Mask)) 14 | (pad 3 thru_hole circle (at 9.144 -20) (size 1.6 1.6) (drill 0.9) (layers *.Cu *.Mask)) 15 | (pad 4 thru_hole circle (at 6.604 -20) (size 1.6 1.6) (drill 0.9) (layers *.Cu *.Mask)) 16 | (pad 5 thru_hole circle (at 4.064 -20) (size 1.6 1.6) (drill 0.9) (layers *.Cu *.Mask)) 17 | (pad 6 thru_hole circle (at 1.524 -20) (size 1.6 1.6) (drill 0.9) (layers *.Cu *.Mask)) 18 | (pad 7 thru_hole circle (at -1.016 -20) (size 1.6 1.6) (drill 0.9) (layers *.Cu *.Mask)) 19 | (pad 8 thru_hole circle (at -3.556 -20) (size 1.6 1.6) (drill 0.9) (layers *.Cu *.Mask)) 20 | (pad 9 thru_hole circle (at -6.096 -20) (size 1.6 1.6) (drill 0.9) (layers *.Cu *.Mask)) 21 | (pad 10 thru_hole circle (at -8.636 -20) (size 1.6 1.6) (drill 0.9) (layers *.Cu *.Mask)) 22 | (pad 11 thru_hole circle (at -11.176 -20) (size 1.6 1.6) (drill 0.9) (layers *.Cu *.Mask)) 23 | (pad 12 thru_hole circle (at -13.716 -20) (size 1.6 1.6) (drill 0.9) (layers *.Cu *.Mask)) 24 | ) 25 | -------------------------------------------------------------------------------- /Electronics/BMS FrontEnd/xt60.pretty/XT60.kicad_mod: -------------------------------------------------------------------------------- 1 | (module Library:XT60 (layer F.Cu) (tedit 572BCE8E) 2 | (fp_text reference REF** (at 3.556 6.096) (layer F.SilkS) 3 | (effects (font (size 1 1) (thickness 0.15))) 4 | ) 5 | (fp_text value XT60 (at 3.2 -5.9) (layer F.Fab) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_line (start 7.2 4) (end 11.9 4) (layer F.SilkS) (width 0.1)) 9 | (fp_line (start 11.9 4) (end 11.9 2.4) (layer F.SilkS) (width 0.1)) 10 | (fp_line (start 7.5 -4) (end 11.7 -4) (layer F.SilkS) (width 0.1)) 11 | (fp_line (start 11.7 -4) (end 11.8 -4) (layer F.SilkS) (width 0.1)) 12 | (fp_line (start 11.8 -4) (end 11.9 -4) (layer F.SilkS) (width 0.1)) 13 | (fp_line (start 11.9 -4) (end 11.9 0) (layer F.SilkS) (width 0.1)) 14 | (fp_line (start -2.4 4) (end -4.4 1.3) (layer F.SilkS) (width 0.1)) 15 | (fp_line (start -2.4 -4) (end -4.4 -1.3) (layer F.SilkS) (width 0.1)) 16 | (fp_line (start -4.4 0) (end -4.4 1.25) (layer F.SilkS) (width 0.1)) 17 | (fp_line (start -4.4 0) (end -4.4 -1.25) (layer F.SilkS) (width 0.1)) 18 | (fp_line (start 0 4) (end -2.4 4) (layer F.SilkS) (width 0.1)) 19 | (fp_line (start 3 4) (end 0 4) (layer F.SilkS) (width 0.1)) 20 | (fp_line (start 0 -4) (end -2.4 -4) (layer F.SilkS) (width 0.1)) 21 | (fp_line (start 3.1 -4) (end 0 -4) (layer F.SilkS) (width 0.1)) 22 | (fp_line (start -4.4 -0.1) (end -4.4 0.2) (layer F.SilkS) (width 0.1)) 23 | (fp_line (start 11.9 0) (end 11.9 2.4) (layer F.SilkS) (width 0.1)) 24 | (fp_line (start 7.5 -4) (end 3.1 -4) (layer F.SilkS) (width 0.1)) 25 | (fp_line (start 7.2 4) (end 3 4) (layer F.SilkS) (width 0.1)) 26 | (pad 1 thru_hole circle (at 0 0) (size 6 6) (drill 4.5) (layers *.Cu *.Mask F.SilkS)) 27 | (pad 2 thru_hole circle (at 7.5 0) (size 6 6) (drill 4.5) (layers *.Cu *.Mask F.SilkS)) 28 | ) 29 | -------------------------------------------------------------------------------- /Electronics/BMSFootprints.pretty/OpenBMSRiser.kicad_mod: -------------------------------------------------------------------------------- 1 | (module OpenBMSRiser (layer F.Cu) (tedit 59450A84) 2 | (fp_text reference REF** (at 0 -19) (layer F.SilkS) 3 | (effects (font (size 1 1) (thickness 0.15))) 4 | ) 5 | (fp_text value OpenBMSRiser (at 0 -21) (layer F.Fab) 6 | (effects (font (size 1 1) (thickness 0.15))) 7 | ) 8 | (fp_line (start 3 -24) (end 3 -22) (layer F.SilkS) (width 0.15)) 9 | (fp_line (start -3 -24) (end 3 -24) (layer F.SilkS) (width 0.15)) 10 | (fp_line (start -3 -22) (end -3 -24) (layer F.SilkS) (width 0.15)) 11 | (fp_line (start 3 -22) (end -3 -22) (layer F.SilkS) (width 0.15)) 12 | (fp_line (start -7 24) (end 7 24) (layer F.SilkS) (width 0.15)) 13 | (fp_line (start -7 22) (end -7 24) (layer F.SilkS) (width 0.15)) 14 | (fp_line (start 7 22) (end -7 22) (layer F.SilkS) (width 0.15)) 15 | (fp_line (start 7 24) (end 7 22) (layer F.SilkS) (width 0.15)) 16 | (fp_line (start -20 -25) (end 0 -25) (layer F.Fab) (width 0.15)) 17 | (fp_line (start -20 25) (end -20 -25) (layer F.Fab) (width 0.15)) 18 | (fp_line (start 20 25) (end -20 25) (layer F.Fab) (width 0.15)) 19 | (fp_line (start 20 -25) (end 20 25) (layer F.Fab) (width 0.15)) 20 | (fp_line (start 0 -25) (end 20 -25) (layer F.Fab) (width 0.15)) 21 | (pad 1 thru_hole circle (at 2 -23) (size 1.5 1.5) (drill 0.85) (layers *.Cu *.Mask)) 22 | (pad 1 thru_hole circle (at 0 -23) (size 1.5 1.5) (drill 0.85) (layers *.Cu *.Mask)) 23 | (pad 1 thru_hole circle (at -2 -23) (size 1.5 1.5) (drill 0.85) (layers *.Cu *.Mask)) 24 | (pad 4 thru_hole circle (at 0 23) (size 1.5 1.5) (drill 0.85) (layers *.Cu *.Mask)) 25 | (pad 5 thru_hole circle (at 2 23) (size 1.5 1.5) (drill 0.85) (layers *.Cu *.Mask)) 26 | (pad 3 thru_hole circle (at -2 23) (size 1.5 1.5) (drill 0.85) (layers *.Cu *.Mask)) 27 | (pad 2 thru_hole circle (at -4 23) (size 1.5 1.5) (drill 0.85) (layers *.Cu *.Mask)) 28 | (pad 6 thru_hole circle (at 4 23) (size 1.5 1.5) (drill 0.85) (layers *.Cu *.Mask)) 29 | (pad 7 thru_hole circle (at 6 23) (size 1.5 1.5) (drill 0.85) (layers *.Cu *.Mask)) 30 | (pad 1 thru_hole circle (at -6 23) (size 1.5 1.5) (drill 0.85) (layers *.Cu *.Mask)) 31 | ) 32 | -------------------------------------------------------------------------------- /Front Panel Code/OpenBMS/main.c: -------------------------------------------------------------------------------- 1 | #include "main.h" 2 | 3 | volatile uint32_t twoHzTimer = 0; 4 | int main(void) 5 | { 6 | WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer 7 | 8 | setup(); 9 | //__bis_SR_register(LPM4_bits | GIE); // Enter LPM4, interrupts enabled 10 | lcd_init(); 11 | lcd_setCursor(0, 0); 12 | lcd_print("Open BMS by Ralim\r\n"); 13 | TACTL = TASSEL_2 | ID_3 | MC_2 | TAIE; 14 | 15 | for (;;) 16 | { 17 | 18 | ISL94202_updateReadings(); //load in new I2C data 19 | volatile uint8_t i; // volatile to prevent optimization 20 | P4OUT = ISL94202_getBalancingCells();//light an led if that cell is being balanced 21 | for (i = 0; i < 8; i++) 22 | { 23 | lcd_setCursor((i%2)*64, i/2+2); 24 | lcd_drawVoltage(ISL94202_getCellVoltageMV(i)); 25 | } 26 | lcd_setCursor(0, 2); 27 | 28 | //we now have the voltages, print them to the lcd 29 | __bis_SR_register(LPM0_bits | GIE); // Enter LPM0, interrupts enabled 30 | //We will wakup here once per second to update the display 31 | 32 | } 33 | 34 | } 35 | 36 | #pragma vector=PORT2_VECTOR 37 | __interrupt void P2_IRQ(void) 38 | { 39 | P4OUT ^= (~P2IN) & (BUTT1 | BUTT2 | BUTT3); 40 | P2IFG &= ~(BUTT1 | BUTT2 | BUTT3); 41 | } 42 | 43 | // Timer_A3 Interrupt Vector (TAIV) handler 44 | #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__) 45 | #pragma vector=TIMER0_A1_VECTOR 46 | __interrupt void Timer_A(void) 47 | #elif defined(__GNUC__) 48 | void __attribute__ ((interrupt(TIMER0_A1_VECTOR))) Timer_A (void) 49 | #else 50 | #error Compiler not supported! 51 | #endif 52 | { 53 | switch (TAIV) 54 | // Efficient switch-implementation 55 | { 56 | case 2: 57 | break; // TACCR1 not used 58 | case 4: 59 | break; // TACCR2 not used 60 | case 10: 61 | { 62 | twoHzTimer++; // overflow 63 | if (twoHzTimer & 0x0001) 64 | { 65 | _BIC_SR(LPM0_EXIT); 66 | } 67 | } 68 | break; 69 | } 70 | } 71 | 72 | -------------------------------------------------------------------------------- /Electronics/BMS FrontEnd/ISL94202.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | # 4 | # ISL94202 5 | # 6 | DEF ISL94202 U 0 40 Y Y 1 F N 7 | F0 "U" 0 0 50 H V C CNN 8 | F1 "ISL94202" 0 350 50 H V C CNN 9 | F2 "MODULE" 0 150 50 H I C CNN 10 | F3 "DOCUMENTATION" 0 250 50 H I C CNN 11 | DRAW 12 | S 900 -750 -800 700 0 1 0 N 13 | X VC8 1 -1100 500 300 R 50 50 1 1 I 14 | X CB8 2 -1100 400 300 R 50 50 1 1 O 15 | X VC7 3 -1100 300 300 R 50 50 1 1 I 16 | X CB7 4 -1100 200 300 R 50 50 1 1 O 17 | X VC6 5 -1100 100 300 R 50 50 1 1 I 18 | X CB6 6 -1100 0 300 R 50 50 1 1 O 19 | X VC5 7 -1100 -100 300 R 50 50 1 1 I 20 | X CB5 8 -1100 -200 300 R 50 50 1 1 O 21 | X VC4 9 -1100 -300 300 R 50 50 1 1 I 22 | X CB4 10 -1100 -400 300 R 50 50 1 1 O 23 | X XT1 20 200 -1050 300 U 50 50 1 1 I 24 | X DNC2 30 1200 -100 300 L 50 50 1 1 I 25 | X C2 40 300 1000 300 D 50 50 1 1 I 26 | X VC3 11 -1100 -500 300 R 50 50 1 1 I 27 | X XT2 21 300 -1050 300 U 50 50 1 1 I 28 | X ~INT 31 1200 0 300 L 50 50 1 1 I 29 | X C1 41 200 1000 300 D 50 50 1 1 I 30 | X CB3 12 -1100 -600 300 R 50 50 1 1 O 31 | X TEMPO 22 400 -1050 300 U 50 50 1 1 I 32 | X PSD 32 1200 100 300 L 50 50 1 1 I 33 | X DFET 42 100 1000 300 D 50 50 1 1 I 34 | X VC2 13 -500 -1050 300 U 50 50 1 1 I 35 | X DNC1 23 500 -1050 300 U 50 50 1 1 I 36 | X FETSOFF 33 1200 200 300 L 50 50 1 1 I 37 | X VDD 43 0 1000 300 D 50 50 1 1 W 38 | X CB2 14 -400 -1050 300 U 50 50 1 1 O 39 | X ADDR 24 600 -1050 300 U 50 50 1 1 I 40 | X ~SD 34 1200 300 300 L 50 50 1 1 I 41 | X PCFET 44 -100 1000 300 D 50 50 1 1 I 42 | X VC1 15 -300 -1050 300 U 50 50 1 1 I 43 | X SCL 25 1200 -600 300 L 50 50 1 1 O 44 | X ~EOC 35 1200 400 300 L 50 50 1 1 I 45 | X CFET 45 -200 1000 300 D 50 50 1 1 I 46 | X CB1 16 -200 -1050 300 U 50 50 1 1 O 47 | X SDAI 26 1200 -500 300 L 50 50 1 1 I 48 | X RGO 36 1200 500 300 L 50 50 1 1 I 49 | X CSI2 46 -300 1000 300 D 50 50 1 1 I 50 | X VC0 17 -100 -1050 300 U 50 50 1 1 I 51 | X SDAO 27 1200 -400 300 L 50 50 1 1 O 52 | X CHMON 37 600 1000 300 D 50 50 1 1 I 53 | X CSI1 47 -400 1000 300 D 50 50 1 1 I 54 | X VSS 18 0 -1050 300 U 50 50 1 1 W 55 | X VSS 28 1200 -300 300 L 50 50 1 1 W 56 | X LDMON 38 500 1000 300 D 50 50 1 1 I 57 | X VBATT 48 -500 1000 300 D 50 50 1 1 I 58 | X VREF 19 100 -1050 300 U 50 50 1 1 w 59 | X VSS 29 1200 -200 300 L 50 50 1 1 W 60 | X C3 39 400 1000 300 D 50 50 1 1 I 61 | X PAD 49 1100 -700 200 L 50 50 1 1 I 62 | ENDDRAW 63 | ENDDEF 64 | # 65 | #End Library 66 | -------------------------------------------------------------------------------- /Front Panel Code/OpenBMS/ISL94202.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ISL94202.h 3 | * 4 | * Created on: 12 June ,2017 5 | * Author: Ben V. Brown 6 | * 7 | * Driver for the ISL94202 BMS IC 8 | * Uses i2c.* for handling the I2C communications 9 | * 10 | * Provides access to both live readings and also the ability to change settings on the unit 11 | * 12 | */ 13 | 14 | #ifndef ISL94202_H_ 15 | #define ISL94202_H_ 16 | #include 17 | #include "hardware.h" 18 | #include "i2c.h" 19 | #define ISLADDRESS 0x28 20 | //Update the cell voltage and current readings from the unit 21 | void ISL94202_updateReadings(); 22 | //Updates the buffer of the status registers 23 | void ISL94202_updateStatus(); 24 | 25 | //returns the voltage measured at that cells input in millivolts 26 | uint16_t ISL94202_getCellVoltageMV(uint8_t index); 27 | 28 | //Returns the pack current in milliamps 29 | uint16_t ISL94202_getPackCurrentMA(); 30 | 31 | //Returns a bitmask of the currently balancing cells 32 | uint8_t ISL94202_getBalancingCells(); 33 | 34 | /////////////////////////////////// SETTINGS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ 35 | 36 | //Thresholds and releases 37 | void ISL94202_setOVLockout(uint16_t mV); 38 | void ISL94202_setOVThres(uint16_t mV); 39 | void ISL94202_setOVRecovery(uint16_t mV); 40 | void ISL94202_setUVThres(uint16_t mV); 41 | void ISL94202_setUVRecovery(uint16_t mV); 42 | void ISL94202_setUVLockout(uint16_t mV); 43 | void ISL94202_setEOCThreshold(uint16_t mV); 44 | 45 | //Current Settings 46 | void ISL94202_setDischargeOC(uint8_t mV, uint16_t time, uint8_t timeBase); 47 | void ISL94202_setChargeOC(uint8_t mV, uint16_t time, uint8_t timeBase); 48 | void ISL94202_setShortCircuit(uint8_t mV, uint16_t time, uint8_t timeBase); 49 | 50 | //Cell Balancing 51 | void ISL94202_setCellBalanceTimes(uint8_t onTime, uint8_t offTime, 52 | uint8_t timeBase); 53 | void ISL94202_setCellCountSleepTimes(uint8_t cellCount, uint8_t idleSleep, 54 | uint8_t deepsleep); 55 | void ISL94202_setCellBalanceDifference(uint16_t mV); 56 | void ISL94202_setCellBalanceStartV(uint16_t mV); 57 | void ISL94202_setCellBalanceStopV(uint16_t mV); 58 | void ISL94202_setCellBalanceFaultLevel(uint16_t mV); 59 | 60 | //Chip Features Control 61 | void ISL94202_setFeature1(bool CellFActivatesPSD, bool XT2Mode, bool TGain, 62 | bool PreChargeFETEnabled, bool disableOpenWireScan, 63 | bool OpenWireSetsPSD); 64 | 65 | void ISL94202_setFeature2(bool CellBalanceDuringDischarge, 66 | bool CellbalanceDuringCharge, 67 | bool keepDFETonDuringCharge, bool keepCFETonDuringDischarge, 68 | bool shutdownOnUVLO, bool enableBalanceAtEOC); 69 | 70 | //////////////////////// EEPROM \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ 71 | 72 | void ISL94202_writeUserEEPROM(uint8_t address, uint8_t value); 73 | uint8_t ISL94202_readUserEEPROM(uint8_t address); 74 | 75 | //////////////////////// I2C Support \\\\\\\\\\\\\\\\\\\\\\\\\\\\\ 76 | 77 | void ISL94202_writeEEPROM(uint8_t reg, uint8_t value); 78 | void ISL94202_writeEEPROMWord(uint8_t reg, uint16_t value); 79 | void ISL94202_writeEEPROMVoltage(uint8_t add, uint16_t mV, 80 | uint8_t headerFourBits); 81 | void ISL94202_writeEEPROMTimeout(uint8_t add, uint16_t timeout, 82 | uint8_t timeScale, 83 | uint8_t headerFourBits); 84 | #endif /* ISL94202_H_ */ 85 | -------------------------------------------------------------------------------- /Front Panel Code/OpenBMS/i2c.c: -------------------------------------------------------------------------------- 1 | /* 2 | * i2c.c 3 | * 4 | * Created on: 11Jun.,2017 5 | * Author: Ben V. Brown 6 | */ 7 | 8 | #include "i2c.h" 9 | 10 | //Setup the hardware for I2C communications 11 | void setup_I2C() 12 | { 13 | 14 | } 15 | uint8_t I2C_readReg8(uint8_t slave, uint8_t add) 16 | { 17 | uint8_t ret = 0; 18 | TI_USCI_I2C_transmitinit(slave, PRESCALER); // init transmitting with USCI 19 | while (TI_USCI_I2C_notready()) 20 | ; // wait for bus to be free 21 | // initialization 22 | while (TI_USCI_I2C_notready()) 23 | ; // wait for bus to be free 24 | TI_USCI_I2C_transmit(1, &add); // start transmitting 25 | while (TI_USCI_I2C_notready()) 26 | ; // wait for bus to be free 27 | 28 | TI_USCI_I2C_receiveinit(slave, PRESCALER); // init receiving with USCI 29 | while (TI_USCI_I2C_notready()) 30 | ; // wait for bus to be free 31 | TI_USCI_I2C_receive(1, &ret); 32 | while (TI_USCI_I2C_notready()) 33 | ; // wait for bus to be free 34 | 35 | return ret; 36 | } 37 | 38 | uint16_t I2C_readReg16(uint8_t slave, uint8_t add) 39 | { 40 | uint16_t ret = 0; 41 | TI_USCI_I2C_transmitinit(slave, PRESCALER); // init transmitting with USCI 42 | while (TI_USCI_I2C_notready()) 43 | ; // wait for bus to be free 44 | // initialization 45 | while (TI_USCI_I2C_notready()) 46 | ; // wait for bus to be free 47 | TI_USCI_I2C_transmit(1, &add); // start transmitting 48 | while (TI_USCI_I2C_notready()) 49 | ; // wait for bus to be free 50 | 51 | TI_USCI_I2C_receiveinit(slave, PRESCALER); // init receiving with USCI 52 | while (TI_USCI_I2C_notready()) 53 | ; // wait for bus to be free 54 | TI_USCI_I2C_receive(2, &ret); 55 | while (TI_USCI_I2C_notready()) 56 | ; // wait for bus to be free 57 | 58 | return ret; 59 | } 60 | void I2C_readMany(uint8_t slave, uint8_t add, uint8_t count, uint8_t* buffer) 61 | { 62 | uint16_t ret = 0; 63 | TI_USCI_I2C_transmitinit(slave, PRESCALER); // init transmitting with USCI 64 | while (TI_USCI_I2C_notready()) 65 | ; // wait for bus to be free 66 | // initialization 67 | while (TI_USCI_I2C_notready()) 68 | ; // wait for bus to be free 69 | TI_USCI_I2C_transmit(1, &add); // start transmitting 70 | while (TI_USCI_I2C_notready()) 71 | ; // wait for bus to be free 72 | 73 | TI_USCI_I2C_receiveinit(slave, PRESCALER); // init receiving with USCI 74 | while (TI_USCI_I2C_notready()) 75 | ; // wait for bus to be free 76 | TI_USCI_I2C_receive(count, buffer); 77 | while (TI_USCI_I2C_notready()) 78 | ; // wait for bus to be free 79 | 80 | } 81 | 82 | void I2C_writeReg8(uint8_t slave, uint8_t add, uint8_t data) 83 | { 84 | TI_USCI_I2C_transmitinit(slave, PRESCALER); // init transmitting with USCI 85 | while (TI_USCI_I2C_notready()) 86 | ; // wait for bus to be free 87 | // initialization 88 | while (TI_USCI_I2C_notready()) 89 | ; // wait for bus to be free 90 | TI_USCI_I2C_transmit(1, &add); // start transmitting 91 | while (TI_USCI_I2C_notready()) 92 | ; // wait for bus to be free 93 | TI_USCI_I2C_transmit(1, &data); // start transmitting 94 | 95 | } 96 | void I2C_writeReg16(uint8_t slave, uint8_t add, uint16_t data) 97 | { 98 | TI_USCI_I2C_transmitinit(slave, PRESCALER); // init transmitting with USCI 99 | while (TI_USCI_I2C_notready()) 100 | ; // wait for bus to be free 101 | // initialization 102 | while (TI_USCI_I2C_notready()) 103 | ; // wait for bus to be free 104 | TI_USCI_I2C_transmit(1, &add); // start transmitting 105 | while (TI_USCI_I2C_notready()) 106 | ; // wait for bus to be free 107 | TI_USCI_I2C_transmit(2, &data); // start transmitting 108 | 109 | } 110 | -------------------------------------------------------------------------------- /Front Panel Code/OpenBMS/font.h: -------------------------------------------------------------------------------- 1 | /* 2 | * font.h 3 | * 4 | * Created on: 26Aug.,2017 5 | * Author: ralim 6 | */ 7 | 8 | #ifndef FONT_H_ 9 | #define FONT_H_ 10 | 11 | 12 | 13 | // The 7-bit ASCII character set... 14 | const unsigned char charset[][5] = { 15 | { 0x00, 0x00, 0x00, 0x00, 0x00 }, // 20 space 16 | { 0x00, 0x00, 0x5f, 0x00, 0x00 }, // 21 ! 17 | { 0x00, 0x07, 0x00, 0x07, 0x00 }, // 22 " 18 | { 0x14, 0x7f, 0x14, 0x7f, 0x14 }, // 23 # 19 | { 0x24, 0x2a, 0x7f, 0x2a, 0x12 }, // 24 $ 20 | { 0x23, 0x13, 0x08, 0x64, 0x62 }, // 25 % 21 | { 0x36, 0x49, 0x55, 0x22, 0x50 }, // 26 & 22 | { 0x00, 0x05, 0x03, 0x00, 0x00 }, // 27 ' 23 | { 0x00, 0x1c, 0x22, 0x41, 0x00 }, // 28 ( 24 | { 0x00, 0x41, 0x22, 0x1c, 0x00 }, // 29 ) 25 | { 0x14, 0x08, 0x3e, 0x08, 0x14 }, // 2a * 26 | { 0x08, 0x08, 0x3e, 0x08, 0x08 }, // 2b + 27 | { 0x00, 0x50, 0x30, 0x00, 0x00 }, // 2c , 28 | { 0x08, 0x08, 0x08, 0x08, 0x08 }, // 2d - 29 | { 0x00, 0x60, 0x60, 0x00, 0x00 }, // 2e . 30 | { 0x20, 0x10, 0x08, 0x04, 0x02 }, // 2f / 31 | { 0x3e, 0x51, 0x49, 0x45, 0x3e }, // 30 0 32 | { 0x00, 0x42, 0x7f, 0x40, 0x00 }, // 31 1 33 | { 0x42, 0x61, 0x51, 0x49, 0x46 }, // 32 2 34 | { 0x21, 0x41, 0x45, 0x4b, 0x31 }, // 33 3 35 | { 0x18, 0x14, 0x12, 0x7f, 0x10 }, // 34 4 36 | { 0x27, 0x45, 0x45, 0x45, 0x39 }, // 35 5 37 | { 0x3c, 0x4a, 0x49, 0x49, 0x30 }, // 36 6 38 | { 0x01, 0x71, 0x09, 0x05, 0x03 }, // 37 7 39 | { 0x36, 0x49, 0x49, 0x49, 0x36 }, // 38 8 40 | { 0x06, 0x49, 0x49, 0x29, 0x1e }, // 39 9 41 | { 0x00, 0x36, 0x36, 0x00, 0x00 }, // 3a : 42 | { 0x00, 0x56, 0x36, 0x00, 0x00 }, // 3b ; 43 | { 0x08, 0x14, 0x22, 0x41, 0x00 }, // 3c < 44 | { 0x14, 0x14, 0x14, 0x14, 0x14 }, // 3d = 45 | { 0x00, 0x41, 0x22, 0x14, 0x08 }, // 3e > 46 | { 0x02, 0x01, 0x51, 0x09, 0x06 }, // 3f ? 47 | { 0x32, 0x49, 0x79, 0x41, 0x3e }, // 40 @ 48 | { 0x7e, 0x11, 0x11, 0x11, 0x7e }, // 41 A 49 | { 0x7f, 0x49, 0x49, 0x49, 0x36 }, // 42 B 50 | { 0x3e, 0x41, 0x41, 0x41, 0x22 }, // 43 C 51 | { 0x7f, 0x41, 0x41, 0x22, 0x1c }, // 44 D 52 | { 0x7f, 0x49, 0x49, 0x49, 0x41 }, // 45 E 53 | { 0x7f, 0x09, 0x09, 0x09, 0x01 }, // 46 F 54 | { 0x3e, 0x41, 0x49, 0x49, 0x7a }, // 47 G 55 | { 0x7f, 0x08, 0x08, 0x08, 0x7f }, // 48 H 56 | { 0x00, 0x41, 0x7f, 0x41, 0x00 }, // 49 I 57 | { 0x20, 0x40, 0x41, 0x3f, 0x01 }, // 4a J 58 | { 0x7f, 0x08, 0x14, 0x22, 0x41 }, // 4b K 59 | { 0x7f, 0x40, 0x40, 0x40, 0x40 }, // 4c L 60 | { 0x7f, 0x02, 0x0c, 0x02, 0x7f }, // 4d M 61 | { 0x7f, 0x04, 0x08, 0x10, 0x7f }, // 4e N 62 | { 0x3e, 0x41, 0x41, 0x41, 0x3e }, // 4f O 63 | { 0x7f, 0x09, 0x09, 0x09, 0x06 }, // 50 P 64 | { 0x3e, 0x41, 0x51, 0x21, 0x5e }, // 51 Q 65 | { 0x7f, 0x09, 0x19, 0x29, 0x46 }, // 52 R 66 | { 0x46, 0x49, 0x49, 0x49, 0x31 }, // 53 S 67 | { 0x01, 0x01, 0x7f, 0x01, 0x01 }, // 54 T 68 | { 0x3f, 0x40, 0x40, 0x40, 0x3f }, // 55 U 69 | { 0x1f, 0x20, 0x40, 0x20, 0x1f }, // 56 V 70 | { 0x3f, 0x40, 0x38, 0x40, 0x3f }, // 57 W 71 | { 0x63, 0x14, 0x08, 0x14, 0x63 }, // 58 X 72 | { 0x07, 0x08, 0x70, 0x08, 0x07 }, // 59 Y 73 | { 0x61, 0x51, 0x49, 0x45, 0x43 }, // 5a Z 74 | { 0x00, 0x7f, 0x41, 0x41, 0x00 }, // 5b [ 75 | { 0x02, 0x04, 0x08, 0x10, 0x20 }, // 5c backslash 76 | { 0x00, 0x41, 0x41, 0x7f, 0x00 }, // 5d ] 77 | { 0x04, 0x02, 0x01, 0x02, 0x04 }, // 5e ^ 78 | { 0x40, 0x40, 0x40, 0x40, 0x40 }, // 5f _ 79 | { 0x00, 0x01, 0x02, 0x04, 0x00 }, // 60 ` 80 | { 0x20, 0x54, 0x54, 0x54, 0x78 }, // 61 a 81 | { 0x7f, 0x48, 0x44, 0x44, 0x38 }, // 62 b 82 | { 0x38, 0x44, 0x44, 0x44, 0x20 }, // 63 c 83 | { 0x38, 0x44, 0x44, 0x48, 0x7f }, // 64 d 84 | { 0x38, 0x54, 0x54, 0x54, 0x18 }, // 65 e 85 | { 0x08, 0x7e, 0x09, 0x01, 0x02 }, // 66 f 86 | { 0x0c, 0x52, 0x52, 0x52, 0x3e }, // 67 g 87 | { 0x7f, 0x08, 0x04, 0x04, 0x78 }, // 68 h 88 | { 0x00, 0x44, 0x7d, 0x40, 0x00 }, // 69 i 89 | { 0x20, 0x40, 0x44, 0x3d, 0x00 }, // 6a j 90 | { 0x7f, 0x10, 0x28, 0x44, 0x00 }, // 6b k 91 | { 0x00, 0x41, 0x7f, 0x40, 0x00 }, // 6c l 92 | { 0x7c, 0x04, 0x18, 0x04, 0x78 }, // 6d m 93 | { 0x7c, 0x08, 0x04, 0x04, 0x78 }, // 6e n 94 | { 0x38, 0x44, 0x44, 0x44, 0x38 }, // 6f o 95 | { 0x7c, 0x14, 0x14, 0x14, 0x08 }, // 70 p 96 | { 0x08, 0x14, 0x14, 0x18, 0x7c }, // 71 q 97 | { 0x7c, 0x08, 0x04, 0x04, 0x08 }, // 72 r 98 | { 0x48, 0x54, 0x54, 0x54, 0x20 }, // 73 s 99 | { 0x04, 0x3f, 0x44, 0x40, 0x20 }, // 74 t 100 | { 0x3c, 0x40, 0x40, 0x20, 0x7c }, // 75 u 101 | { 0x1c, 0x20, 0x40, 0x20, 0x1c }, // 76 v 102 | { 0x3c, 0x40, 0x30, 0x40, 0x3c }, // 77 w 103 | { 0x44, 0x28, 0x10, 0x28, 0x44 }, // 78 x 104 | { 0x0c, 0x50, 0x50, 0x50, 0x3c }, // 79 y 105 | { 0x44, 0x64, 0x54, 0x4c, 0x44 }, // 7a z 106 | { 0x00, 0x08, 0x36, 0x41, 0x00 }, // 7b { 107 | { 0x00, 0x00, 0x7f, 0x00, 0x00 }, // 7c | 108 | { 0x00, 0x41, 0x36, 0x08, 0x00 }, // 7d } 109 | { 0x10, 0x08, 0x08, 0x10, 0x08 }, // 7e ~ 110 | { 0x00, 0x00, 0x00, 0x00, 0x00 } // 7f 111 | }; 112 | 113 | 114 | #endif /* FONT_H_ */ 115 | -------------------------------------------------------------------------------- /Front Panel Code/OpenBMS/UC1701.c: -------------------------------------------------------------------------------- 1 | /* 2 | * UC1701.c 3 | * 4 | * Created on: 26Aug.,2017 5 | * Author: ralim 6 | */ 7 | #include "UC1701.h" 8 | #include "font.h" 9 | uint8_t lcd_column, lcd_line; 10 | const uint8_t lcd_height = 64; 11 | const uint8_t lcd_width = 128; 12 | void lcd_init() 13 | { 14 | SPI_init(); 15 | LCD_CS_HIGH(); 16 | LCD_CD_HIGH(); 17 | // Set the LCD parameters... 18 | lcd_sendCommand(0xE2); //System Reset 19 | lcd_sendCommand(0x40); // Set display start line to 0 20 | lcd_sendCommand(0xA1); //Set SEG Direction 21 | lcd_sendCommand(0xC0); //Set COM Direction 22 | lcd_sendCommand(0xA2); //Set Bias = 1/9 23 | lcd_sendCommand(0x2C); //Boost ON 24 | lcd_sendCommand(0x2E); //Voltage Regular On 25 | lcd_sendCommand(0x2F); //Voltage Follower On 26 | lcd_sendCommand(0xF8); //Set booster ratio to 27 | lcd_sendCommand(0x00); //4x 28 | lcd_sendCommand(0x23); //Set Resistor Ratio = 3 29 | lcd_sendCommand(0x81); 30 | lcd_sendCommand(50); //Set Electronic Volume = 40 31 | lcd_sendCommand(0xAC); //Set Static indicator off 32 | lcd_sendCommand(0x00); 33 | lcd_sendCommand(0XA6); // Disable inverse 34 | lcd_sendCommand(0xAF); //Set Display Enable 35 | __delay_cycles(100000); 36 | lcd_sendCommand(0xA5); //display all points 37 | __delay_cycles(100000); 38 | __delay_cycles(100000); 39 | lcd_sendCommand(0xA4); //normal display 40 | 41 | lcd_clear(); 42 | } 43 | 44 | void lcd_setCursor(uint8_t column, uint8_t line) 45 | { 46 | uint8_t i, j; 47 | column = column + 4; 48 | lcd_column = column; 49 | lcd_line = line; 50 | 51 | i = (column & 0xF0) >> 4; 52 | j = column & 0x0F; 53 | 54 | lcd_sendCommand(0xb0 + line); 55 | lcd_sendCommand(0x10 + i); 56 | lcd_sendCommand(j); 57 | } 58 | 59 | void lcddrawColumn(unsigned char lines, unsigned char value) 60 | { 61 | unsigned char scolumn = lcd_column; 62 | unsigned char sline = lcd_line; 63 | 64 | // Keep "value" within range... 65 | if (value > lines * 8) 66 | { 67 | value = lines * 8; 68 | } 69 | 70 | // Find the line where "value" resides... 71 | unsigned char mark = (lines * 8 - 1 - value) / 8; 72 | 73 | // Clear the lines above the mark... 74 | for (unsigned char line = 0; line < mark; line++) 75 | { 76 | lcd_setCursor(scolumn, sline + line); 77 | lcd_sendData(0x00); 78 | } 79 | 80 | // Compute the byte to draw at the "mark" line... 81 | unsigned char b = 0xff; 82 | for (unsigned char i = 0; i < lines * 8 - mark * 8 - value; i++) 83 | { 84 | b <<= 1; 85 | } 86 | 87 | lcd_setCursor(scolumn, sline + mark); 88 | lcd_sendData(b); 89 | 90 | // Fill the lines below the mark... 91 | for (unsigned char line = mark + 1; line < lines; line++) 92 | { 93 | lcd_setCursor(scolumn, sline + line); 94 | lcd_sendData(0xff); 95 | } 96 | 97 | // Leave the cursor in a consistent position... 98 | lcd_setCursor(scolumn + 1, sline); 99 | } 100 | void lcd_clear() 101 | { 102 | uint8_t i, j; 103 | for (j = 0; j < 8; j++) 104 | { 105 | lcd_setCursor(0, j); 106 | for (i = 0; i < 132; i++) 107 | { 108 | lcd_sendData(0x00); 109 | } 110 | } 111 | 112 | lcd_setCursor(0, 0); 113 | } 114 | 115 | void lcd_sendData(uint8_t d) 116 | { 117 | LCD_CS_LOW(); 118 | LCD_CD_HIGH(); 119 | SPI_tx(d); 120 | //LCD_CS_HIGH(); 121 | 122 | } 123 | void lcd_sendCommand(uint8_t d) 124 | { 125 | LCD_CS_LOW(); 126 | LCD_CD_LOW(); 127 | SPI_tx(d); 128 | //LCD_CS_HIGH(); 129 | } 130 | void lcd_printChar(char chr) 131 | { 132 | // ASCII 7-bit only... 133 | if (chr >= 0x80) 134 | { 135 | return; 136 | } 137 | if (chr == '\r') 138 | { 139 | lcd_setCursor(0, lcd_line); 140 | return; 141 | } 142 | else if (chr == '\n') 143 | { 144 | lcd_setCursor(lcd_column, lcd_line + 1); 145 | return; 146 | } 147 | // Output one column at a time... 148 | for (unsigned char i = 0; i < 5; i++) 149 | { 150 | lcd_sendData(charset[chr - ' '][i]); 151 | } 152 | 153 | // One column between characters... 154 | lcd_sendData(0x00); 155 | 156 | // Update the cursor position... 157 | lcd_column = (lcd_column + 6) % lcd_width; 158 | 159 | if (lcd_column == 0) 160 | { 161 | lcd_line = (lcd_line + 1) % (lcd_height / 9 + 1); 162 | } 163 | 164 | } 165 | void lcd_print(char* string) 166 | { 167 | while (string[0]) 168 | { 169 | lcd_printChar(string[0]); 170 | string++; 171 | } 172 | } 173 | 174 | void lcd_drawNumber(uint16_t number, uint8_t places) 175 | { 176 | 177 | } 178 | void lcd_drawVoltage(uint16_t mV) 179 | { 180 | //We want to draw in a voltage that can be 0mV to 65V. 181 | //We use fixed placements for everything, and just suppress the first leading zero 182 | char buffer[7]; 183 | buffer[2] = '.'; 184 | buffer[6] = 'V'; 185 | buffer[5] = '0' + mV % 10; 186 | mV /= 10; 187 | buffer[4] = '0' + mV % 10; 188 | mV /= 10; 189 | buffer[3] = '0' + mV % 10; 190 | mV /= 10; 191 | buffer[1] = '0' + mV % 10; 192 | mV /= 10; 193 | buffer[0] = mV ? '0' + mV % 10 : ' '; 194 | lcd_printChar(buffer[0]); 195 | lcd_printChar(buffer[1]); 196 | lcd_printChar(buffer[2]); 197 | lcd_printChar(buffer[3]); 198 | lcd_printChar(buffer[4]); 199 | lcd_printChar(buffer[5]); 200 | lcd_printChar(buffer[6]); 201 | 202 | } 203 | -------------------------------------------------------------------------------- /Electronics/BMS GUI/Front Panel-cache.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | # 4 | # C 5 | # 6 | DEF C C 0 10 N Y 1 F N 7 | F0 "C" 25 100 50 H V L CNN 8 | F1 "C" 25 -100 50 H V L CNN 9 | F2 "" 38 -150 50 H I C CNN 10 | F3 "" 0 0 50 H I C CNN 11 | $FPLIST 12 | C_* 13 | $ENDFPLIST 14 | DRAW 15 | P 2 0 1 20 -80 -30 80 -30 N 16 | P 2 0 1 20 -80 30 80 30 N 17 | X ~ 1 0 150 110 D 50 50 1 1 P 18 | X ~ 2 0 -150 110 U 50 50 1 1 P 19 | ENDDRAW 20 | ENDDEF 21 | # 22 | # CONN_01X03 23 | # 24 | DEF CONN_01X03 J 0 40 Y N 1 F N 25 | F0 "J" 0 200 50 H V C CNN 26 | F1 "CONN_01X03" 100 0 50 V V C CNN 27 | F2 "" 0 0 50 H I C CNN 28 | F3 "" 0 0 50 H I C CNN 29 | $FPLIST 30 | Pin_Header_Straight_1X* 31 | Pin_Header_Angled_1X* 32 | Socket_Strip_Straight_1X* 33 | Socket_Strip_Angled_1X* 34 | $ENDFPLIST 35 | DRAW 36 | S -50 -95 10 -105 0 1 0 N 37 | S -50 5 10 -5 0 1 0 N 38 | S -50 105 10 95 0 1 0 N 39 | S -50 150 50 -150 0 1 0 N 40 | X P1 1 -200 100 150 R 50 50 1 1 P 41 | X P2 2 -200 0 150 R 50 50 1 1 P 42 | X P3 3 -200 -100 150 R 50 50 1 1 P 43 | ENDDRAW 44 | ENDDEF 45 | # 46 | # GND 47 | # 48 | DEF GND #PWR 0 0 Y Y 1 F P 49 | F0 "#PWR" 0 -250 50 H I C CNN 50 | F1 "GND" 0 -150 50 H V C CNN 51 | F2 "" 0 0 50 H I C CNN 52 | F3 "" 0 0 50 H I C CNN 53 | DRAW 54 | P 6 0 1 0 0 0 0 -50 50 -50 0 -100 -50 -50 0 -50 N 55 | X GND 1 0 0 0 D 50 50 1 1 W N 56 | ENDDRAW 57 | ENDDEF 58 | # 59 | # JLX12864G 60 | # 61 | DEF JLX12864G U 0 40 Y Y 1 F N 62 | F0 "U" 0 750 60 H V C CNN 63 | F1 "JLX12864G" 0 850 60 H V C CNN 64 | F2 "" 0 700 60 H I C CNN 65 | F3 "" 0 700 60 H I C CNN 66 | DRAW 67 | S -350 900 350 -700 0 1 0 N 68 | X ROM_IN 1 -550 550 200 R 50 50 1 1 I 69 | X ROM_OUT 2 -550 450 200 R 50 50 1 1 I 70 | X ROM_SCK 3 -550 350 200 R 50 50 1 1 I 71 | X ROM_CS 4 -550 250 200 R 50 50 1 1 I 72 | X LEDA 5 -550 150 200 R 50 50 1 1 I 73 | X VSS 6 -550 50 200 R 50 50 1 1 I 74 | X VDD 7 -550 -50 200 R 50 50 1 1 I 75 | X SCLK 8 -550 -150 200 R 50 50 1 1 I 76 | X SDA 9 -550 -250 200 R 50 50 1 1 I 77 | X RS 10 -550 -350 200 R 50 50 1 1 I 78 | X ~RESET 11 -550 -450 200 R 50 50 1 1 I 79 | X ~CS 12 -550 -550 200 R 50 50 1 1 I 80 | ENDDRAW 81 | ENDDEF 82 | # 83 | # LED 84 | # 85 | DEF LED D 0 40 Y N 1 F N 86 | F0 "D" 0 100 50 H V C CNN 87 | F1 "LED" 0 -100 50 H V C CNN 88 | F2 "" 0 0 50 H I C CNN 89 | F3 "" 0 0 50 H I C CNN 90 | $FPLIST 91 | LED* 92 | $ENDFPLIST 93 | DRAW 94 | P 2 0 1 8 -50 -50 -50 50 N 95 | P 2 0 1 0 -50 0 50 0 N 96 | P 4 0 1 8 50 -50 50 50 -50 0 50 -50 N 97 | P 5 0 1 0 -120 -30 -180 -90 -150 -90 -180 -90 -180 -60 N 98 | P 5 0 1 0 -70 -30 -130 -90 -100 -90 -130 -90 -130 -60 N 99 | X K 1 -150 0 100 R 50 50 1 1 P 100 | X A 2 150 0 100 L 50 50 1 1 P 101 | ENDDRAW 102 | ENDDEF 103 | # 104 | # MSP430G2755IDA38 105 | # 106 | DEF MSP430G2755IDA38 U 0 40 Y Y 1 F N 107 | F0 "U" -950 1000 50 H V C CNN 108 | F1 "MSP430G2755IDA38" 700 -1000 50 H V C CNN 109 | F2 "DA38" -900 -1000 50 H I C CIN 110 | F3 "" 0 0 50 H I C CNN 111 | ALIAS MSP430G2855IDA38 MSP430G2955IDA38 112 | DRAW 113 | S -1000 950 1000 -950 0 1 10 f 114 | X SBWTCK/TEST 1 1150 850 150 L 40 40 1 1 I 115 | X DVCC 2 200 1100 150 D 40 40 1 1 W 116 | X TA1.0/ROSC/P2.5 3 1150 -650 150 L 40 40 1 1 B 117 | X DVSS 4 200 -1100 150 U 40 40 1 1 W 118 | X XOUT/P2.7 5 1150 -850 150 L 40 40 1 1 B 119 | X XIN/P2.6 6 1150 -750 150 L 40 40 1 1 B 120 | X ~RST~/NMI/SBWTDIO 7 -1150 850 150 R 40 40 1 1 I 121 | X TA1CLK/ACLK/A0/P2.0 8 1150 -150 150 L 40 40 1 1 B 122 | X TA0INCLK/SMCLK/A1/P2.1 9 1150 -250 150 L 40 40 1 1 B 123 | X TA0.0/A2/P2.2 10 1150 -350 150 L 40 40 1 1 B 124 | X P4.3/A12/CA3/TB0.0 20 -1150 400 150 R 40 40 1 1 B 125 | X TA0.2/VREF+/VeREF+/A4/P2.4 30 1150 -550 150 L 40 40 1 1 B 126 | X P3.0/A5/UCB0STE/UCA0CLK 11 -1150 -150 150 R 40 40 1 1 B 127 | X P4.4/A13/CA4/TB0.1 21 -1150 300 150 R 40 40 1 1 B 128 | X TA0CLK/ADC10CLK/P1.0 31 1150 700 150 L 40 40 1 1 B 129 | X P3.1/UCB0SIMO/UCB0SDA 12 -1150 -250 150 R 40 40 1 1 B 130 | X P4.5/A14/CA5/TB0.2 22 -1150 200 150 R 40 40 1 1 B 131 | X TA0.0/P1.1 32 1150 600 150 L 40 40 1 1 B 132 | X P3.2/UCB0SOMI/UCB0SCL 13 -1150 -350 150 R 40 40 1 1 B 133 | X P4.6/A15/CA6/TB0OUTH 23 -1150 100 150 R 40 40 1 1 B 134 | X TA0.1/P1.2 33 1150 500 150 L 40 40 1 1 B 135 | X P3.3/UCB0CLK/UCA0STE 14 -1150 -450 150 R 40 40 1 1 B 136 | X P4.7/CA7/TB0CLK 24 -1150 0 150 R 40 40 1 1 B 137 | X TA0.2/P1.3 34 1150 400 150 L 40 40 1 1 B 138 | X AVSS 15 -200 -1100 150 U 40 40 1 1 W 139 | X P3.4/UCA0TXD/UCA0SIMO 25 -1150 -550 150 R 40 40 1 1 B 140 | X TCK/SMCLK/P1.4 35 1150 300 150 L 40 40 1 1 B 141 | X AVCC 16 -200 1100 150 D 40 40 1 1 W 142 | X P3.5/UCA0RXD/UCA0SOMI 26 -1150 -650 150 R 40 40 1 1 B 143 | X TMS/TA0.0/P1.5 36 1150 200 150 L 40 40 1 1 B 144 | X P4.0/CA0/TB0.0 17 -1150 700 150 R 40 40 1 1 B 145 | X P3.6/A6/TA1.1 27 -1150 -750 150 R 40 40 1 1 B 146 | X TDI/TA0.1/P1.6 37 1150 100 150 L 40 40 1 1 B 147 | X P4.1/CA1/TB0.1 18 -1150 600 150 R 40 40 1 1 B 148 | X P3.7/A7/TA1.2 28 -1150 -850 150 R 40 40 1 1 B 149 | X TDO/TDI/TA0.2/P1.7 38 1150 0 150 L 40 40 1 1 B 150 | X P4.2/CA2/TB0.2 19 -1150 500 150 R 40 40 1 1 B 151 | X TA0.1/VREF−/VeREF−/A3/P2.3 29 1150 -450 150 L 40 40 1 1 B 152 | ENDDRAW 153 | ENDDEF 154 | # 155 | # OpenBMSRiser 156 | # 157 | DEF OpenBMSRiser J 0 40 Y Y 1 F N 158 | F0 "J" 0 0 60 H V C CNN 159 | F1 "OpenBMSRiser" 0 -100 60 H V C CNN 160 | F2 "" 0 0 60 H I C CNN 161 | F3 "" 0 0 60 H I C CNN 162 | DRAW 163 | S -400 50 400 -950 0 1 0 N 164 | X GND 1 -600 -250 200 R 50 50 1 1 I 165 | X SCL 2 -600 -350 200 R 50 50 1 1 I 166 | X SDA 3 -600 -450 200 R 50 50 1 1 I 167 | X ~INT 4 -600 -550 200 R 50 50 1 1 I 168 | X FETsOFF 5 -600 -650 200 R 50 50 1 1 I 169 | X ~SD 6 -600 -750 200 R 50 50 1 1 I 170 | X RGO 7 -600 -850 200 R 50 50 1 1 I 171 | ENDDRAW 172 | ENDDEF 173 | # 174 | # R 175 | # 176 | DEF R R 0 0 N Y 1 F N 177 | F0 "R" 80 0 50 V V C CNN 178 | F1 "R" 0 0 50 V V C CNN 179 | F2 "" -70 0 50 V I C CNN 180 | F3 "" 0 0 50 H I C CNN 181 | $FPLIST 182 | R_* 183 | R_* 184 | $ENDFPLIST 185 | DRAW 186 | S -40 -100 40 100 0 1 10 N 187 | X ~ 1 0 150 50 D 50 50 1 1 P 188 | X ~ 2 0 -150 50 U 50 50 1 1 P 189 | ENDDRAW 190 | ENDDEF 191 | # 192 | # SW_Push 193 | # 194 | DEF SW_Push SW 0 40 N N 1 F N 195 | F0 "SW" 50 100 50 H V L CNN 196 | F1 "SW_Push" 0 -60 50 H V C CNN 197 | F2 "" 0 200 50 H I C CNN 198 | F3 "" 0 200 50 H I C CNN 199 | DRAW 200 | C -80 0 20 0 1 0 N 201 | C 80 0 20 0 1 0 N 202 | P 2 0 1 0 0 50 0 120 N 203 | P 2 0 1 0 100 50 -100 50 N 204 | X 1 1 -200 0 100 R 50 50 0 1 P 205 | X 2 2 200 0 100 L 50 50 0 1 P 206 | ENDDRAW 207 | ENDDEF 208 | # 209 | # TEST_1P 210 | # 211 | DEF TEST_1P J 0 30 N N 1 F N 212 | F0 "J" 0 270 50 H V C CNN 213 | F1 "TEST_1P" 0 200 50 H V C CNN 214 | F2 "" 200 0 50 H I C CNN 215 | F3 "" 200 0 50 H I C CNN 216 | DRAW 217 | C 0 130 30 0 1 0 N 218 | X 1 1 0 0 100 U 50 50 1 1 P 219 | ENDDRAW 220 | ENDDEF 221 | # 222 | # VDD 223 | # 224 | DEF VDD #PWR 0 0 Y Y 1 F P 225 | F0 "#PWR" 0 -150 50 H I C CNN 226 | F1 "VDD" 0 150 50 H V C CNN 227 | F2 "" 0 0 50 H I C CNN 228 | F3 "" 0 0 50 H I C CNN 229 | DRAW 230 | C 0 75 25 0 1 0 N 231 | P 2 0 1 0 0 0 0 50 N 232 | X VDD 1 0 0 0 U 50 50 1 1 W N 233 | ENDDRAW 234 | ENDDEF 235 | # 236 | #End Library 237 | -------------------------------------------------------------------------------- /Front Panel Code/OpenBMS/TI_USCI_I2C_master.c: -------------------------------------------------------------------------------- 1 | 2 | #include "TI_USCI_I2C_master.h" 3 | #include 4 | signed char byteCtr; 5 | unsigned char *TI_receive_field; 6 | unsigned char *TI_transmit_field; 7 | 8 | //------------------------------------------------------------------------------ 9 | // void TI_USCI_I2C_receiveinit(unsigned char slave_address, 10 | // unsigned char prescale) 11 | // 12 | // This function initializes the USCI module for master-receive operation. 13 | // 14 | // IN: unsigned char slave_address => Slave Address 15 | // unsigned char prescale => SCL clock adjustment 16 | //----------------------------------------------------------------------------- 17 | void TI_USCI_I2C_receiveinit(unsigned char slave_address, 18 | unsigned char prescale){ 19 | P3SEL |= SDA_PIN + SCL_PIN; // Assign I2C pins to USCI_B0 20 | UCB0CTL1 = UCSWRST; // Enable SW reset 21 | UCB0CTL0 = UCMST + UCMODE_3 + UCSYNC; // I2C Master, synchronous mode 22 | UCB0CTL1 = UCSSEL_2 + UCSWRST; // Use SMCLK, keep SW reset 23 | UCB0BR0 = prescale; // set prescaler 24 | UCB0BR1 = 0; 25 | UCB0I2CSA = slave_address; // set slave address 26 | UCB0CTL1 &= ~UCSWRST; // Clear SW reset, resume operation 27 | UCB0I2CIE = UCNACKIE; 28 | IE2 = UCB0RXIE; // Enable RX interrupt 29 | } 30 | 31 | //------------------------------------------------------------------------------ 32 | // void TI_USCI_I2C_transmitinit(unsigned char slave_address, 33 | // unsigned char prescale) 34 | // 35 | // This function initializes the USCI module for master-transmit operation. 36 | // 37 | // IN: unsigned char slave_address => Slave Address 38 | // unsigned char prescale => SCL clock adjustment 39 | //------------------------------------------------------------------------------ 40 | void TI_USCI_I2C_transmitinit(unsigned char slave_address, 41 | unsigned char prescale){ 42 | P3SEL |= SDA_PIN + SCL_PIN; // Assign I2C pins to USCI_B0 43 | UCB0CTL1 = UCSWRST; // Enable SW reset 44 | UCB0CTL0 = UCMST + UCMODE_3 + UCSYNC; // I2C Master, synchronous mode 45 | UCB0CTL1 = UCSSEL_2 + UCSWRST; // Use SMCLK, keep SW reset 46 | UCB0BR0 = prescale; // set prescaler 47 | UCB0BR1 = 0; 48 | UCB0I2CSA = slave_address; // Set slave address 49 | UCB0CTL1 &= ~UCSWRST; // Clear SW reset, resume operation 50 | UCB0I2CIE = UCNACKIE; 51 | IE2 = UCB0TXIE; // Enable TX ready interrupt 52 | } 53 | 54 | //------------------------------------------------------------------------------ 55 | // void TI_USCI_I2C_receive(unsigned char byteCount, unsigned char *field) 56 | // 57 | // This function is used to start an I2C commuincation in master-receiver mode. 58 | // 59 | // IN: unsigned char byteCount => number of bytes that should be read 60 | // unsigned char *field => array variable used to store received data 61 | //------------------------------------------------------------------------------ 62 | void TI_USCI_I2C_receive(unsigned char byteCount, unsigned char *field){ 63 | TI_receive_field = field; 64 | if ( byteCount == 1 ){ 65 | byteCtr = 0 ; 66 | __disable_interrupt(); 67 | UCB0CTL1 |= UCTXSTT; // I2C start condition 68 | while (UCB0CTL1 & UCTXSTT); // Start condition sent? 69 | UCB0CTL1 |= UCTXSTP; // I2C stop condition 70 | __enable_interrupt(); 71 | } else if ( byteCount > 1 ) { 72 | byteCtr = byteCount - 2 ; 73 | UCB0CTL1 |= UCTXSTT; // I2C start condition 74 | }// else 75 | // while (1); // illegal parameter 76 | } 77 | 78 | //------------------------------------------------------------------------------ 79 | // void TI_USCI_I2C_transmit(unsigned char byteCount, unsigned char *field) 80 | // 81 | // This function is used to start an I2C commuincation in master-transmit mode. 82 | // 83 | // IN: unsigned char byteCount => number of bytes that should be transmitted 84 | // unsigned char *field => array variable. Its content will be sent. 85 | //------------------------------------------------------------------------------ 86 | void TI_USCI_I2C_transmit(unsigned char byteCount, unsigned char *field){ 87 | TI_transmit_field = field; 88 | byteCtr = byteCount; 89 | UCB0CTL1 |= UCTR + UCTXSTT; // I2C TX, start condition 90 | } 91 | 92 | //------------------------------------------------------------------------------ 93 | // unsigned char TI_USCI_I2C_slave_present(unsigned char slave_address) 94 | // 95 | // This function is used to look for a slave address on the I2C bus. 96 | // 97 | // IN: unsigned char slave_address => Slave Address 98 | // OUT: unsigned char => 0: address was not found, 99 | // 1: address found 100 | //------------------------------------------------------------------------------ 101 | unsigned char TI_USCI_I2C_slave_present(unsigned char slave_address){ 102 | unsigned char ie2_bak, slaveadr_bak, ucb0i2cie, returnValue; 103 | ucb0i2cie = UCB0I2CIE; // restore old UCB0I2CIE 104 | ie2_bak = IE2; // store IE2 register 105 | slaveadr_bak = UCB0I2CSA; // store old slave address 106 | UCB0I2CIE &= ~ UCNACKIE; // no NACK interrupt 107 | UCB0I2CSA = slave_address; // set slave address 108 | IE2 &= ~(UCB0TXIE + UCB0RXIE); // no RX or TX interrupts 109 | __disable_interrupt(); 110 | UCB0CTL1 |= UCTR + UCTXSTT + UCTXSTP; // I2C TX, start condition 111 | while (UCB0CTL1 & UCTXSTP); // wait for STOP condition 112 | 113 | returnValue = !(UCB0STAT & UCNACKIFG); 114 | __enable_interrupt(); 115 | IE2 = ie2_bak; // restore IE2 116 | UCB0I2CSA = slaveadr_bak; // restore old slave address 117 | UCB0I2CIE = ucb0i2cie; // restore old UCB0CTL1 118 | return returnValue; // return whether or not 119 | // a NACK occured 120 | } 121 | 122 | //------------------------------------------------------------------------------ 123 | // unsigned char TI_USCI_I2C_notready() 124 | // 125 | // This function is used to check if there is commuincation in progress. 126 | // 127 | // OUT: unsigned char => 0: I2C bus is idle, 128 | // 1: communication is in progress 129 | //------------------------------------------------------------------------------ 130 | unsigned char TI_USCI_I2C_notready(){ 131 | return (UCB0STAT & UCBBUSY); 132 | } 133 | 134 | 135 | #pragma vector = USCIAB0RX_VECTOR 136 | __interrupt void USCIAB0RX_ISR(void) 137 | { 138 | if (UCB0STAT & UCNACKIFG){ // send STOP if slave sends NACK 139 | UCB0CTL1 |= UCTXSTP; 140 | UCB0STAT &= ~UCNACKIFG; 141 | } 142 | 143 | } 144 | 145 | 146 | #pragma vector = USCIAB0TX_VECTOR 147 | __interrupt void USCIAB0TX_ISR(void) 148 | { 149 | if(IFG2 &UCA0RXIFG || IFG2 & UCA0TXIFG) 150 | { 151 | 152 | IFG2 &= ~UCA0RXIFG; 153 | IFG2 &= ~UCA0TXIFG; 154 | } 155 | else if (IFG2 & UCB0RXIFG){ 156 | if ( byteCtr == 0 ){ 157 | UCB0CTL1 |= UCTXSTP; // I2C stop condition 158 | *TI_receive_field = UCB0RXBUF; 159 | TI_receive_field++; 160 | } 161 | else { 162 | *TI_receive_field = UCB0RXBUF; 163 | TI_receive_field++; 164 | byteCtr--; 165 | } 166 | } 167 | else { 168 | if (byteCtr == 0){ 169 | UCB0CTL1 |= UCTXSTP; // I2C stop condition 170 | IFG2 &= ~UCB0TXIFG; // Clear USCI_B0 TX int flag 171 | } 172 | else { 173 | UCB0TXBUF = *TI_transmit_field; 174 | TI_transmit_field++; 175 | byteCtr--; 176 | } 177 | } 178 | } 179 | 180 | 181 | -------------------------------------------------------------------------------- /Electronics/Power Dist/Power Dist.sch: -------------------------------------------------------------------------------- 1 | EESchema Schematic File Version 2 2 | LIBS:power 3 | LIBS:device 4 | LIBS:transistors 5 | LIBS:conn 6 | LIBS:linear 7 | LIBS:regul 8 | LIBS:74xx 9 | LIBS:cmos4000 10 | LIBS:adc-dac 11 | LIBS:memory 12 | LIBS:xilinx 13 | LIBS:microcontrollers 14 | LIBS:dsp 15 | LIBS:microchip 16 | LIBS:analog_switches 17 | LIBS:motorola 18 | LIBS:texas 19 | LIBS:intel 20 | LIBS:audio 21 | LIBS:interface 22 | LIBS:digital-audio 23 | LIBS:philips 24 | LIBS:display 25 | LIBS:cypress 26 | LIBS:siliconi 27 | LIBS:opto 28 | LIBS:atmel 29 | LIBS:contrib 30 | LIBS:valves 31 | LIBS:mechanical 32 | LIBS:Power Dist-cache 33 | EELAYER 25 0 34 | EELAYER END 35 | $Descr A4 11693 8268 36 | encoding utf-8 37 | Sheet 1 1 38 | Title "" 39 | Date "" 40 | Rev "" 41 | Comp "" 42 | Comment1 "" 43 | Comment2 "" 44 | Comment3 "" 45 | Comment4 "" 46 | $EndDescr 47 | $Comp 48 | L Mounting_Hole MK1 49 | U 1 1 59375D19 50 | P 1300 1200 51 | F 0 "MK1" H 1300 1400 50 0000 C CNN 52 | F 1 "Mounting_Hole" H 1300 1325 50 0000 C CNN 53 | F 2 "Mounting_Holes:MountingHole_3.2mm_M3" H 1300 1200 50 0001 C CNN 54 | F 3 "" H 1300 1200 50 0001 C CNN 55 | 1 1300 1200 56 | 1 0 0 -1 57 | $EndComp 58 | $Comp 59 | L Mounting_Hole MK5 60 | U 1 1 59375E2B 61 | P 1900 1600 62 | F 0 "MK5" H 1900 1800 50 0000 C CNN 63 | F 1 "Mounting_Hole" H 1900 1725 50 0000 C CNN 64 | F 2 "Mounting_Holes:MountingHole_3.2mm_M3" H 1900 1600 50 0001 C CNN 65 | F 3 "" H 1900 1600 50 0001 C CNN 66 | 1 1900 1600 67 | 1 0 0 -1 68 | $EndComp 69 | $Comp 70 | L Mounting_Hole MK2 71 | U 1 1 59375E8B 72 | P 1300 1600 73 | F 0 "MK2" H 1300 1800 50 0000 C CNN 74 | F 1 "Mounting_Hole" H 1300 1725 50 0000 C CNN 75 | F 2 "Mounting_Holes:MountingHole_3.2mm_M3" H 1300 1600 50 0001 C CNN 76 | F 3 "" H 1300 1600 50 0001 C CNN 77 | 1 1300 1600 78 | 1 0 0 -1 79 | $EndComp 80 | $Comp 81 | L Mounting_Hole MK6 82 | U 1 1 59375F4E 83 | P 1900 1200 84 | F 0 "MK6" H 1900 1400 50 0000 C CNN 85 | F 1 "Mounting_Hole" H 1900 1325 50 0000 C CNN 86 | F 2 "Mounting_Holes:MountingHole_3.2mm_M3" H 1900 1200 50 0001 C CNN 87 | F 3 "" H 1900 1200 50 0001 C CNN 88 | 1 1900 1200 89 | 1 0 0 -1 90 | $EndComp 91 | $Comp 92 | L CONN_01X02 J101 93 | U 1 1 597C1E4B 94 | P 3250 1225 95 | F 0 "J101" H 3250 1375 50 0000 C CNN 96 | F 1 "CONN_01X02" V 3350 1225 50 0000 C CNN 97 | F 2 "XTConnectors:XT30PW_Female" H 3250 1225 50 0001 C CNN 98 | F 3 "" H 3250 1225 50 0001 C CNN 99 | 1 3250 1225 100 | -1 0 0 1 101 | $EndComp 102 | $Comp 103 | L CONN_01X02 J102 104 | U 1 1 597C1E85 105 | P 3250 1775 106 | F 0 "J102" H 3250 1925 50 0000 C CNN 107 | F 1 "CONN_01X02" V 3350 1775 50 0000 C CNN 108 | F 2 "XTConnectors:XT30PW_Male" H 3250 1775 50 0001 C CNN 109 | F 3 "" H 3250 1775 50 0001 C CNN 110 | 1 3250 1775 111 | -1 0 0 1 112 | $EndComp 113 | $Comp 114 | L CONN_01X02 J103 115 | U 1 1 597C1EFD 116 | P 3250 2325 117 | F 0 "J103" H 3250 2475 50 0000 C CNN 118 | F 1 "CONN_01X02" V 3350 2325 50 0000 C CNN 119 | F 2 "XTConnectors:XT30PW_Male" H 3250 2325 50 0001 C CNN 120 | F 3 "" H 3250 2325 50 0001 C CNN 121 | 1 3250 2325 122 | -1 0 0 1 123 | $EndComp 124 | $Comp 125 | L CONN_01X02 J104 126 | U 1 1 597C1FC0 127 | P 3250 2875 128 | F 0 "J104" H 3250 3025 50 0000 C CNN 129 | F 1 "CONN_01X02" V 3350 2875 50 0000 C CNN 130 | F 2 "XTConnectors:XT30PW_Male" H 3250 2875 50 0001 C CNN 131 | F 3 "" H 3250 2875 50 0001 C CNN 132 | 1 3250 2875 133 | -1 0 0 1 134 | $EndComp 135 | Wire Wire Line 136 | 3450 2925 4000 2925 137 | Wire Wire Line 138 | 4000 1275 4000 3375 139 | Wire Wire Line 140 | 4000 1275 3450 1275 141 | Wire Wire Line 142 | 3450 1175 3900 1175 143 | Wire Wire Line 144 | 3900 1175 3900 3475 145 | Wire Wire Line 146 | 3900 2825 3450 2825 147 | Wire Wire Line 148 | 3450 2275 3900 2275 149 | Connection ~ 3900 2275 150 | Wire Wire Line 151 | 3450 1725 3900 1725 152 | Connection ~ 3900 1725 153 | Wire Wire Line 154 | 3450 1825 4000 1825 155 | Connection ~ 4000 1825 156 | Wire Wire Line 157 | 3450 2375 4000 2375 158 | Connection ~ 4000 2375 159 | $Comp 160 | L CONN_01X04 J105 161 | U 1 1 597C2133 162 | P 5050 1350 163 | F 0 "J105" H 5050 1600 50 0000 C CNN 164 | F 1 "CONN_01X04" V 5150 1350 50 0000 C CNN 165 | F 2 "Connectors_JST:JST_XH_S04B-XH-A_04x2.50mm_Angled" H 5050 1350 50 0001 C CNN 166 | F 3 "" H 5050 1350 50 0001 C CNN 167 | 1 5050 1350 168 | 1 0 0 -1 169 | $EndComp 170 | $Comp 171 | L CONN_01X04 J106 172 | U 1 1 597C21C0 173 | P 5050 1875 174 | F 0 "J106" H 5050 2125 50 0000 C CNN 175 | F 1 "CONN_01X04" V 5150 1875 50 0000 C CNN 176 | F 2 "Connectors_JST:JST_XH_S04B-XH-A_04x2.50mm_Angled" H 5050 1875 50 0001 C CNN 177 | F 3 "" H 5050 1875 50 0001 C CNN 178 | 1 5050 1875 179 | 1 0 0 -1 180 | $EndComp 181 | $Comp 182 | L CONN_01X04 J107 183 | U 1 1 597C21FA 184 | P 5050 2400 185 | F 0 "J107" H 5050 2650 50 0000 C CNN 186 | F 1 "CONN_01X04" V 5150 2400 50 0000 C CNN 187 | F 2 "Connectors_JST:JST_XH_S04B-XH-A_04x2.50mm_Angled" H 5050 2400 50 0001 C CNN 188 | F 3 "" H 5050 2400 50 0001 C CNN 189 | 1 5050 2400 190 | 1 0 0 -1 191 | $EndComp 192 | $Comp 193 | L CONN_01X04 J108 194 | U 1 1 597C2256 195 | P 5050 2925 196 | F 0 "J108" H 5050 3175 50 0000 C CNN 197 | F 1 "CONN_01X04" V 5150 2925 50 0000 C CNN 198 | F 2 "Connectors_JST:JST_XH_S04B-XH-A_04x2.50mm_Angled" H 5050 2925 50 0001 C CNN 199 | F 3 "" H 5050 2925 50 0001 C CNN 200 | 1 5050 2925 201 | 1 0 0 -1 202 | $EndComp 203 | Wire Wire Line 204 | 4850 2775 4500 2775 205 | Wire Wire Line 206 | 4500 1200 4500 3325 207 | Wire Wire Line 208 | 4500 1200 4850 1200 209 | Wire Wire Line 210 | 4850 1300 4450 1300 211 | Wire Wire Line 212 | 4450 1300 4450 3425 213 | Wire Wire Line 214 | 4450 2875 4850 2875 215 | Wire Wire Line 216 | 4850 2975 4400 2975 217 | Wire Wire Line 218 | 4400 1400 4400 3525 219 | Wire Wire Line 220 | 4400 1400 4850 1400 221 | Wire Wire Line 222 | 4850 3075 4350 3075 223 | Wire Wire Line 224 | 4350 1500 4350 3625 225 | Wire Wire Line 226 | 4350 1500 4850 1500 227 | Wire Wire Line 228 | 4850 2025 4350 2025 229 | Connection ~ 4350 2025 230 | Wire Wire Line 231 | 4850 1925 4400 1925 232 | Connection ~ 4400 1925 233 | Wire Wire Line 234 | 4850 1825 4450 1825 235 | Connection ~ 4450 1825 236 | Wire Wire Line 237 | 4850 1725 4500 1725 238 | Connection ~ 4500 1725 239 | Wire Wire Line 240 | 4850 2250 4500 2250 241 | Connection ~ 4500 2250 242 | Wire Wire Line 243 | 4850 2350 4450 2350 244 | Connection ~ 4450 2350 245 | Wire Wire Line 246 | 4850 2450 4400 2450 247 | Connection ~ 4400 2450 248 | Wire Wire Line 249 | 4850 2550 4350 2550 250 | Connection ~ 4350 2550 251 | Text Label 3900 1175 0 60 ~ 0 252 | GND 253 | Text Label 4350 1500 1 60 ~ 0 254 | GND 255 | Text Label 4000 1275 0 60 ~ 0 256 | 12V 257 | Text Label 4500 1200 1 60 ~ 0 258 | 12V 259 | Text Label 4400 1400 1 60 ~ 0 260 | 1S 261 | Text Label 4450 1300 1 60 ~ 0 262 | 2S 263 | Connection ~ 4500 1200 264 | Connection ~ 4450 1300 265 | Connection ~ 4400 1400 266 | Connection ~ 4350 1500 267 | Connection ~ 4000 1275 268 | Connection ~ 3900 1175 269 | $Comp 270 | L CONN_01X02 J109 271 | U 1 1 597C2E32 272 | P 3250 3425 273 | F 0 "J109" H 3250 3575 50 0000 C CNN 274 | F 1 "CONN_01X02" V 3350 3425 50 0000 C CNN 275 | F 2 "XTConnectors:XT30" H 3250 3425 50 0001 C CNN 276 | F 3 "" H 3250 3425 50 0001 C CNN 277 | 1 3250 3425 278 | -1 0 0 1 279 | $EndComp 280 | Wire Wire Line 281 | 4000 3375 3450 3375 282 | Connection ~ 4000 2925 283 | Wire Wire Line 284 | 3900 3475 3450 3475 285 | Connection ~ 3900 2825 286 | $Comp 287 | L CONN_01X04 J110 288 | U 1 1 597C2FB3 289 | P 5050 3475 290 | F 0 "J110" H 5050 3725 50 0000 C CNN 291 | F 1 "CONN_01X04" V 5150 3475 50 0000 C CNN 292 | F 2 "Connectors_JST:JST_XH_B04B-XH-A_04x2.50mm_Straight" H 5050 3475 50 0001 C CNN 293 | F 3 "" H 5050 3475 50 0001 C CNN 294 | 1 5050 3475 295 | 1 0 0 -1 296 | $EndComp 297 | Wire Wire Line 298 | 4500 3325 4850 3325 299 | Connection ~ 4500 2775 300 | Wire Wire Line 301 | 4450 3425 4850 3425 302 | Connection ~ 4450 2875 303 | Wire Wire Line 304 | 4400 3525 4850 3525 305 | Connection ~ 4400 2975 306 | Wire Wire Line 307 | 4350 3625 4850 3625 308 | Connection ~ 4350 3075 309 | $EndSCHEMATC 310 | -------------------------------------------------------------------------------- /Front Panel Code/OpenBMS/lnk_msp430g2755.cmd: -------------------------------------------------------------------------------- 1 | /* ============================================================================ */ 2 | /* Copyright (c) 2017, Texas Instruments Incorporated */ 3 | /* All rights reserved. */ 4 | /* */ 5 | /* Redistribution and use in source and binary forms, with or without */ 6 | /* modification, are permitted provided that the following conditions */ 7 | /* are met: */ 8 | /* */ 9 | /* * Redistributions of source code must retain the above copyright */ 10 | /* notice, this list of conditions and the following disclaimer. */ 11 | /* */ 12 | /* * Redistributions in binary form must reproduce the above copyright */ 13 | /* notice, this list of conditions and the following disclaimer in the */ 14 | /* documentation and/or other materials provided with the distribution. */ 15 | /* */ 16 | /* * Neither the name of Texas Instruments Incorporated nor the names of */ 17 | /* its contributors may be used to endorse or promote products derived */ 18 | /* from this software without specific prior written permission. */ 19 | /* */ 20 | /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" */ 21 | /* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, */ 22 | /* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */ 23 | /* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR */ 24 | /* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, */ 25 | /* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, */ 26 | /* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; */ 27 | /* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, */ 28 | /* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR */ 29 | /* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ 30 | /* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ 31 | /* ============================================================================ */ 32 | 33 | /******************************************************************************/ 34 | /* lnk_msp430g2755.cmd - LINKER COMMAND FILE FOR LINKING MSP430G2755 PROGRAMS */ 35 | /* */ 36 | /* Usage: lnk430 -o -m lnk.cmd */ 37 | /* cl430 -z -o -m lnk.cmd */ 38 | /* */ 39 | /*----------------------------------------------------------------------------*/ 40 | /* These linker options are for command line linking only. For IDE linking, */ 41 | /* you should set your linker options in Project Properties */ 42 | /* -c LINK USING C CONVENTIONS */ 43 | /* -stack 0x0100 SOFTWARE STACK SIZE */ 44 | /* -heap 0x0100 HEAP AREA SIZE */ 45 | /* */ 46 | /*----------------------------------------------------------------------------*/ 47 | /* Version: 1.200 */ 48 | /*----------------------------------------------------------------------------*/ 49 | 50 | /****************************************************************************/ 51 | /* Specify the system memory map */ 52 | /****************************************************************************/ 53 | 54 | MEMORY 55 | { 56 | SFR : origin = 0x0000, length = 0x0010 57 | PERIPHERALS_8BIT : origin = 0x0010, length = 0x00F0 58 | PERIPHERALS_16BIT : origin = 0x0100, length = 0x0100 59 | RAM : origin = 0x1100, length = 0x1000 60 | INFOA : origin = 0x10C0, length = 0x0040 61 | INFOB : origin = 0x1080, length = 0x0040 62 | INFOC : origin = 0x1040, length = 0x0040 63 | INFOD : origin = 0x1000, length = 0x0040 64 | FLASH : origin = 0x8000, length = 0x7FDE 65 | BSLSIGNATURE : origin = 0xFFDE, length = 0x0002, fill = 0xFFFF 66 | INT00 : origin = 0xFFE0, length = 0x0002 67 | INT01 : origin = 0xFFE2, length = 0x0002 68 | INT02 : origin = 0xFFE4, length = 0x0002 69 | INT03 : origin = 0xFFE6, length = 0x0002 70 | INT04 : origin = 0xFFE8, length = 0x0002 71 | INT05 : origin = 0xFFEA, length = 0x0002 72 | INT06 : origin = 0xFFEC, length = 0x0002 73 | INT07 : origin = 0xFFEE, length = 0x0002 74 | INT08 : origin = 0xFFF0, length = 0x0002 75 | INT09 : origin = 0xFFF2, length = 0x0002 76 | INT10 : origin = 0xFFF4, length = 0x0002 77 | INT11 : origin = 0xFFF6, length = 0x0002 78 | INT12 : origin = 0xFFF8, length = 0x0002 79 | INT13 : origin = 0xFFFA, length = 0x0002 80 | INT14 : origin = 0xFFFC, length = 0x0002 81 | RESET : origin = 0xFFFE, length = 0x0002 82 | } 83 | 84 | /****************************************************************************/ 85 | /* Specify the sections allocation into memory */ 86 | /****************************************************************************/ 87 | 88 | SECTIONS 89 | { 90 | .bss : {} > RAM /* Global & static vars */ 91 | .data : {} > RAM /* Global & static vars */ 92 | .TI.noinit : {} > RAM /* For #pragma noinit */ 93 | .sysmem : {} > RAM /* Dynamic memory allocation area */ 94 | .stack : {} > RAM (HIGH) /* Software system stack */ 95 | 96 | .text : {} > FLASH /* Code */ 97 | .cinit : {} > FLASH /* Initialization tables */ 98 | .const : {} > FLASH /* Constant data */ 99 | .bslsignature : {} > BSLSIGNATURE /* BSL Signature */ 100 | .cio : {} > RAM /* C I/O Buffer */ 101 | 102 | .pinit : {} > FLASH /* C++ Constructor tables */ 103 | .binit : {} > FLASH /* Boot-time Initialization tables */ 104 | .init_array : {} > FLASH /* C++ Constructor tables */ 105 | .mspabi.exidx : {} > FLASH /* C++ Constructor tables */ 106 | .mspabi.extab : {} > FLASH /* C++ Constructor tables */ 107 | #ifdef __TI_COMPILER_VERSION__ 108 | #if __TI_COMPILER_VERSION__ >= 15009000 109 | #ifndef __LARGE_DATA_MODEL__ 110 | .TI.ramfunc : {} load=FLASH, run=RAM, table(BINIT) 111 | #else 112 | .TI.ramfunc : {} load=FLASH | FLASH2, run=RAM, table(BINIT) 113 | #endif 114 | #endif 115 | #endif 116 | 117 | .infoA : {} > INFOA /* MSP430 INFO FLASH Memory segments */ 118 | .infoB : {} > INFOB 119 | .infoC : {} > INFOC 120 | .infoD : {} > INFOD 121 | 122 | /* MSP430 Interrupt vectors */ 123 | TIMER1_A1 : { * ( .int00 ) } > INT00 type = VECT_INIT 124 | TIMER1_A0 : { * ( .int01 ) } > INT01 type = VECT_INIT 125 | PORT1 : { * ( .int02 ) } > INT02 type = VECT_INIT 126 | PORT2 : { * ( .int03 ) } > INT03 type = VECT_INIT 127 | TRAPINT : { * ( .int04 ) } > INT04 type = VECT_INIT 128 | ADC10 : { * ( .int05 ) } > INT05 type = VECT_INIT 129 | USCIAB0TX : { * ( .int06 ) } > INT06 type = VECT_INIT 130 | USCIAB0RX : { * ( .int07 ) } > INT07 type = VECT_INIT 131 | TIMER0_A1 : { * ( .int08 ) } > INT08 type = VECT_INIT 132 | TIMER0_A0 : { * ( .int09 ) } > INT09 type = VECT_INIT 133 | WDT : { * ( .int10 ) } > INT10 type = VECT_INIT 134 | COMPARATORA : { * ( .int11 ) } > INT11 type = VECT_INIT 135 | TIMERB1 : { * ( .int12 ) } > INT12 type = VECT_INIT 136 | TIMERB0 : { * ( .int13 ) } > INT13 type = VECT_INIT 137 | NMI : { * ( .int14 ) } > INT14 type = VECT_INIT 138 | .reset : {} > RESET /* MSP430 Reset vector */ 139 | } 140 | 141 | /****************************************************************************/ 142 | /* Include peripherals memory map */ 143 | /****************************************************************************/ 144 | 145 | -l msp430g2755.cmd 146 | 147 | -------------------------------------------------------------------------------- /Electronics/BMS FrontEnd/OpenBMSFrontEnd-cache.lib: -------------------------------------------------------------------------------- 1 | EESchema-LIBRARY Version 2.3 2 | #encoding utf-8 3 | # 4 | # C 5 | # 6 | DEF C C 0 10 N Y 1 F N 7 | F0 "C" 25 100 50 H V L CNN 8 | F1 "C" 25 -100 50 H V L CNN 9 | F2 "" 38 -150 50 H I C CNN 10 | F3 "" 0 0 50 H I C CNN 11 | $FPLIST 12 | C_* 13 | $ENDFPLIST 14 | DRAW 15 | P 2 0 1 20 -80 -30 80 -30 N 16 | P 2 0 1 20 -80 30 80 30 N 17 | X ~ 1 0 150 110 D 50 50 1 1 P 18 | X ~ 2 0 -150 110 U 50 50 1 1 P 19 | ENDDRAW 20 | ENDDEF 21 | # 22 | # CONN_01X01 23 | # 24 | DEF CONN_01X01 J 0 40 Y N 1 F N 25 | F0 "J" 0 100 50 H V C CNN 26 | F1 "CONN_01X01" 100 0 50 V V C CNN 27 | F2 "" 0 0 50 H I C CNN 28 | F3 "" 0 0 50 H I C CNN 29 | $FPLIST 30 | Pin_Header_Straight_1X* 31 | Pin_Header_Angled_1X* 32 | Socket_Strip_Straight_1X* 33 | Socket_Strip_Angled_1X* 34 | $ENDFPLIST 35 | DRAW 36 | S -50 5 10 -5 0 1 0 N 37 | S -50 50 50 -50 0 1 0 N 38 | X P1 1 -200 0 150 R 50 50 1 1 P 39 | ENDDRAW 40 | ENDDEF 41 | # 42 | # CONN_02X05 43 | # 44 | DEF CONN_02X05 J 0 1 Y N 1 F N 45 | F0 "J" 0 300 50 H V C CNN 46 | F1 "CONN_02X05" 0 -300 50 H V C CNN 47 | F2 "" 0 -1200 50 H I C CNN 48 | F3 "" 0 -1200 50 H I C CNN 49 | $FPLIST 50 | Pin_Header_Straight_2X* 51 | Pin_Header_Angled_2X* 52 | Socket_Strip_Straight_2X* 53 | Socket_Strip_Angled_2X* 54 | IDC_Header_Straight_* 55 | $ENDFPLIST 56 | DRAW 57 | S -100 -195 -50 -205 0 1 0 N 58 | S -100 -95 -50 -105 0 1 0 N 59 | S -100 5 -50 -5 0 1 0 N 60 | S -100 105 -50 95 0 1 0 N 61 | S -100 205 -50 195 0 1 0 N 62 | S -100 250 100 -250 0 1 0 N 63 | S 50 -195 100 -205 0 1 0 N 64 | S 50 -95 100 -105 0 1 0 N 65 | S 50 5 100 -5 0 1 0 N 66 | S 50 105 100 95 0 1 0 N 67 | S 50 205 100 195 0 1 0 N 68 | X P1 1 -250 200 150 R 50 50 1 1 P 69 | X P2 2 250 200 150 L 50 50 1 1 P 70 | X P3 3 -250 100 150 R 50 50 1 1 P 71 | X P4 4 250 100 150 L 50 50 1 1 P 72 | X P5 5 -250 0 150 R 50 50 1 1 P 73 | X P6 6 250 0 150 L 50 50 1 1 P 74 | X P7 7 -250 -100 150 R 50 50 1 1 P 75 | X P8 8 250 -100 150 L 50 50 1 1 P 76 | X P9 9 -250 -200 150 R 50 50 1 1 P 77 | X P10 10 250 -200 150 L 50 50 1 1 P 78 | ENDDRAW 79 | ENDDEF 80 | # 81 | # FDMS8350LET40 82 | # 83 | DEF FDMS8350LET40 Q 0 0 Y N 1 F N 84 | F0 "Q" -200 300 50 H V L CNN 85 | F1 "FDMS8350LET40" -200 -250 50 H V L CNN 86 | F2 "TO_SOT_Packages_SMD:TDSON-8-1" 0 -344 50 H I C CIN 87 | F3 "" 0 0 50 V I L CNN 88 | ALIAS FDMT80060DC FDMT80080DC FDMT800120DC FDMT800100DC FDMT800150DC FDMT800152DC FDMS8050ET30 FDMS86202ET120 FDMS86150ET100 FDMS86255ET150 FDMS86350ET80 FDMS86550ET60 FDMS8050 FDMS8350L FDMS86255 FDMS86550 FDMS86202 FDMS86350 FDMS86152 FDMS86150 89 | $FPLIST 90 | SON* 91 | $ENDFPLIST 92 | DRAW 93 | C -150 75 5 0 0 10 N 94 | C -50 75 5 0 0 10 N 95 | C 50 75 5 0 0 10 N 96 | C 150 75 5 0 0 10 N 97 | T 0 125 100 30 0 0 0 D Normal 0 C C 98 | T 0 -70 -70 30 0 0 0 G Normal 0 C C 99 | T 0 -125 100 30 0 0 0 S Normal 0 C C 100 | P 2 0 0 0 -200 100 -150 100 N 101 | P 2 0 0 0 -50 75 -150 75 N 102 | P 2 0 0 0 200 100 150 100 N 103 | P 4 0 0 0 -50 25 -50 110 50 110 50 25 N 104 | P 4 0 0 0 5 110 -15 120 -15 100 5 110 F 105 | P 4 0 0 0 15 125 10 120 10 100 5 95 N 106 | C -150 100 5 0 1 10 N 107 | C 0 50 111 0 1 8 N 108 | C 150 0 5 0 1 10 N 109 | C 150 100 5 0 1 10 N 110 | S -200 250 200 -200 0 1 10 f 111 | P 2 0 1 0 -200 -100 -50 -100 N 112 | P 2 0 1 15 -65 25 -35 25 N 113 | P 2 0 1 0 -50 -100 -50 0 N 114 | P 2 0 1 15 -15 25 15 25 N 115 | P 2 0 1 15 35 25 65 25 N 116 | P 2 0 1 0 50 75 150 75 N 117 | P 2 0 1 0 200 0 150 0 N 118 | P 3 0 1 10 -60 0 60 0 60 0 N 119 | P 3 0 1 0 0 25 0 75 -50 75 N 120 | P 4 0 1 0 -200 0 -150 0 -150 200 -200 200 N 121 | P 4 0 1 0 -10 65 10 65 0 40 -10 65 F 122 | P 4 0 1 0 200 200 150 200 150 -100 200 -100 N 123 | X S 1 -300 200 100 R 50 50 1 1 P 124 | X S 2 -300 100 100 R 50 50 1 1 P 125 | X S 3 -300 0 100 R 50 50 1 1 P 126 | X G 4 -300 -100 100 R 50 50 1 1 P 127 | X D 5 300 -100 100 L 50 50 1 1 P 128 | X D 6 300 0 100 L 50 50 1 1 P 129 | X D 7 300 100 100 L 50 50 1 1 P 130 | X D 8 300 200 100 L 50 50 1 1 P 131 | ENDDRAW 132 | ENDDEF 133 | # 134 | # GND 135 | # 136 | DEF GND #PWR 0 0 Y Y 1 F P 137 | F0 "#PWR" 0 -250 50 H I C CNN 138 | F1 "GND" 0 -150 50 H V C CNN 139 | F2 "" 0 0 50 H I C CNN 140 | F3 "" 0 0 50 H I C CNN 141 | DRAW 142 | P 6 0 1 0 0 0 0 -50 50 -50 0 -100 -50 -50 0 -50 N 143 | X GND 1 0 0 0 D 50 50 1 1 W N 144 | ENDDRAW 145 | ENDDEF 146 | # 147 | # ISL94202 148 | # 149 | DEF ISL94202 U 0 40 Y Y 1 F N 150 | F0 "U" 0 0 50 H V C CNN 151 | F1 "ISL94202" 0 350 50 H V C CNN 152 | F2 "MODULE" 0 150 50 H I C CNN 153 | F3 "DOCUMENTATION" 0 250 50 H I C CNN 154 | DRAW 155 | S 900 -750 -800 700 0 1 0 N 156 | X VC8 1 -1100 500 300 R 50 50 1 1 I 157 | X CB8 2 -1100 400 300 R 50 50 1 1 O 158 | X VC7 3 -1100 300 300 R 50 50 1 1 I 159 | X CB7 4 -1100 200 300 R 50 50 1 1 O 160 | X VC6 5 -1100 100 300 R 50 50 1 1 I 161 | X CB6 6 -1100 0 300 R 50 50 1 1 O 162 | X VC5 7 -1100 -100 300 R 50 50 1 1 I 163 | X CB5 8 -1100 -200 300 R 50 50 1 1 O 164 | X VC4 9 -1100 -300 300 R 50 50 1 1 I 165 | X CB4 10 -1100 -400 300 R 50 50 1 1 O 166 | X XT1 20 200 -1050 300 U 50 50 1 1 I 167 | X DNC2 30 1200 -100 300 L 50 50 1 1 I 168 | X C2 40 300 1000 300 D 50 50 1 1 I 169 | X VC3 11 -1100 -500 300 R 50 50 1 1 I 170 | X XT2 21 300 -1050 300 U 50 50 1 1 I 171 | X ~INT 31 1200 0 300 L 50 50 1 1 I 172 | X C1 41 200 1000 300 D 50 50 1 1 I 173 | X CB3 12 -1100 -600 300 R 50 50 1 1 O 174 | X TEMPO 22 400 -1050 300 U 50 50 1 1 I 175 | X PSD 32 1200 100 300 L 50 50 1 1 I 176 | X DFET 42 100 1000 300 D 50 50 1 1 I 177 | X VC2 13 -500 -1050 300 U 50 50 1 1 I 178 | X DNC1 23 500 -1050 300 U 50 50 1 1 I 179 | X FETSOFF 33 1200 200 300 L 50 50 1 1 I 180 | X VDD 43 0 1000 300 D 50 50 1 1 W 181 | X CB2 14 -400 -1050 300 U 50 50 1 1 O 182 | X ADDR 24 600 -1050 300 U 50 50 1 1 I 183 | X ~SD 34 1200 300 300 L 50 50 1 1 I 184 | X PCFET 44 -100 1000 300 D 50 50 1 1 I 185 | X VC1 15 -300 -1050 300 U 50 50 1 1 I 186 | X SCL 25 1200 -600 300 L 50 50 1 1 O 187 | X ~EOC 35 1200 400 300 L 50 50 1 1 I 188 | X CFET 45 -200 1000 300 D 50 50 1 1 I 189 | X CB1 16 -200 -1050 300 U 50 50 1 1 O 190 | X SDAI 26 1200 -500 300 L 50 50 1 1 I 191 | X RGO 36 1200 500 300 L 50 50 1 1 I 192 | X CSI2 46 -300 1000 300 D 50 50 1 1 I 193 | X VC0 17 -100 -1050 300 U 50 50 1 1 I 194 | X SDAO 27 1200 -400 300 L 50 50 1 1 O 195 | X CHMON 37 600 1000 300 D 50 50 1 1 I 196 | X CSI1 47 -400 1000 300 D 50 50 1 1 I 197 | X VSS 18 0 -1050 300 U 50 50 1 1 W 198 | X VSS 28 1200 -300 300 L 50 50 1 1 W 199 | X LDMON 38 500 1000 300 D 50 50 1 1 I 200 | X VBATT 48 -500 1000 300 D 50 50 1 1 I 201 | X VREF 19 100 -1050 300 U 50 50 1 1 w 202 | X VSS 29 1200 -200 300 L 50 50 1 1 W 203 | X C3 39 400 1000 300 D 50 50 1 1 I 204 | X PAD 49 1100 -700 200 L 50 50 1 1 I 205 | ENDDRAW 206 | ENDDEF 207 | # 208 | # Jumper_NO_Small 209 | # 210 | DEF Jumper_NO_Small JP 0 30 N N 1 F N 211 | F0 "JP" 0 80 50 H V C CNN 212 | F1 "Jumper_NO_Small" 10 -60 50 H V C CNN 213 | F2 "" 0 0 50 H I C CNN 214 | F3 "" 0 0 50 H I C CNN 215 | DRAW 216 | C -40 0 20 0 1 0 N 217 | C 40 0 20 0 1 0 N 218 | X 1 1 -100 0 40 R 50 50 0 1 P 219 | X 2 2 100 0 40 L 50 50 0 1 P 220 | ENDDRAW 221 | ENDDEF 222 | # 223 | # Mounting_Hole 224 | # 225 | DEF Mounting_Hole MK 0 40 Y Y 1 F N 226 | F0 "MK" 0 200 50 H V C CNN 227 | F1 "Mounting_Hole" 0 125 50 H V C CNN 228 | F2 "" 0 0 50 H I C CNN 229 | F3 "" 0 0 50 H I C CNN 230 | $FPLIST 231 | Mounting?Hole* 232 | Hole* 233 | $ENDFPLIST 234 | DRAW 235 | C 0 0 50 0 1 50 N 236 | ENDDRAW 237 | ENDDEF 238 | # 239 | # OpenBMSRiser 240 | # 241 | DEF OpenBMSRiser J 0 40 Y Y 1 F N 242 | F0 "J" 0 0 60 H V C CNN 243 | F1 "OpenBMSRiser" 0 -100 60 H V C CNN 244 | F2 "" 0 0 60 H I C CNN 245 | F3 "" 0 0 60 H I C CNN 246 | DRAW 247 | S -400 50 400 -950 0 1 0 N 248 | X GND 1 -600 -250 200 R 50 50 1 1 I 249 | X SCL 2 -600 -350 200 R 50 50 1 1 I 250 | X SDA 3 -600 -450 200 R 50 50 1 1 I 251 | X ~INT 4 -600 -550 200 R 50 50 1 1 I 252 | X FETsOFF 5 -600 -650 200 R 50 50 1 1 I 253 | X ~SD 6 -600 -750 200 R 50 50 1 1 I 254 | X RGO 7 -600 -850 200 R 50 50 1 1 I 255 | ENDDRAW 256 | ENDDEF 257 | # 258 | # Q_NMOS_GSD 259 | # 260 | DEF Q_NMOS_GSD Q 0 0 Y N 1 F N 261 | F0 "Q" 200 50 50 H V L CNN 262 | F1 "Q_NMOS_GSD" 200 -50 50 H V L CNN 263 | F2 "" 200 100 50 H I C CNN 264 | F3 "" 0 0 50 H I C CNN 265 | DRAW 266 | C 65 0 111 0 1 10 N 267 | C 100 -70 11 0 1 0 F 268 | C 100 70 11 0 1 0 F 269 | P 2 0 1 0 30 -70 100 -70 N 270 | P 2 0 1 10 30 -50 30 -90 N 271 | P 2 0 1 0 30 0 100 0 N 272 | P 2 0 1 10 30 20 30 -20 N 273 | P 2 0 1 0 30 70 100 70 N 274 | P 2 0 1 10 30 90 30 50 N 275 | P 2 0 1 0 100 -70 100 -100 N 276 | P 2 0 1 0 100 -70 100 0 N 277 | P 2 0 1 0 100 100 100 70 N 278 | P 3 0 1 10 10 75 10 -75 10 -75 N 279 | P 4 0 1 0 40 0 80 15 80 -15 40 0 F 280 | P 4 0 1 0 100 -70 130 -70 130 70 100 70 N 281 | P 4 0 1 0 110 20 115 15 145 15 150 10 N 282 | P 4 0 1 0 130 15 115 -10 145 -10 130 15 N 283 | X G 1 -200 0 210 R 50 50 1 1 I 284 | X S 2 100 -200 100 U 50 50 1 1 P 285 | X D 3 100 200 100 D 50 50 1 1 P 286 | ENDDRAW 287 | ENDDEF 288 | # 289 | # Q_PMOS_GSD 290 | # 291 | DEF Q_PMOS_GSD Q 0 0 Y N 1 F N 292 | F0 "Q" 200 50 50 H V L CNN 293 | F1 "Q_PMOS_GSD" 200 -50 50 H V L CNN 294 | F2 "" 200 100 50 H I C CNN 295 | F3 "" 0 0 50 H I C CNN 296 | DRAW 297 | C 65 0 111 0 1 10 N 298 | C 100 -70 11 0 1 0 F 299 | C 100 70 11 0 1 0 F 300 | P 2 0 1 0 30 -70 100 -70 N 301 | P 2 0 1 10 30 -50 30 -90 N 302 | P 2 0 1 0 30 0 100 0 N 303 | P 2 0 1 10 30 20 30 -20 N 304 | P 2 0 1 0 30 70 100 70 N 305 | P 2 0 1 10 30 90 30 50 N 306 | P 2 0 1 0 100 -70 100 -100 N 307 | P 2 0 1 0 100 -70 100 0 N 308 | P 2 0 1 0 100 100 100 70 N 309 | P 3 0 1 10 10 75 10 -75 10 -75 N 310 | P 4 0 1 0 90 0 50 -15 50 15 90 0 F 311 | P 4 0 1 0 100 -70 130 -70 130 70 100 70 N 312 | P 4 0 1 0 110 -20 115 -15 145 -15 150 -10 N 313 | P 4 0 1 0 130 -15 115 10 145 10 130 -15 N 314 | X G 1 -200 0 210 R 50 50 1 1 I 315 | X S 2 100 -200 100 U 50 50 1 1 P 316 | X D 3 100 200 100 D 50 50 1 1 P 317 | ENDDRAW 318 | ENDDEF 319 | # 320 | # R 321 | # 322 | DEF R R 0 0 N Y 1 F N 323 | F0 "R" 80 0 50 V V C CNN 324 | F1 "R" 0 0 50 V V C CNN 325 | F2 "" -70 0 50 V I C CNN 326 | F3 "" 0 0 50 H I C CNN 327 | $FPLIST 328 | R_* 329 | R_* 330 | $ENDFPLIST 331 | DRAW 332 | S -40 -100 40 100 0 1 10 N 333 | X ~ 1 0 150 50 D 50 50 1 1 P 334 | X ~ 2 0 -150 50 U 50 50 1 1 P 335 | ENDDRAW 336 | ENDDEF 337 | # 338 | # Thermistor 339 | # 340 | DEF Thermistor TH 0 0 N Y 1 F N 341 | F0 "TH" 100 50 50 V V C CNN 342 | F1 "Thermistor" -100 0 50 V V C BNN 343 | F2 "" 0 0 50 H I C CNN 344 | F3 "" 0 0 50 H I C CNN 345 | $FPLIST 346 | R_* 347 | SM0603 348 | SM0805 349 | $ENDFPLIST 350 | DRAW 351 | S -40 100 40 -100 0 1 8 N 352 | P 5 0 1 10 -75 125 -75 75 75 -75 75 -125 75 -125 N 353 | X ~ 1 0 200 100 D 50 50 1 1 P 354 | X ~ 2 0 -200 100 U 50 50 1 1 P 355 | ENDDRAW 356 | ENDDEF 357 | # 358 | #End Library 359 | -------------------------------------------------------------------------------- /Front Panel Code/OpenBMS/ISL94202.c: -------------------------------------------------------------------------------- 1 | /* 2 | * ISL94202.c 3 | * 4 | * Created on: 12Jun.,2017 5 | * Author: Ben V. Brown 6 | */ 7 | 8 | #include "ISL94202.h" 9 | 10 | uint8_t CurrentStatusBuffer[5]; //Stores current device status + balancing information 11 | uint8_t CurrentVoltageBuffer[22]; 12 | uint8_t EEPROMScratch[4]; //Used to buffer the user EEPOM [used for cal data] 13 | 14 | /////////////////////////////////// SETTINGS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ 15 | 16 | //Thresholds and releases 17 | void ISL94202_setOVLockout(uint16_t mV) 18 | { 19 | ISL94202_writeEEPROMVoltage(0x08, mV, 0x00); 20 | } 21 | void ISL94202_setOVThres(uint16_t mV) 22 | { 23 | ISL94202_writeEEPROMVoltage(0x00, mV, 1); 24 | } 25 | void ISL94202_setOVRecovery(uint16_t mV) 26 | { 27 | ISL94202_writeEEPROMVoltage(0x02, mV, 0x00); 28 | } 29 | void ISL94202_setUVThres(uint16_t mV) 30 | { 31 | ISL94202_writeEEPROMVoltage(0x04, mV, 1); 32 | } 33 | void ISL94202_setUVRecovery(uint16_t mV) 34 | { 35 | ISL94202_writeEEPROMVoltage(0x06, mV, 0x00); 36 | } 37 | void ISL94202_setUVLockout(uint16_t mV) 38 | { 39 | ISL94202_writeEEPROMVoltage(0x0A, mV, 0x00); 40 | } 41 | void ISL94202_setEOCThreshold(uint16_t mV) 42 | { 43 | ISL94202_writeEEPROMVoltage(0x0C, mV, 0x00); 44 | } 45 | 46 | //Current Settings 47 | /* 48 | * 0 4mV 49 | * 1 8mV 50 | * 2 16mV 51 | * 3 24mV 52 | * 4 32mV 53 | * 5 48mV 54 | * 6 64mV 55 | * 7 96mV 56 | */ 57 | void ISL94202_setDischargeOC(uint8_t mV, uint16_t time, uint8_t timeBase) 58 | { 59 | //Threshold 000 is 4mV, each step ={4,8,16,24,32,48,64,96} 60 | //timescale = {us,ms,s,min} 61 | //default is 32mV,160ms 62 | if (mV > 7) 63 | return; 64 | ISL94202_writeEEPROMTimeout(0x16, time, timeBase, mV); 65 | } 66 | /* 67 | * 0 1mV 68 | * 1 2mV 69 | * 3 6mV 70 | * 4 8mV 71 | * 5 12mV 72 | * 6 16mV 73 | * 7 24mV 74 | */ 75 | void ISL94202_setChargeOC(uint8_t mV, uint16_t time, uint8_t timeBase) 76 | { 77 | //Threshold 000 is 1mV, each step ={1,2,4,6,8,12,16,24} 78 | //timescale = {us,ms,s,min} 79 | //default is 8mV,160ms 80 | if (mV > 7) 81 | return; 82 | 83 | ISL94202_writeEEPROMTimeout(0x18, time, timeBase, mV); 84 | } 85 | 86 | /* 87 | * 0 16mV 88 | * 1 24mV 89 | * 2 32mV 90 | * 3 48mV 91 | * 4 64mV 92 | * 5 96mV 93 | * 6 128mV 94 | * 7 256mV 95 | */ 96 | void ISL94202_setShortCircuit(uint8_t mV, uint16_t time, uint8_t timeBase) 97 | { 98 | //Threshold 000 is 16mV, each step ={16,24,32,48,64,96,128,256} 99 | //timescale = {us,ms,s,min} 100 | //default is 128mV,200uS 101 | if (mV > 7) 102 | return; 103 | ISL94202_writeEEPROMTimeout(0x1A, time, timeBase, mV); 104 | } 105 | 106 | //Cell Balancing 107 | void ISL94202_setCellBalanceTimes(uint8_t onTime, uint8_t offTime, 108 | uint8_t timeBase) 109 | { 110 | //Sets on / off time for balancing cycle 111 | ISL94202_writeEEPROMTimeout(0x24, onTime, timeBase, 0); 112 | ISL94202_writeEEPROMTimeout(0x26, offTime, timeBase, 0); 113 | 114 | } 115 | void ISL94202_setCellCountSleepTimes(uint8_t cellCount, uint8_t idleModeTimeout, 116 | uint8_t sleepModeTimeout) 117 | { 118 | //cellCount needs to be turned into the input bitmask 119 | uint8_t cellMask = 0b10000011; 120 | if (cellCount == 4) 121 | cellMask = 0b11000011; 122 | if (cellCount == 5) 123 | cellMask = 0b11000111; 124 | if (cellCount == 6) 125 | cellMask = 0b11100111; 126 | if (cellCount == 7) 127 | cellMask = 0b11101111; 128 | if (cellCount == 8) 129 | cellMask = 0b01111111; 130 | idleModeTimeout = idleModeTimeout & 0x0F; 131 | sleepModeTimeout = sleepModeTimeout & 0xF0; 132 | uint16_t output = cellMask << 8; 133 | output |= idleModeTimeout; 134 | output |= sleepModeTimeout; 135 | ISL94202_writeEEPROMWord(0x48, output); 136 | } 137 | void ISL94202_setCellBalanceDifference(uint16_t mV) 138 | { 139 | //If the cells are closer than this the balancing stops 140 | //defaults to 20mV 141 | ISL94202_writeEEPROMVoltage(0x20, mV, 0x00); 142 | } 143 | void ISL94202_setCellBalanceStartV(uint16_t mV) 144 | { 145 | ISL94202_writeEEPROMVoltage(0x1C, mV, 0x00); 146 | } 147 | void ISL94202_setCellBalanceStopV(uint16_t mV) 148 | { 149 | ISL94202_writeEEPROMVoltage(0x1E, mV, 0x00); 150 | } 151 | void ISL94202_setCellBalanceFaultLevel(uint16_t mV) 152 | { 153 | //If the difference is bigger than this its a fault and system gives up 154 | //default 500mV 155 | ISL94202_writeEEPROMVoltage(0x22, mV, 0x00); 156 | } 157 | 158 | void ISL94202_setFeature1(bool CellFActivatesPSD, bool XT2Mode, bool TGain, 159 | bool PreChargeFETEnabled, 160 | bool disableOpenWireScan, 161 | bool OpenWireSetsPSD) 162 | { 163 | uint8_t output = 0; 164 | output |= CellFActivatesPSD << 7; 165 | output |= XT2Mode << 5; 166 | output |= TGain << 4; 167 | output |= PreChargeFETEnabled << 2; 168 | output |= disableOpenWireScan << 1; 169 | output |= OpenWireSetsPSD; 170 | 171 | ISL94202_writeEEPROM(0x4A, output); 172 | } 173 | void ISL94202_setFeature2(bool CellBalanceDuringDischarge, 174 | bool CellbalanceDuringCharge, 175 | bool keepDFETonDuringCharge, 176 | bool keepCFETonDuringDischarge, 177 | bool shutdownOnUVLO, 178 | bool enableBalanceAtEOC) 179 | { 180 | uint8_t output = 0; 181 | output |= CellBalanceDuringDischarge ? 1 << 7 : 0; 182 | output |= CellbalanceDuringCharge ? 1 << 6 : 0; 183 | output |= keepDFETonDuringCharge ? 1 << 5 : 0; 184 | output |= keepCFETonDuringDischarge ? 1 << 4 : 0; 185 | output |= shutdownOnUVLO ? 1 << 3 : 0; 186 | output |= enableBalanceAtEOC ? 1 : 0; 187 | 188 | ISL94202_writeEEPROM(0x4B, output); 189 | } 190 | 191 | ///////////////////////////////Support Functions \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ 192 | 193 | 194 | uint8_t ISL94202_readUserEEPROM(uint8_t address) 195 | { 196 | volatile uint8_t r, r2; 197 | do 198 | { 199 | r = I2C_readReg8(ISLADDRESS, 0x50 + (address & 0x0F)); 200 | __delay_cycles(1000); //1ms 201 | r2 = I2C_readReg8(ISLADDRESS, 0x50 + (address & 0x0F)); 202 | 203 | } 204 | while (r != r2); 205 | return r; 206 | } 207 | void ISL94202_writeUserEEPROM(uint8_t address, uint8_t value) 208 | { 209 | ISL94202_writeEEPROM(0x50 + (address & 0x0F), value); 210 | } 211 | uint16_t ISL94202_milliVoltsToVScaleRaw(uint16_t mV) 212 | { 213 | //float retvalue =((float)mV)*((4095*3)/(1.8*8)); 214 | float retvalue = (((float) mV) / 1000.0) * 853.125; 215 | return retvalue; 216 | } 217 | void enableEEPROMAccess() 218 | { 219 | //Set the bit to change to read/write EEPROM 220 | I2C_writeReg8(ISLADDRESS, 0x89, 0x01); 221 | } 222 | void disableEEPROMAccess() 223 | { 224 | //Set the bit to change to read/write EEPROM 225 | I2C_writeReg8(ISLADDRESS, 0x89, 0x00); 226 | } 227 | void ISL94202_writeEEPROMTimeout(uint8_t add, uint16_t timeout, 228 | uint8_t timeScale, uint8_t headerFourBits) 229 | { 230 | uint16_t outputValue = 0; 231 | outputValue = headerFourBits << 12; 232 | outputValue |= (timeout & 0x3FF); 233 | outputValue |= ((timeScale & 0x03) << 10); 234 | ISL94202_writeEEPROMWord(add, outputValue); 235 | } 236 | void ISL94202_writeEEPROMVoltage(uint8_t add, uint16_t mV, 237 | uint8_t headerFourBits) 238 | { 239 | uint16_t outputValue = 0; 240 | outputValue = headerFourBits << 12; 241 | uint16_t calcValue = ISL94202_milliVoltsToVScaleRaw(mV); 242 | if (calcValue > 0x0FFF) 243 | { 244 | //Over Range 245 | return; 246 | } 247 | //else we are in range 248 | outputValue |= (calcValue & 0x0FFF); 249 | //Write out LSB in lowest address 250 | float reading = (uint16_t) (outputValue & 0x0FFF); 251 | 252 | reading *= (1.8 * 8); 253 | reading /= (4.095 * 3); 254 | 255 | ISL94202_writeEEPROMWord(add, outputValue); 256 | } 257 | 258 | void ISL94202_writeEEPROMWord(uint8_t reg, uint16_t value) 259 | { 260 | if ((reg > 0x58 && reg < 0x7F) || reg > 0xAB) 261 | return; 262 | //^ Datasheet mentions a warning not to write to these areas as they are for factory use 263 | 264 | enableEEPROMAccess(); 265 | uint8_t buffer[4]; //We need to write in pages 266 | uint8_t i; 267 | uint8_t base = reg & 0xFC; 268 | buffer[0] = I2C_readReg8(ISLADDRESS, base); 269 | __delay_cycles(1000); //delay to allow EEPROM refresh 270 | I2C_readMany(ISLADDRESS, base, 4, buffer); 271 | 272 | //We have read in the buffer 273 | //Update the buffer 274 | buffer[(uint8_t) (reg & 0x03)] = value; 275 | buffer[(uint8_t) (reg & 0x03) + 1] = value >> 8; 276 | 277 | I2C_writeReg8(ISLADDRESS, base, buffer[0]); 278 | __delay_cycles(35000); //pause for EEPROM write 279 | 280 | //^Special case for first uint8_t causing EEPROM reload 281 | for (i = 0; i < 4; i++) 282 | { 283 | I2C_writeReg8(ISLADDRESS, base + i, buffer[i]); 284 | __delay_cycles(35000); //35ms 285 | //pause for EEPROM write 286 | } 287 | 288 | disableEEPROMAccess(); 289 | 290 | } 291 | //This reads the 4 byte page from the EEPROM, updates the given value, and then writes this page back to the unit 292 | void ISL94202_writeEEPROM(uint8_t reg, uint8_t value) 293 | { 294 | if ((reg > 0x58 && reg < 0x7F) || reg > 0xAB) 295 | return; 296 | //^ Datasheet mentions a warning not to write to these areas as they are for factory use 297 | 298 | enableEEPROMAccess(); 299 | uint8_t buffer[4]; //We need to write in pages 300 | uint8_t i; 301 | uint8_t base = reg & 0xFC; 302 | buffer[0] = I2C_readReg8(ISLADDRESS, base); 303 | __delay_cycles(1000); //delay to allow EEPROM refresh 304 | I2C_readMany(ISLADDRESS, base, 4, buffer); 305 | 306 | //We have read in the buffer 307 | //Update the buffer 308 | buffer[(uint8_t) (reg & 0x03)] = value; 309 | 310 | I2C_writeReg8(ISLADDRESS, base, buffer[0]); 311 | __delay_cycles(35000); //delay to allow EEPROM write 312 | 313 | //^Special case for first uint8_t causing EEPROM reload 314 | for (i = 0; i < 4; i++) 315 | { 316 | I2C_writeReg8(ISLADDRESS, base + i, buffer[i]); 317 | __delay_cycles(35000); //35ms 318 | //pause for EEPROM write 319 | } 320 | 321 | disableEEPROMAccess(); 322 | } 323 | 324 | //Update the cell voltage and current readings from the unit 325 | void ISL94202_updateReadings() 326 | { 327 | //read from 0x8A 22 bytes 328 | I2C_readMany(ISLADDRESS, 0x8A, 22, CurrentVoltageBuffer); 329 | } 330 | 331 | //Updates the buffer of the status registers 332 | void ISL94202_updateStatus() 333 | { 334 | //Read from 0x80 5 bytes 335 | I2C_readMany(ISLADDRESS, 0x80, 5, CurrentStatusBuffer); 336 | } 337 | 338 | //returns the voltage measured at that cells input in millivolts 339 | uint16_t ISL94202_getCellVoltageMV(uint8_t index) 340 | { 341 | uint16_t r1 = CurrentVoltageBuffer[(index * 2) + 6]; 342 | uint16_t r2 = CurrentVoltageBuffer[(index * 2) + 7] & 0x0F; 343 | uint32_t reading = (uint16_t) (r2 << 8 | r1); 344 | 345 | reading *= 32; 346 | reading /= 27; 347 | //^ This is an integer approximation of the ideal 1.17216 (This one is 1.18) 348 | return reading; 349 | 350 | } 351 | 352 | //Returns the pack current in milliamps 353 | uint16_t ISL94202_getPackCurrentMA(uint16_t divisor) 354 | { 355 | uint32_t reading = CurrentVoltageBuffer[4] 356 | | ((CurrentVoltageBuffer[5] << 8) & 0x0F); 357 | 358 | reading *= 2; 359 | reading /= 2047; 360 | reading /= divisor; //to allow for calibration 361 | 362 | return reading; 363 | } 364 | 365 | //Returns a bitmask of the currently balancing cells 366 | uint8_t ISL94202_getBalancingCells() 367 | { 368 | return CurrentStatusBuffer[4]; 369 | } 370 | -------------------------------------------------------------------------------- /Electronics/BMS FrontEnd/CellFrontend.sch: -------------------------------------------------------------------------------- 1 | EESchema Schematic File Version 2 2 | LIBS:power 3 | LIBS:device 4 | LIBS:transistors 5 | LIBS:conn 6 | LIBS:linear 7 | LIBS:regul 8 | LIBS:74xx 9 | LIBS:cmos4000 10 | LIBS:adc-dac 11 | LIBS:memory 12 | LIBS:xilinx 13 | LIBS:microcontrollers 14 | LIBS:dsp 15 | LIBS:microchip 16 | LIBS:analog_switches 17 | LIBS:motorola 18 | LIBS:texas 19 | LIBS:intel 20 | LIBS:audio 21 | LIBS:interface 22 | LIBS:digital-audio 23 | LIBS:philips 24 | LIBS:display 25 | LIBS:cypress 26 | LIBS:siliconi 27 | LIBS:opto 28 | LIBS:atmel 29 | LIBS:contrib 30 | LIBS:valves 31 | LIBS:ISL94202 32 | LIBS:openbmsriser 33 | LIBS:mechanical 34 | LIBS:OpenBMSFrontEnd-cache 35 | EELAYER 25 0 36 | EELAYER END 37 | $Descr A4 8268 11693 portrait 38 | encoding utf-8 39 | Sheet 2 2 40 | Title "BMS Front End Balancing Drive" 41 | Date "2017-06-17" 42 | Rev "1" 43 | Comp "" 44 | Comment1 "" 45 | Comment2 "" 46 | Comment3 "" 47 | Comment4 "By Ben V. Browm" 48 | $EndDescr 49 | Text HLabel 2650 8700 0 60 Input ~ 0 50 | C0 51 | Text HLabel 2650 7900 0 60 Input ~ 0 52 | C1 53 | Text HLabel 2650 3900 0 60 Input ~ 0 54 | C6 55 | Text HLabel 2650 3100 0 60 Input ~ 0 56 | C7 57 | Text HLabel 2600 2300 0 60 Input ~ 0 58 | C8 59 | Text Notes 1000 4900 1 60 ~ 0 60 | Cell inputs from balance plug 61 | $Comp 62 | L R R204 63 | U 1 1 59170DF6 64 | P 3500 8050 65 | F 0 "R204" V 3580 8050 50 0000 C CNN 66 | F 1 "47R" V 3500 8050 50 0000 C CNN 67 | F 2 "Resistors_SMD:R_0805" V 3430 8050 50 0001 C CNN 68 | F 3 "" H 3500 8050 50 0001 C CNN 69 | F 4 "660-RK73B2ATTDD470J" H 3500 8050 60 0001 C CNN "bom_partno" 70 | 1 3500 8050 71 | 1 0 0 -1 72 | $EndComp 73 | $Comp 74 | L R R218 75 | U 1 1 59170E52 76 | P 3950 8400 77 | F 0 "R218" V 4030 8400 50 0000 C CNN 78 | F 1 "10k" V 3950 8400 50 0000 C CNN 79 | F 2 "Resistors_SMD:R_0603" V 3880 8400 50 0001 C CNN 80 | F 3 "" H 3950 8400 50 0001 C CNN 81 | F 4 "71-CRCW0603-10K-E3" H 3950 8400 60 0001 C CNN "bom_partno" 82 | 1 3950 8400 83 | 0 -1 -1 0 84 | $EndComp 85 | $Comp 86 | L R R208 87 | U 1 1 59170E9D 88 | P 3800 8550 89 | F 0 "R208" V 3880 8550 50 0000 C CNN 90 | F 1 "330k" V 3800 8550 50 0000 C CNN 91 | F 2 "Resistors_SMD:R_0603" V 3730 8550 50 0001 C CNN 92 | F 3 "" H 3800 8550 50 0001 C CNN 93 | F 4 "660-RK73B1JTTDD334J" H 3800 8550 60 0001 C CNN "bom_partno" 94 | 1 3800 8550 95 | 1 0 0 -1 96 | $EndComp 97 | $Comp 98 | L R R203 99 | U 1 1 59171050 100 | P 3500 7250 101 | F 0 "R203" V 3580 7250 50 0000 C CNN 102 | F 1 "47R" V 3500 7250 50 0000 C CNN 103 | F 2 "Resistors_SMD:R_0805" V 3430 7250 50 0001 C CNN 104 | F 3 "" H 3500 7250 50 0001 C CNN 105 | F 4 "660-RK73B2ATTDD470J" H 3500 7250 60 0001 C CNN "bom_partno" 106 | 1 3500 7250 107 | 1 0 0 -1 108 | $EndComp 109 | $Comp 110 | L R R216 111 | U 1 1 59171056 112 | P 3950 7600 113 | F 0 "R216" V 4030 7600 50 0000 C CNN 114 | F 1 "10k" V 3950 7600 50 0000 C CNN 115 | F 2 "Resistors_SMD:R_0603" V 3880 7600 50 0001 C CNN 116 | F 3 "" H 3950 7600 50 0001 C CNN 117 | F 4 "71-CRCW0603-10K-E3" H 3950 7600 60 0001 C CNN "bom_partno" 118 | 1 3950 7600 119 | 0 -1 -1 0 120 | $EndComp 121 | $Comp 122 | L R R207 123 | U 1 1 5917105C 124 | P 3800 7750 125 | F 0 "R207" V 3880 7750 50 0000 C CNN 126 | F 1 "330k" V 3800 7750 50 0000 C CNN 127 | F 2 "Resistors_SMD:R_0603" V 3730 7750 50 0001 C CNN 128 | F 3 "" H 3800 7750 50 0001 C CNN 129 | F 4 "660-RK73B1JTTDD334J" H 3800 7750 60 0001 C CNN "bom_partno" 130 | 1 3800 7750 131 | 1 0 0 -1 132 | $EndComp 133 | $Comp 134 | L R R217 135 | U 1 1 591712AD 136 | P 3950 7900 137 | F 0 "R217" V 4030 7900 50 0000 C CNN 138 | F 1 "1k" V 3950 7900 50 0000 C CNN 139 | F 2 "Resistors_SMD:R_0603" V 3880 7900 50 0001 C CNN 140 | F 3 "" H 3950 7900 50 0001 C CNN 141 | F 4 "71-CRCW0603-1.0K-E3" H 3950 7900 60 0001 C CNN "bom_partno" 142 | 1 3950 7900 143 | 0 1 1 0 144 | $EndComp 145 | $Comp 146 | L R R219 147 | U 1 1 5917139E 148 | P 3950 8700 149 | F 0 "R219" V 4030 8700 50 0000 C CNN 150 | F 1 "1k" V 3950 8700 50 0000 C CNN 151 | F 2 "Resistors_SMD:R_0603" V 3880 8700 50 0001 C CNN 152 | F 3 "" H 3950 8700 50 0001 C CNN 153 | F 4 "71-CRCW0603-1.0K-E3" H 3950 8700 60 0001 C CNN "bom_partno" 154 | 1 3950 8700 155 | 0 1 1 0 156 | $EndComp 157 | Text Notes 3575 8975 2 60 ~ 0 158 | C0==VC0==GND 159 | $Comp 160 | L Q_PMOS_GSD Q202 161 | U 1 1 5917199B 162 | P 3600 3400 163 | F 0 "Q202" H 3800 3450 50 0000 L CNN 164 | F 1 "NDS0605" H 3800 3350 50 0000 L CNN 165 | F 2 "TO_SOT_Packages_SMD:SOT-23" H 3800 3500 50 0001 C CNN 166 | F 3 "" H 3600 3400 50 0001 C CNN 167 | F 4 "512-NDS0605" H 3600 3400 60 0001 C CNN "bom_partno" 168 | 1 3600 3400 169 | -1 0 0 1 170 | $EndComp 171 | $Comp 172 | L R R202 173 | U 1 1 591719A1 174 | P 3500 3750 175 | F 0 "R202" V 3580 3750 50 0000 C CNN 176 | F 1 "47R" V 3500 3750 50 0000 C CNN 177 | F 2 "Resistors_SMD:R_0805" V 3430 3750 50 0001 C CNN 178 | F 3 "" H 3500 3750 50 0001 C CNN 179 | F 4 "660-RK73B2ATTDD470J" H 3500 3750 60 0001 C CNN "bom_partno" 180 | 1 3500 3750 181 | 1 0 0 -1 182 | $EndComp 183 | $Comp 184 | L R R212 185 | U 1 1 591719A7 186 | P 3950 3400 187 | F 0 "R212" V 4030 3400 50 0000 C CNN 188 | F 1 "10k" V 3950 3400 50 0000 C CNN 189 | F 2 "Resistors_SMD:R_0603" V 3880 3400 50 0001 C CNN 190 | F 3 "" H 3950 3400 50 0001 C CNN 191 | F 4 "71-CRCW0603-10K-E3" H 3950 3400 60 0001 C CNN "bom_partno" 192 | 1 3950 3400 193 | 0 -1 -1 0 194 | $EndComp 195 | $Comp 196 | L R R206 197 | U 1 1 591719AD 198 | P 3800 3250 199 | F 0 "R206" V 3900 3250 50 0000 C CNN 200 | F 1 "330k" V 3800 3250 50 0000 C CNN 201 | F 2 "Resistors_SMD:R_0603" V 3730 3250 50 0001 C CNN 202 | F 3 "" H 3800 3250 50 0001 C CNN 203 | F 4 "660-RK73B1JTTDD334J" H 3800 3250 60 0001 C CNN "bom_partno" 204 | 1 3800 3250 205 | 1 0 0 -1 206 | $EndComp 207 | $Comp 208 | L Q_PMOS_GSD Q201 209 | U 1 1 591719B6 210 | P 3600 2600 211 | F 0 "Q201" H 3800 2650 50 0000 L CNN 212 | F 1 "NDS0605" H 3800 2550 50 0000 L CNN 213 | F 2 "TO_SOT_Packages_SMD:SOT-23" H 3800 2700 50 0001 C CNN 214 | F 3 "" H 3600 2600 50 0001 C CNN 215 | F 4 "512-NDS0605" H 3600 2600 60 0001 C CNN "bom_partno" 216 | 1 3600 2600 217 | -1 0 0 1 218 | $EndComp 219 | $Comp 220 | L R R201 221 | U 1 1 591719BC 222 | P 3500 2950 223 | F 0 "R201" V 3580 2950 50 0000 C CNN 224 | F 1 "47R" V 3500 2950 50 0000 C CNN 225 | F 2 "Resistors_SMD:R_0805" V 3430 2950 50 0001 C CNN 226 | F 3 "" H 3500 2950 50 0001 C CNN 227 | F 4 "660-RK73B2ATTDD470J" H 3500 2950 60 0001 C CNN "bom_partno" 228 | 1 3500 2950 229 | 1 0 0 -1 230 | $EndComp 231 | $Comp 232 | L R R210 233 | U 1 1 591719C2 234 | P 3950 2600 235 | F 0 "R210" V 4030 2600 50 0000 C CNN 236 | F 1 "10k" V 3950 2600 50 0000 C CNN 237 | F 2 "Resistors_SMD:R_0603" V 3880 2600 50 0001 C CNN 238 | F 3 "" H 3950 2600 50 0001 C CNN 239 | F 4 "71-CRCW0603-10K-E3" H 3950 2600 60 0001 C CNN "bom_partno" 240 | 1 3950 2600 241 | 0 -1 -1 0 242 | $EndComp 243 | $Comp 244 | L R R205 245 | U 1 1 591719C8 246 | P 3800 2450 247 | F 0 "R205" V 3900 2450 50 0000 C CNN 248 | F 1 "330k" V 3800 2450 50 0000 C CNN 249 | F 2 "Resistors_SMD:R_0603" V 3730 2450 50 0001 C CNN 250 | F 3 "" H 3800 2450 50 0001 C CNN 251 | F 4 "660-RK73B1JTTDD334J" H 3800 2450 60 0001 C CNN "bom_partno" 252 | 1 3800 2450 253 | 1 0 0 -1 254 | $EndComp 255 | $Comp 256 | L R R211 257 | U 1 1 591719D1 258 | P 3950 3100 259 | F 0 "R211" V 4030 3100 50 0000 C CNN 260 | F 1 "1k" V 3950 3100 50 0000 C CNN 261 | F 2 "Resistors_SMD:R_0603" V 3880 3100 50 0001 C CNN 262 | F 3 "" H 3950 3100 50 0001 C CNN 263 | F 4 "71-CRCW0603-1.0K-E3" H 3950 3100 60 0001 C CNN "bom_partno" 264 | 1 3950 3100 265 | 0 1 1 0 266 | $EndComp 267 | $Comp 268 | L R R213 269 | U 1 1 591719D7 270 | P 3950 3900 271 | F 0 "R213" V 4030 3900 50 0000 C CNN 272 | F 1 "1k" V 3950 3900 50 0000 C CNN 273 | F 2 "Resistors_SMD:R_0603" V 3880 3900 50 0001 C CNN 274 | F 3 "" H 3950 3900 50 0001 C CNN 275 | F 4 "71-CRCW0603-1.0K-E3" H 3950 3900 60 0001 C CNN "bom_partno" 276 | 1 3950 3900 277 | 0 1 1 0 278 | $EndComp 279 | Wire Wire Line 280 | 2650 8700 3800 8700 281 | Wire Wire Line 282 | 3500 8700 3500 8600 283 | Connection ~ 3500 8700 284 | Wire Wire Line 285 | 2650 7900 3800 7900 286 | Connection ~ 3500 7900 287 | Wire Wire Line 288 | 2650 3900 3800 3900 289 | Connection ~ 3500 3900 290 | Wire Wire Line 291 | 2650 3100 3800 3100 292 | Connection ~ 3500 3100 293 | Connection ~ 3500 2300 294 | $Comp 295 | L R R209 296 | U 1 1 5917BB29 297 | P 3950 2300 298 | F 0 "R209" V 4030 2300 50 0000 C CNN 299 | F 1 "1k" V 3950 2300 50 0000 C CNN 300 | F 2 "Resistors_SMD:R_0603" V 3880 2300 50 0001 C CNN 301 | F 3 "" H 3950 2300 50 0001 C CNN 302 | F 4 "71-CRCW0603-1.0K-E3" H 3950 2300 60 0001 C CNN "bom_partno" 303 | 1 3950 2300 304 | 0 1 1 0 305 | $EndComp 306 | Wire Wire Line 307 | 2600 2300 3800 2300 308 | $Comp 309 | L Q_NMOS_GSD Q203 310 | U 1 1 5917D016 311 | P 3600 7600 312 | F 0 "Q203" H 3800 7650 50 0000 L CNN 313 | F 1 "NDS7002A" H 3800 7550 50 0000 L CNN 314 | F 2 "TO_SOT_Packages_SMD:SOT-23" H 3800 7700 50 0001 C CNN 315 | F 3 "" H 3600 7600 50 0001 C CNN 316 | F 4 "512-NDS7002A" H 3600 7600 60 0001 C CNN "bom_partno" 317 | 1 3600 7600 318 | -1 0 0 -1 319 | $EndComp 320 | $Comp 321 | L Q_NMOS_GSD Q204 322 | U 1 1 5917D4B4 323 | P 3600 8400 324 | F 0 "Q204" H 3800 8450 50 0000 L CNN 325 | F 1 "NDS7002A" H 3800 8350 50 0000 L CNN 326 | F 2 "TO_SOT_Packages_SMD:SOT-23" H 3800 8500 50 0001 C CNN 327 | F 3 "" H 3600 8400 50 0001 C CNN 328 | F 4 "512-NDS7002A" H 3600 8400 60 0001 C CNN "bom_partno" 329 | 1 3600 8400 330 | -1 0 0 -1 331 | $EndComp 332 | Wire Wire Line 333 | 3500 2400 3500 2300 334 | Text HLabel 4100 2300 2 60 Input ~ 0 335 | VC8 336 | Text HLabel 4100 2600 2 60 Input ~ 0 337 | CB8 338 | Text HLabel 4100 3100 2 60 Input ~ 0 339 | VC7 340 | Text HLabel 4100 3400 2 60 Input ~ 0 341 | CB7 342 | Text HLabel 4100 3900 2 60 Input ~ 0 343 | VC6 344 | Text HLabel 4100 7600 2 60 Input ~ 0 345 | CB2 346 | Text HLabel 4100 7900 2 60 Input ~ 0 347 | VC1 348 | Text HLabel 4100 8400 2 60 Input ~ 0 349 | CB1 350 | Text HLabel 4100 8700 2 60 Input ~ 0 351 | VC0 352 | Wire Wire Line 353 | 3500 3200 3500 3100 354 | Wire Wire Line 355 | 3500 7800 3500 7900 356 | Connection ~ 3800 7600 357 | Connection ~ 3800 7900 358 | Connection ~ 3500 7100 359 | Text HLabel 2650 4700 0 60 Input ~ 0 360 | C5 361 | $Comp 362 | L Q_PMOS_GSD Q1 363 | U 1 1 59457C68 364 | P 3600 4200 365 | F 0 "Q1" H 3800 4250 50 0000 L CNN 366 | F 1 "NDS0605" H 3800 4150 50 0000 L CNN 367 | F 2 "TO_SOT_Packages_SMD:SOT-23" H 3800 4300 50 0001 C CNN 368 | F 3 "" H 3600 4200 50 0001 C CNN 369 | F 4 "512-NDS0605" H 3600 4200 60 0001 C CNN "bom_partno" 370 | 1 3600 4200 371 | -1 0 0 1 372 | $EndComp 373 | $Comp 374 | L R R1 375 | U 1 1 59457C6F 376 | P 3500 4550 377 | F 0 "R1" V 3580 4550 50 0000 C CNN 378 | F 1 "47R" V 3500 4550 50 0000 C CNN 379 | F 2 "Resistors_SMD:R_0805" V 3430 4550 50 0001 C CNN 380 | F 3 "" H 3500 4550 50 0001 C CNN 381 | F 4 "660-RK73B2ATTDD470J" H 3500 4550 60 0001 C CNN "bom_partno" 382 | 1 3500 4550 383 | 1 0 0 -1 384 | $EndComp 385 | $Comp 386 | L R R9 387 | U 1 1 59457C76 388 | P 3950 4200 389 | F 0 "R9" V 4030 4200 50 0000 C CNN 390 | F 1 "10k" V 3950 4200 50 0000 C CNN 391 | F 2 "Resistors_SMD:R_0603" V 3880 4200 50 0001 C CNN 392 | F 3 "" H 3950 4200 50 0001 C CNN 393 | F 4 "71-CRCW0603-10K-E3" H 3950 4200 60 0001 C CNN "bom_partno" 394 | 1 3950 4200 395 | 0 -1 -1 0 396 | $EndComp 397 | $Comp 398 | L R R5 399 | U 1 1 59457C7D 400 | P 3800 4050 401 | F 0 "R5" V 3900 4050 50 0000 C CNN 402 | F 1 "330k" V 3800 4050 50 0000 C CNN 403 | F 2 "Resistors_SMD:R_0603" V 3730 4050 50 0001 C CNN 404 | F 3 "" H 3800 4050 50 0001 C CNN 405 | F 4 "660-RK73B1JTTDD334J" H 3800 4050 60 0001 C CNN "bom_partno" 406 | 1 3800 4050 407 | 1 0 0 -1 408 | $EndComp 409 | $Comp 410 | L R R10 411 | U 1 1 59457C84 412 | P 3950 4700 413 | F 0 "R10" V 4030 4700 50 0000 C CNN 414 | F 1 "1k" V 3950 4700 50 0000 C CNN 415 | F 2 "Resistors_SMD:R_0603" V 3880 4700 50 0001 C CNN 416 | F 3 "" H 3950 4700 50 0001 C CNN 417 | F 4 "71-CRCW0603-1.0K-E3" H 3950 4700 60 0001 C CNN "bom_partno" 418 | 1 3950 4700 419 | 0 1 1 0 420 | $EndComp 421 | Wire Wire Line 422 | 2650 4700 3800 4700 423 | Connection ~ 3500 4700 424 | Text HLabel 4100 4200 2 60 Input ~ 0 425 | CB6 426 | Text HLabel 4100 4700 2 60 Input ~ 0 427 | VC5 428 | Wire Wire Line 429 | 3500 4000 3500 3900 430 | Connection ~ 3800 2600 431 | Connection ~ 3800 3100 432 | Connection ~ 3800 3400 433 | Connection ~ 3800 2300 434 | Connection ~ 3800 3900 435 | Connection ~ 3800 4200 436 | Connection ~ 3800 4700 437 | Text HLabel 2650 5500 0 60 Input ~ 0 438 | C4 439 | $Comp 440 | L R R2 441 | U 1 1 594591FE 442 | P 3500 4850 443 | F 0 "R2" V 3580 4850 50 0000 C CNN 444 | F 1 "47R" V 3500 4850 50 0000 C CNN 445 | F 2 "Resistors_SMD:R_0805" V 3430 4850 50 0001 C CNN 446 | F 3 "" H 3500 4850 50 0001 C CNN 447 | F 4 "660-RK73B2ATTDD470J" H 3500 4850 60 0001 C CNN "bom_partno" 448 | 1 3500 4850 449 | 1 0 0 -1 450 | $EndComp 451 | $Comp 452 | L R R11 453 | U 1 1 59459205 454 | P 3950 5200 455 | F 0 "R11" V 4030 5200 50 0000 C CNN 456 | F 1 "10k" V 3950 5200 50 0000 C CNN 457 | F 2 "Resistors_SMD:R_0603" V 3880 5200 50 0001 C CNN 458 | F 3 "" H 3950 5200 50 0001 C CNN 459 | F 4 "71-CRCW0603-10K-E3" H 3950 5200 60 0001 C CNN "bom_partno" 460 | 1 3950 5200 461 | 0 -1 -1 0 462 | $EndComp 463 | $Comp 464 | L R R6 465 | U 1 1 5945920C 466 | P 3800 5350 467 | F 0 "R6" V 3880 5350 50 0000 C CNN 468 | F 1 "330k" V 3800 5350 50 0000 C CNN 469 | F 2 "Resistors_SMD:R_0603" V 3730 5350 50 0001 C CNN 470 | F 3 "" H 3800 5350 50 0001 C CNN 471 | F 4 "660-RK73B1JTTDD334J" H 3800 5350 60 0001 C CNN "bom_partno" 472 | 1 3800 5350 473 | 1 0 0 -1 474 | $EndComp 475 | $Comp 476 | L R R12 477 | U 1 1 59459213 478 | P 3950 5500 479 | F 0 "R12" V 4030 5500 50 0000 C CNN 480 | F 1 "1k" V 3950 5500 50 0000 C CNN 481 | F 2 "Resistors_SMD:R_0603" V 3880 5500 50 0001 C CNN 482 | F 3 "" H 3950 5500 50 0001 C CNN 483 | F 4 "71-CRCW0603-1.0K-E3" H 3950 5500 60 0001 C CNN "bom_partno" 484 | 1 3950 5500 485 | 0 1 1 0 486 | $EndComp 487 | Wire Wire Line 488 | 2650 5500 3800 5500 489 | Connection ~ 3500 5500 490 | $Comp 491 | L Q_NMOS_GSD Q2 492 | U 1 1 5945921C 493 | P 3600 5200 494 | F 0 "Q2" H 3800 5250 50 0000 L CNN 495 | F 1 "NDS7002A" H 3800 5150 50 0000 L CNN 496 | F 2 "TO_SOT_Packages_SMD:SOT-23" H 3800 5300 50 0001 C CNN 497 | F 3 "" H 3600 5200 50 0001 C CNN 498 | F 4 "512-NDS7002A" H 3600 5200 60 0001 C CNN "bom_partno" 499 | 1 3600 5200 500 | -1 0 0 -1 501 | $EndComp 502 | Text HLabel 4100 5200 2 60 Input ~ 0 503 | CB5 504 | Text HLabel 4100 5500 2 60 Input ~ 0 505 | VC4 506 | Wire Wire Line 507 | 3500 5400 3500 5500 508 | Connection ~ 3800 5200 509 | Connection ~ 3800 5500 510 | Text HLabel 2650 6300 0 60 Input ~ 0 511 | C3 512 | $Comp 513 | L R R3 514 | U 1 1 59459B53 515 | P 3500 5650 516 | F 0 "R3" V 3580 5650 50 0000 C CNN 517 | F 1 "47R" V 3500 5650 50 0000 C CNN 518 | F 2 "Resistors_SMD:R_0805" V 3430 5650 50 0001 C CNN 519 | F 3 "" H 3500 5650 50 0001 C CNN 520 | F 4 "660-RK73B2ATTDD470J" H 3500 5650 60 0001 C CNN "bom_partno" 521 | 1 3500 5650 522 | 1 0 0 -1 523 | $EndComp 524 | $Comp 525 | L R R13 526 | U 1 1 59459B5A 527 | P 3950 6000 528 | F 0 "R13" V 4030 6000 50 0000 C CNN 529 | F 1 "10k" V 3950 6000 50 0000 C CNN 530 | F 2 "Resistors_SMD:R_0603" V 3880 6000 50 0001 C CNN 531 | F 3 "" H 3950 6000 50 0001 C CNN 532 | F 4 "71-CRCW0603-10K-E3" H 3950 6000 60 0001 C CNN "bom_partno" 533 | 1 3950 6000 534 | 0 -1 -1 0 535 | $EndComp 536 | $Comp 537 | L R R7 538 | U 1 1 59459B61 539 | P 3800 6150 540 | F 0 "R7" V 3880 6150 50 0000 C CNN 541 | F 1 "330k" V 3800 6150 50 0000 C CNN 542 | F 2 "Resistors_SMD:R_0603" V 3730 6150 50 0001 C CNN 543 | F 3 "" H 3800 6150 50 0001 C CNN 544 | F 4 "660-RK73B1JTTDD334J" H 3800 6150 60 0001 C CNN "bom_partno" 545 | 1 3800 6150 546 | 1 0 0 -1 547 | $EndComp 548 | $Comp 549 | L R R14 550 | U 1 1 59459B68 551 | P 3950 6300 552 | F 0 "R14" V 4030 6300 50 0000 C CNN 553 | F 1 "1k" V 3950 6300 50 0000 C CNN 554 | F 2 "Resistors_SMD:R_0603" V 3880 6300 50 0001 C CNN 555 | F 3 "" H 3950 6300 50 0001 C CNN 556 | F 4 "71-CRCW0603-1.0K-E3" H 3950 6300 60 0001 C CNN "bom_partno" 557 | 1 3950 6300 558 | 0 1 1 0 559 | $EndComp 560 | Wire Wire Line 561 | 2650 6300 3800 6300 562 | Connection ~ 3500 6300 563 | $Comp 564 | L Q_NMOS_GSD Q3 565 | U 1 1 59459B71 566 | P 3600 6000 567 | F 0 "Q3" H 3800 6050 50 0000 L CNN 568 | F 1 "NDS7002A" H 3800 5950 50 0000 L CNN 569 | F 2 "TO_SOT_Packages_SMD:SOT-23" H 3800 6100 50 0001 C CNN 570 | F 3 "" H 3600 6000 50 0001 C CNN 571 | F 4 "512-NDS7002A" H 3600 6000 60 0001 C CNN "bom_partno" 572 | 1 3600 6000 573 | -1 0 0 -1 574 | $EndComp 575 | Text HLabel 4100 6000 2 60 Input ~ 0 576 | CB4 577 | Text HLabel 4100 6300 2 60 Input ~ 0 578 | VC3 579 | Wire Wire Line 580 | 3500 6200 3500 6300 581 | Connection ~ 3800 6000 582 | Connection ~ 3800 6300 583 | Text HLabel 2650 7100 0 60 Input ~ 0 584 | C2 585 | $Comp 586 | L R R4 587 | U 1 1 5945A092 588 | P 3500 6450 589 | F 0 "R4" V 3580 6450 50 0000 C CNN 590 | F 1 "47R" V 3500 6450 50 0000 C CNN 591 | F 2 "Resistors_SMD:R_0805" V 3430 6450 50 0001 C CNN 592 | F 3 "" H 3500 6450 50 0001 C CNN 593 | F 4 "660-RK73B2ATTDD470J" H 3500 6450 60 0001 C CNN "bom_partno" 594 | 1 3500 6450 595 | 1 0 0 -1 596 | $EndComp 597 | $Comp 598 | L R R15 599 | U 1 1 5945A099 600 | P 3950 6800 601 | F 0 "R15" V 4030 6800 50 0000 C CNN 602 | F 1 "10k" V 3950 6800 50 0000 C CNN 603 | F 2 "Resistors_SMD:R_0603" V 3880 6800 50 0001 C CNN 604 | F 3 "" H 3950 6800 50 0001 C CNN 605 | F 4 "71-CRCW0603-10K-E3" H 3950 6800 60 0001 C CNN "bom_partno" 606 | 1 3950 6800 607 | 0 -1 -1 0 608 | $EndComp 609 | $Comp 610 | L R R8 611 | U 1 1 5945A0A0 612 | P 3800 6950 613 | F 0 "R8" V 3880 6950 50 0000 C CNN 614 | F 1 "330k" V 3800 6950 50 0000 C CNN 615 | F 2 "Resistors_SMD:R_0603" V 3730 6950 50 0001 C CNN 616 | F 3 "" H 3800 6950 50 0001 C CNN 617 | F 4 "660-RK73B1JTTDD334J" H 3800 6950 60 0001 C CNN "bom_partno" 618 | 1 3800 6950 619 | 1 0 0 -1 620 | $EndComp 621 | $Comp 622 | L R R16 623 | U 1 1 5945A0A7 624 | P 3950 7100 625 | F 0 "R16" V 4030 7100 50 0000 C CNN 626 | F 1 "1k" V 3950 7100 50 0000 C CNN 627 | F 2 "Resistors_SMD:R_0603" V 3880 7100 50 0001 C CNN 628 | F 3 "" H 3950 7100 50 0001 C CNN 629 | F 4 "71-CRCW0603-1.0K-E3" H 3950 7100 60 0001 C CNN "bom_partno" 630 | 1 3950 7100 631 | 0 1 1 0 632 | $EndComp 633 | Wire Wire Line 634 | 2650 7100 3800 7100 635 | $Comp 636 | L Q_NMOS_GSD Q4 637 | U 1 1 5945A0B0 638 | P 3600 6800 639 | F 0 "Q4" H 3800 6850 50 0000 L CNN 640 | F 1 "NDS7002A" H 3800 6750 50 0000 L CNN 641 | F 2 "TO_SOT_Packages_SMD:SOT-23" H 3800 6900 50 0001 C CNN 642 | F 3 "" H 3600 6800 50 0001 C CNN 643 | F 4 "512-NDS7002A" H 3600 6800 60 0001 C CNN "bom_partno" 644 | 1 3600 6800 645 | -1 0 0 -1 646 | $EndComp 647 | Text HLabel 4100 6800 2 60 Input ~ 0 648 | CB3 649 | Text HLabel 4100 7100 2 60 Input ~ 0 650 | VC2 651 | Wire Wire Line 652 | 3500 7000 3500 7100 653 | Connection ~ 3800 6800 654 | Connection ~ 3800 7100 655 | $EndSCHEMATC 656 | -------------------------------------------------------------------------------- /Electronics/BMS GUI/Front Panel.sch: -------------------------------------------------------------------------------- 1 | EESchema Schematic File Version 2 2 | LIBS:power 3 | LIBS:device 4 | LIBS:transistors 5 | LIBS:conn 6 | LIBS:linear 7 | LIBS:regul 8 | LIBS:interface 9 | LIBS:display 10 | LIBS:opto 11 | LIBS:contrib 12 | LIBS:msp430 13 | LIBS:switches 14 | LIBS:Front Panel-cache 15 | EELAYER 25 0 16 | EELAYER END 17 | $Descr A4 11693 8268 18 | encoding utf-8 19 | Sheet 1 1 20 | Title "OpenBMS Front Panel" 21 | Date "2017-07-08" 22 | Rev "V1.0" 23 | Comp "RalimTEk.com" 24 | Comment1 "" 25 | Comment2 "" 26 | Comment3 "" 27 | Comment4 "Designed By Ben V. Brown" 28 | $EndDescr 29 | $Comp 30 | L MSP430G2755IDA38 U101 31 | U 1 1 59464EB2 32 | P 5400 2375 33 | F 0 "U101" H 4450 3375 50 0000 C CNN 34 | F 1 "MSP430G2755IDA38" H 6100 1375 50 0000 C CNN 35 | F 2 "Housings_SSOP:TSSOP-38_4.4x9.7mm_Pitch0.5mm" H 4500 1375 50 0001 C CIN 36 | F 3 "" H 5400 2375 50 0001 C CNN 37 | 1 5400 2375 38 | 1 0 0 -1 39 | $EndComp 40 | $Comp 41 | L VDD #PWR01 42 | U 1 1 59464EE8 43 | P 5600 1275 44 | F 0 "#PWR01" H 5600 1125 50 0001 C CNN 45 | F 1 "VDD" H 5600 1425 50 0000 C CNN 46 | F 2 "" H 5600 1275 50 0001 C CNN 47 | F 3 "" H 5600 1275 50 0001 C CNN 48 | 1 5600 1275 49 | 1 0 0 -1 50 | $EndComp 51 | $Comp 52 | L VDD #PWR02 53 | U 1 1 59464F07 54 | P 5200 1275 55 | F 0 "#PWR02" H 5200 1125 50 0001 C CNN 56 | F 1 "VDD" H 5200 1425 50 0000 C CNN 57 | F 2 "" H 5200 1275 50 0001 C CNN 58 | F 3 "" H 5200 1275 50 0001 C CNN 59 | 1 5200 1275 60 | 1 0 0 -1 61 | $EndComp 62 | $Comp 63 | L GND #PWR03 64 | U 1 1 59464F24 65 | P 5600 3475 66 | F 0 "#PWR03" H 5600 3225 50 0001 C CNN 67 | F 1 "GND" H 5600 3325 50 0000 C CNN 68 | F 2 "" H 5600 3475 50 0001 C CNN 69 | F 3 "" H 5600 3475 50 0001 C CNN 70 | 1 5600 3475 71 | 1 0 0 -1 72 | $EndComp 73 | $Comp 74 | L GND #PWR04 75 | U 1 1 59464F3A 76 | P 5200 3475 77 | F 0 "#PWR04" H 5200 3225 50 0001 C CNN 78 | F 1 "GND" H 5200 3325 50 0000 C CNN 79 | F 2 "" H 5200 3475 50 0001 C CNN 80 | F 3 "" H 5200 3475 50 0001 C CNN 81 | 1 5200 3475 82 | 1 0 0 -1 83 | $EndComp 84 | $Comp 85 | L OpenBMSRiser J101 86 | U 1 1 59464FA2 87 | P 9975 1325 88 | F 0 "J101" H 9975 1325 60 0000 C CNN 89 | F 1 "OpenBMSRiser" H 9975 1225 60 0000 C CNN 90 | F 2 "BMSFootprints:OpenBMSRiser" H 9975 1325 60 0001 C CNN 91 | F 3 "" H 9975 1325 60 0001 C CNN 92 | 1 9975 1325 93 | 1 0 0 -1 94 | $EndComp 95 | Text Label 9375 1575 2 60 ~ 0 96 | GND 97 | Text Label 9375 2175 2 60 ~ 0 98 | VDD 99 | Text Label 9375 2075 2 60 ~ 0 100 | ~SD 101 | Text Label 9375 1975 2 60 ~ 0 102 | FETSOFF 103 | Text Label 9375 1875 2 60 ~ 0 104 | ~INT 105 | Text Label 9375 1775 2 60 ~ 0 106 | SDA 107 | Text Label 9375 1675 2 60 ~ 0 108 | SCL 109 | Text Label 4250 2625 2 60 ~ 0 110 | SDA 111 | Text Label 4250 2725 2 60 ~ 0 112 | SCL 113 | Text Label 4250 2925 2 60 ~ 0 114 | MOSI 115 | Text Label 4250 3025 2 60 ~ 0 116 | MISO 117 | $Comp 118 | L LED D105 119 | U 1 1 594651D3 120 | P 2250 2625 121 | F 0 "D105" H 2250 2725 50 0000 C CNN 122 | F 1 "LED" H 2250 2525 50 0000 C CNN 123 | F 2 "LEDs:LED_0805" H 2250 2625 50 0001 C CNN 124 | F 3 "" H 2250 2625 50 0001 C CNN 125 | 1 2250 2625 126 | 0 -1 -1 0 127 | $EndComp 128 | $Comp 129 | L R R105 130 | U 1 1 594652C6 131 | P 3900 1675 132 | F 0 "R105" V 3980 1675 50 0000 C CNN 133 | F 1 "1k" V 3900 1675 50 0000 C CNN 134 | F 2 "Resistors_SMD:R_0603" V 3830 1675 50 0001 C CNN 135 | F 3 "" H 3900 1675 50 0001 C CNN 136 | 1 3900 1675 137 | 0 1 1 0 138 | $EndComp 139 | $Comp 140 | L R R101 141 | U 1 1 59465372 142 | P 3600 1775 143 | F 0 "R101" V 3680 1775 50 0000 C CNN 144 | F 1 "1k" V 3600 1775 50 0000 C CNN 145 | F 2 "Resistors_SMD:R_0603" V 3530 1775 50 0001 C CNN 146 | F 3 "" H 3600 1775 50 0001 C CNN 147 | 1 3600 1775 148 | 0 1 1 0 149 | $EndComp 150 | $Comp 151 | L R R106 152 | U 1 1 594653AB 153 | P 3900 1875 154 | F 0 "R106" V 3980 1875 50 0000 C CNN 155 | F 1 "1k" V 3900 1875 50 0000 C CNN 156 | F 2 "Resistors_SMD:R_0603" V 3830 1875 50 0001 C CNN 157 | F 3 "" H 3900 1875 50 0001 C CNN 158 | 1 3900 1875 159 | 0 1 1 0 160 | $EndComp 161 | $Comp 162 | L R R102 163 | U 1 1 594653DB 164 | P 3600 1975 165 | F 0 "R102" V 3680 1975 50 0000 C CNN 166 | F 1 "1k" V 3600 1975 50 0000 C CNN 167 | F 2 "Resistors_SMD:R_0603" V 3530 1975 50 0001 C CNN 168 | F 3 "" H 3600 1975 50 0001 C CNN 169 | 1 3600 1975 170 | 0 1 1 0 171 | $EndComp 172 | $Comp 173 | L R R107 174 | U 1 1 59465410 175 | P 3900 2075 176 | F 0 "R107" V 3980 2075 50 0000 C CNN 177 | F 1 "1k" V 3900 2075 50 0000 C CNN 178 | F 2 "Resistors_SMD:R_0603" V 3830 2075 50 0001 C CNN 179 | F 3 "" H 3900 2075 50 0001 C CNN 180 | 1 3900 2075 181 | 0 1 1 0 182 | $EndComp 183 | $Comp 184 | L R R103 185 | U 1 1 59465452 186 | P 3600 2175 187 | F 0 "R103" V 3680 2175 50 0000 C CNN 188 | F 1 "1k" V 3600 2175 50 0000 C CNN 189 | F 2 "Resistors_SMD:R_0603" V 3530 2175 50 0001 C CNN 190 | F 3 "" H 3600 2175 50 0001 C CNN 191 | 1 3600 2175 192 | 0 1 1 0 193 | $EndComp 194 | $Comp 195 | L R R108 196 | U 1 1 5946548F 197 | P 3900 2275 198 | F 0 "R108" V 3980 2275 50 0000 C CNN 199 | F 1 "1k" V 3900 2275 50 0000 C CNN 200 | F 2 "Resistors_SMD:R_0603" V 3830 2275 50 0001 C CNN 201 | F 3 "" H 3900 2275 50 0001 C CNN 202 | 1 3900 2275 203 | 0 1 1 0 204 | $EndComp 205 | $Comp 206 | L R R104 207 | U 1 1 594654CD 208 | P 3600 2375 209 | F 0 "R104" V 3680 2375 50 0000 C CNN 210 | F 1 "1k" V 3600 2375 50 0000 C CNN 211 | F 2 "Resistors_SMD:R_0603" V 3530 2375 50 0001 C CNN 212 | F 3 "" H 3600 2375 50 0001 C CNN 213 | 1 3600 2375 214 | 0 1 1 0 215 | $EndComp 216 | $Comp 217 | L LED D106 218 | U 1 1 594656FB 219 | P 2525 2625 220 | F 0 "D106" H 2525 2725 50 0000 C CNN 221 | F 1 "LED" H 2525 2525 50 0000 C CNN 222 | F 2 "LEDs:LED_0805" H 2525 2625 50 0001 C CNN 223 | F 3 "" H 2525 2625 50 0001 C CNN 224 | 1 2525 2625 225 | 0 -1 -1 0 226 | $EndComp 227 | $Comp 228 | L LED D107 229 | U 1 1 59465739 230 | P 2800 2625 231 | F 0 "D107" H 2800 2725 50 0000 C CNN 232 | F 1 "LED" H 2800 2525 50 0000 C CNN 233 | F 2 "LEDs:LED_0805" H 2800 2625 50 0001 C CNN 234 | F 3 "" H 2800 2625 50 0001 C CNN 235 | 1 2800 2625 236 | 0 -1 -1 0 237 | $EndComp 238 | $Comp 239 | L LED D108 240 | U 1 1 59465782 241 | P 3075 2625 242 | F 0 "D108" H 3075 2725 50 0000 C CNN 243 | F 1 "LED" H 3075 2525 50 0000 C CNN 244 | F 2 "LEDs:LED_0805" H 3075 2625 50 0001 C CNN 245 | F 3 "" H 3075 2625 50 0001 C CNN 246 | 1 3075 2625 247 | 0 -1 -1 0 248 | $EndComp 249 | $Comp 250 | L LED D101 251 | U 1 1 594658A4 252 | P 1150 2625 253 | F 0 "D101" H 1150 2725 50 0000 C CNN 254 | F 1 "LED" H 1150 2525 50 0000 C CNN 255 | F 2 "LEDs:LED_0805" H 1150 2625 50 0001 C CNN 256 | F 3 "" H 1150 2625 50 0001 C CNN 257 | 1 1150 2625 258 | 0 -1 -1 0 259 | $EndComp 260 | $Comp 261 | L LED D102 262 | U 1 1 594658AA 263 | P 1425 2625 264 | F 0 "D102" H 1425 2725 50 0000 C CNN 265 | F 1 "LED" H 1425 2525 50 0000 C CNN 266 | F 2 "LEDs:LED_0805" H 1425 2625 50 0001 C CNN 267 | F 3 "" H 1425 2625 50 0001 C CNN 268 | 1 1425 2625 269 | 0 -1 -1 0 270 | $EndComp 271 | $Comp 272 | L LED D103 273 | U 1 1 594658B0 274 | P 1700 2625 275 | F 0 "D103" H 1700 2725 50 0000 C CNN 276 | F 1 "LED" H 1700 2525 50 0000 C CNN 277 | F 2 "LEDs:LED_0805" H 1700 2625 50 0001 C CNN 278 | F 3 "" H 1700 2625 50 0001 C CNN 279 | 1 1700 2625 280 | 0 -1 -1 0 281 | $EndComp 282 | $Comp 283 | L LED D104 284 | U 1 1 594658B6 285 | P 1975 2625 286 | F 0 "D104" H 1975 2725 50 0000 C CNN 287 | F 1 "LED" H 1975 2525 50 0000 C CNN 288 | F 2 "LEDs:LED_0805" H 1975 2625 50 0001 C CNN 289 | F 3 "" H 1975 2625 50 0001 C CNN 290 | 1 1975 2625 291 | 0 -1 -1 0 292 | $EndComp 293 | $Comp 294 | L GND #PWR05 295 | U 1 1 59465F07 296 | P 2100 2925 297 | F 0 "#PWR05" H 2100 2675 50 0001 C CNN 298 | F 1 "GND" H 2100 2775 50 0000 C CNN 299 | F 2 "" H 2100 2925 50 0001 C CNN 300 | F 3 "" H 2100 2925 50 0001 C CNN 301 | 1 2100 2925 302 | 1 0 0 -1 303 | $EndComp 304 | $Comp 305 | L R R109 306 | U 1 1 594663E0 307 | P 4150 1275 308 | F 0 "R109" V 4230 1275 50 0000 C CNN 309 | F 1 "10k" V 4150 1275 50 0000 C CNN 310 | F 2 "Resistors_SMD:R_0603" V 4080 1275 50 0001 C CNN 311 | F 3 "" H 4150 1275 50 0001 C CNN 312 | 1 4150 1275 313 | -1 0 0 1 314 | $EndComp 315 | $Comp 316 | L VDD #PWR06 317 | U 1 1 59466476 318 | P 4150 1125 319 | F 0 "#PWR06" H 4150 975 50 0001 C CNN 320 | F 1 "VDD" H 4150 1275 50 0000 C CNN 321 | F 2 "" H 4150 1125 50 0001 C CNN 322 | F 3 "" H 4150 1125 50 0001 C CNN 323 | 1 4150 1125 324 | 1 0 0 -1 325 | $EndComp 326 | Text Label 4250 3225 2 60 ~ 0 327 | CS 328 | $Comp 329 | L JLX12864G U102 330 | U 1 1 59466F08 331 | P 9975 3375 332 | F 0 "U102" H 9975 4125 60 0000 C CNN 333 | F 1 "JLX12864G" H 9975 4225 60 0000 C CNN 334 | F 2 "BMSFootprints:JLX12864G" H 9975 4075 60 0001 C CNN 335 | F 3 "" H 9975 4075 60 0001 C CNN 336 | 1 9975 3375 337 | 1 0 0 -1 338 | $EndComp 339 | Text Label 9425 3325 2 60 ~ 0 340 | GND 341 | Text Label 9425 3425 2 60 ~ 0 342 | VDD 343 | Text Label 9425 3525 2 60 ~ 0 344 | CLK 345 | Text Label 9425 3625 2 60 ~ 0 346 | MOSI 347 | Text Label 9425 3925 2 60 ~ 0 348 | CS 349 | Text Label 9425 3725 2 60 ~ 0 350 | LCD_RS 351 | Text Label 4250 3125 2 60 ~ 0 352 | LCD_RS 353 | $Comp 354 | L SW_Push SW101 355 | U 1 1 59466570 356 | P 8025 3650 357 | F 0 "SW101" H 8075 3750 50 0000 L CNN 358 | F 1 "SW_Push" H 8025 3590 50 0000 C CNN 359 | F 2 "Buttons_Switches_SMD:SW_SPST_TL3342" H 8025 3850 50 0001 C CNN 360 | F 3 "" H 8025 3850 50 0001 C CNN 361 | 1 8025 3650 362 | 0 1 1 0 363 | $EndComp 364 | $Comp 365 | L SW_Push SW102 366 | U 1 1 5946668E 367 | P 7750 3650 368 | F 0 "SW102" H 7800 3750 50 0000 L CNN 369 | F 1 "SW_Push" H 7750 3590 50 0000 C CNN 370 | F 2 "Buttons_Switches_SMD:SW_SPST_TL3342" H 7750 3850 50 0001 C CNN 371 | F 3 "" H 7750 3850 50 0001 C CNN 372 | 1 7750 3650 373 | 0 1 1 0 374 | $EndComp 375 | $Comp 376 | L SW_Push SW103 377 | U 1 1 594666EC 378 | P 8275 3650 379 | F 0 "SW103" H 8325 3750 50 0000 L CNN 380 | F 1 "SW_Push" H 8275 3590 50 0000 C CNN 381 | F 2 "Buttons_Switches_SMD:SW_SPST_TL3342" H 8275 3850 50 0001 C CNN 382 | F 3 "" H 8275 3850 50 0001 C CNN 383 | 1 8275 3650 384 | 0 1 1 0 385 | $EndComp 386 | $Comp 387 | L GND #PWR07 388 | U 1 1 594668CD 389 | P 8025 3950 390 | F 0 "#PWR07" H 8025 3700 50 0001 C CNN 391 | F 1 "GND" H 8025 3800 50 0000 C CNN 392 | F 2 "" H 8025 3950 50 0001 C CNN 393 | F 3 "" H 8025 3950 50 0001 C CNN 394 | 1 8025 3950 395 | 1 0 0 -1 396 | $EndComp 397 | Text Notes 10575 3725 1 60 ~ 0 398 | Rom has Chinese Font\nSo we dont use it :/ 399 | $Comp 400 | L CONN_01X03 J102 401 | U 1 1 5948CD3C 402 | P 7925 1175 403 | F 0 "J102" H 7925 1375 50 0000 C CNN 404 | F 1 "Programming" V 8025 1175 50 0000 C CNN 405 | F 2 "Pin_Headers:Pin_Header_Angled_1x03_Pitch2.54mm" H 7925 1175 50 0001 C CNN 406 | F 3 "" H 7925 1175 50 0001 C CNN 407 | 1 7925 1175 408 | 1 0 0 -1 409 | $EndComp 410 | Text Label 4150 1525 2 60 ~ 0 411 | RST 412 | Text Label 6550 1525 0 60 ~ 0 413 | TEST 414 | Text Label 7725 1075 2 60 ~ 0 415 | TEST 416 | Text Label 7725 1275 2 60 ~ 0 417 | RST 418 | $Comp 419 | L GND #PWR08 420 | U 1 1 5948D56B 421 | P 7400 1350 422 | F 0 "#PWR08" H 7400 1100 50 0001 C CNN 423 | F 1 "GND" H 7400 1200 50 0000 C CNN 424 | F 2 "" H 7400 1350 50 0001 C CNN 425 | F 3 "" H 7400 1350 50 0001 C CNN 426 | 1 7400 1350 427 | 1 0 0 -1 428 | $EndComp 429 | Text Notes 6200 3925 0 60 ~ 0 430 | Only P1 and P2 have IRQ 431 | Text Label 6550 2725 0 60 ~ 0 432 | ~SD 433 | Text Label 6550 2625 0 60 ~ 0 434 | FETSOFF 435 | Text Label 6550 2525 0 60 ~ 0 436 | ~INT 437 | Text Notes 4400 4400 0 60 ~ 0 438 | FETSOFF -> High turns all fets on (charge/discharge)\nINT -> Interrupt from the BMS to alert us to status change\n 439 | Text Label 4250 2525 2 60 ~ 0 440 | CLK 441 | Text Label 9425 3825 2 60 ~ 0 442 | ~LCD_RESET 443 | Text Label 6550 2375 0 60 ~ 0 444 | ~LCD_RESET 445 | $Comp 446 | L C C101 447 | U 1 1 5960BD1E 448 | P 3125 4025 449 | F 0 "C101" H 3150 4125 50 0000 L CNN 450 | F 1 "C" H 3150 3925 50 0000 L CNN 451 | F 2 "Capacitors_SMD:C_0603" H 3163 3875 50 0001 C CNN 452 | F 3 "" H 3125 4025 50 0001 C CNN 453 | 1 3125 4025 454 | 1 0 0 -1 455 | $EndComp 456 | $Comp 457 | L VDD #PWR09 458 | U 1 1 5960BDEA 459 | P 3125 3875 460 | F 0 "#PWR09" H 3125 3725 50 0001 C CNN 461 | F 1 "VDD" H 3125 4025 50 0000 C CNN 462 | F 2 "" H 3125 3875 50 0001 C CNN 463 | F 3 "" H 3125 3875 50 0001 C CNN 464 | 1 3125 3875 465 | 1 0 0 -1 466 | $EndComp 467 | $Comp 468 | L GND #PWR010 469 | U 1 1 5960C1AB 470 | P 3125 4175 471 | F 0 "#PWR010" H 3125 3925 50 0001 C CNN 472 | F 1 "GND" H 3125 4025 50 0000 C CNN 473 | F 2 "" H 3125 4175 50 0001 C CNN 474 | F 3 "" H 3125 4175 50 0001 C CNN 475 | 1 3125 4175 476 | 1 0 0 -1 477 | $EndComp 478 | $Comp 479 | L C C102 480 | U 1 1 5960C224 481 | P 3375 4025 482 | F 0 "C102" H 3400 4125 50 0000 L CNN 483 | F 1 "C" H 3400 3925 50 0000 L CNN 484 | F 2 "Capacitors_SMD:C_0603" H 3413 3875 50 0001 C CNN 485 | F 3 "" H 3375 4025 50 0001 C CNN 486 | 1 3375 4025 487 | 1 0 0 -1 488 | $EndComp 489 | $Comp 490 | L VDD #PWR011 491 | U 1 1 5960C22A 492 | P 3375 3875 493 | F 0 "#PWR011" H 3375 3725 50 0001 C CNN 494 | F 1 "VDD" H 3375 4025 50 0000 C CNN 495 | F 2 "" H 3375 3875 50 0001 C CNN 496 | F 3 "" H 3375 3875 50 0001 C CNN 497 | 1 3375 3875 498 | 1 0 0 -1 499 | $EndComp 500 | $Comp 501 | L GND #PWR012 502 | U 1 1 5960C230 503 | P 3375 4175 504 | F 0 "#PWR012" H 3375 3925 50 0001 C CNN 505 | F 1 "GND" H 3375 4025 50 0000 C CNN 506 | F 2 "" H 3375 4175 50 0001 C CNN 507 | F 3 "" H 3375 4175 50 0001 C CNN 508 | 1 3375 4175 509 | 1 0 0 -1 510 | $EndComp 511 | $Comp 512 | L C C103 513 | U 1 1 5960C3F2 514 | P 3625 4025 515 | F 0 "C103" H 3650 4125 50 0000 L CNN 516 | F 1 "C" H 3650 3925 50 0000 L CNN 517 | F 2 "Capacitors_SMD:C_0603" H 3663 3875 50 0001 C CNN 518 | F 3 "" H 3625 4025 50 0001 C CNN 519 | 1 3625 4025 520 | 1 0 0 -1 521 | $EndComp 522 | $Comp 523 | L VDD #PWR013 524 | U 1 1 5960C3F8 525 | P 3625 3875 526 | F 0 "#PWR013" H 3625 3725 50 0001 C CNN 527 | F 1 "VDD" H 3625 4025 50 0000 C CNN 528 | F 2 "" H 3625 3875 50 0001 C CNN 529 | F 3 "" H 3625 3875 50 0001 C CNN 530 | 1 3625 3875 531 | 1 0 0 -1 532 | $EndComp 533 | $Comp 534 | L GND #PWR014 535 | U 1 1 5960C3FE 536 | P 3625 4175 537 | F 0 "#PWR014" H 3625 3925 50 0001 C CNN 538 | F 1 "GND" H 3625 4025 50 0000 C CNN 539 | F 2 "" H 3625 4175 50 0001 C CNN 540 | F 3 "" H 3625 4175 50 0001 C CNN 541 | 1 3625 4175 542 | 1 0 0 -1 543 | $EndComp 544 | $Comp 545 | L C C104 546 | U 1 1 5960C6CC 547 | P 3875 4025 548 | F 0 "C104" H 3900 4125 50 0000 L CNN 549 | F 1 "C" H 3900 3925 50 0000 L CNN 550 | F 2 "Capacitors_SMD:C_0603" H 3913 3875 50 0001 C CNN 551 | F 3 "" H 3875 4025 50 0001 C CNN 552 | 1 3875 4025 553 | 1 0 0 -1 554 | $EndComp 555 | $Comp 556 | L VDD #PWR015 557 | U 1 1 5960C6D2 558 | P 3875 3875 559 | F 0 "#PWR015" H 3875 3725 50 0001 C CNN 560 | F 1 "VDD" H 3875 4025 50 0000 C CNN 561 | F 2 "" H 3875 3875 50 0001 C CNN 562 | F 3 "" H 3875 3875 50 0001 C CNN 563 | 1 3875 3875 564 | 1 0 0 -1 565 | $EndComp 566 | $Comp 567 | L GND #PWR016 568 | U 1 1 5960C6D8 569 | P 3875 4175 570 | F 0 "#PWR016" H 3875 3925 50 0001 C CNN 571 | F 1 "GND" H 3875 4025 50 0000 C CNN 572 | F 2 "" H 3875 4175 50 0001 C CNN 573 | F 3 "" H 3875 4175 50 0001 C CNN 574 | 1 3875 4175 575 | 1 0 0 -1 576 | $EndComp 577 | $Comp 578 | L TEST_1P J103 579 | U 1 1 5960D653 580 | P 7600 1600 581 | F 0 "J103" H 7600 1870 50 0000 C CNN 582 | F 1 "TEST_1P" H 7600 1800 50 0000 C CNN 583 | F 2 "conn-test:TEST-SMD-SMALL" H 7800 1600 50 0001 C CNN 584 | F 3 "" H 7800 1600 50 0001 C CNN 585 | 1 7600 1600 586 | 1 0 0 -1 587 | $EndComp 588 | $Comp 589 | L TEST_1P J104 590 | U 1 1 5960D771 591 | P 7700 1600 592 | F 0 "J104" H 7700 1870 50 0000 C CNN 593 | F 1 "TEST_1P" H 7700 1800 50 0000 C CNN 594 | F 2 "conn-test:TEST-SMD-SMALL" H 7900 1600 50 0001 C CNN 595 | F 3 "" H 7900 1600 50 0001 C CNN 596 | 1 7700 1600 597 | 1 0 0 -1 598 | $EndComp 599 | $Comp 600 | L TEST_1P J105 601 | U 1 1 5960D7E3 602 | P 7800 1600 603 | F 0 "J105" H 7800 1870 50 0000 C CNN 604 | F 1 "TEST_1P" H 7800 1800 50 0000 C CNN 605 | F 2 "conn-test:TEST-SMD-SMALL" H 8000 1600 50 0001 C CNN 606 | F 3 "" H 8000 1600 50 0001 C CNN 607 | 1 7800 1600 608 | 1 0 0 -1 609 | $EndComp 610 | $Comp 611 | L TEST_1P J106 612 | U 1 1 5960D854 613 | P 7900 1600 614 | F 0 "J106" H 7900 1870 50 0000 C CNN 615 | F 1 "TEST_1P" H 7900 1800 50 0000 C CNN 616 | F 2 "conn-test:TEST-SMD-SMALL" H 8100 1600 50 0001 C CNN 617 | F 3 "" H 8100 1600 50 0001 C CNN 618 | 1 7900 1600 619 | 1 0 0 -1 620 | $EndComp 621 | Wire Wire Line 622 | 3750 2375 4250 2375 623 | Wire Wire Line 624 | 4050 2275 4250 2275 625 | Wire Wire Line 626 | 4250 2175 3750 2175 627 | Wire Wire Line 628 | 3750 1975 4250 1975 629 | Wire Wire Line 630 | 4250 2075 4050 2075 631 | Wire Wire Line 632 | 4050 1875 4250 1875 633 | Wire Wire Line 634 | 4250 1775 3750 1775 635 | Wire Wire Line 636 | 4050 1675 4250 1675 637 | Wire Wire Line 638 | 3450 2375 3075 2375 639 | Wire Wire Line 640 | 3075 2375 3075 2475 641 | Wire Wire Line 642 | 3750 2275 2800 2275 643 | Wire Wire Line 644 | 2800 2275 2800 2475 645 | Wire Wire Line 646 | 3450 2175 2525 2175 647 | Wire Wire Line 648 | 2525 2175 2525 2475 649 | Wire Wire Line 650 | 3750 2075 2250 2075 651 | Wire Wire Line 652 | 2250 2075 2250 2475 653 | Wire Wire Line 654 | 3450 1975 1975 1975 655 | Wire Wire Line 656 | 1975 1975 1975 2475 657 | Wire Wire Line 658 | 3750 1875 1700 1875 659 | Wire Wire Line 660 | 1700 1875 1700 2475 661 | Wire Wire Line 662 | 1425 1775 1425 2475 663 | Wire Wire Line 664 | 3750 1675 1150 1675 665 | Wire Wire Line 666 | 1150 1675 1150 2475 667 | Wire Wire Line 668 | 3450 1775 1425 1775 669 | Wire Wire Line 670 | 1150 2775 1150 2925 671 | Wire Wire Line 672 | 1150 2925 3075 2925 673 | Wire Wire Line 674 | 3075 2925 3075 2775 675 | Wire Wire Line 676 | 2800 2775 2800 2925 677 | Connection ~ 2800 2925 678 | Wire Wire Line 679 | 2525 2775 2525 2925 680 | Connection ~ 2525 2925 681 | Wire Wire Line 682 | 2250 2775 2250 2925 683 | Connection ~ 2250 2925 684 | Wire Wire Line 685 | 1975 2775 1975 2925 686 | Connection ~ 1975 2925 687 | Wire Wire Line 688 | 1700 2775 1700 2925 689 | Connection ~ 1700 2925 690 | Wire Wire Line 691 | 1425 2775 1425 2925 692 | Connection ~ 1425 2925 693 | Connection ~ 2100 2925 694 | Wire Wire Line 695 | 4250 1525 4150 1525 696 | Wire Wire Line 697 | 4150 1525 4150 1425 698 | Wire Wire Line 699 | 7750 3850 7750 3950 700 | Wire Wire Line 701 | 7750 3950 8275 3950 702 | Wire Wire Line 703 | 8275 3950 8275 3850 704 | Wire Wire Line 705 | 8025 3850 8025 3950 706 | Connection ~ 8025 3950 707 | Connection ~ 4150 1525 708 | Wire Wire Line 709 | 7725 1175 7400 1175 710 | Wire Wire Line 711 | 7400 1175 7400 1350 712 | Wire Wire Line 713 | 6550 3225 7750 3225 714 | Wire Wire Line 715 | 7750 3225 7750 3450 716 | Wire Wire Line 717 | 6550 3125 8025 3125 718 | Wire Wire Line 719 | 8025 3125 8025 3450 720 | Wire Wire Line 721 | 6550 3025 8275 3025 722 | Wire Wire Line 723 | 8275 3025 8275 3450 724 | Wire Wire Line 725 | 6550 1675 7600 1675 726 | Wire Wire Line 727 | 7600 1675 7600 1600 728 | Wire Wire Line 729 | 6550 1775 7700 1775 730 | Wire Wire Line 731 | 7700 1775 7700 1600 732 | Wire Wire Line 733 | 6550 1875 7800 1875 734 | Wire Wire Line 735 | 7800 1875 7800 1600 736 | Wire Wire Line 737 | 6550 1975 7900 1975 738 | Wire Wire Line 739 | 7900 1975 7900 1600 740 | $EndSCHEMATC 741 | -------------------------------------------------------------------------------- /Arduino Test/ISL94202/ISL94202.ino: -------------------------------------------------------------------------------- 1 | /* 2 | First attempt talking to the IC 3 | Ben V. Brown 4 | */ 5 | 6 | #include 7 | #define TIMESCALE_US 0 8 | #define TIMESCALE_MS 1 9 | #define TIMESCALE_S 2 10 | #define TIMESCALE_MIN 3 11 | 12 | 13 | void setup() 14 | { 15 | Wire.begin(); 16 | Serial.begin(1000000); 17 | Serial.println("ISL94202 Test"); 18 | Wire.beginTransmission(0x01); 19 | Wire.write(00); 20 | Wire.endTransmission(true); 21 | //False comms to unlock I2c state machine on the ic if we mess up^ 22 | disableEEPROMAccess(); 23 | writeReg(0x85, 0b00010000);//Set current shunt gain 24 | Serial.println("Press s to set the default settings to the unit"); 25 | Serial.println("Press r to display one reading"); 26 | Serial.println("Press R to continiously display readings"); 27 | Serial.println("Created by Ben V. Brown"); 28 | } 29 | 30 | bool continiousReadings = false; 31 | bool continiousPlot = false; 32 | void loop() 33 | { 34 | if (Serial.available()) 35 | { 36 | char c = Serial.read(); 37 | if (c == 'r') { 38 | 39 | Serial.println("Cells : "); 40 | for (uint8_t i = 0; i < 8; i++) 41 | Serial.println(readCellV(i)); 42 | Serial.print("Current : "); 43 | readCurrent(); 44 | Serial.print("Pack V: "); 45 | Serial.println(readPackV()); 46 | Serial.print("Minimum Cell :"); 47 | Serial.println(minCellV()); 48 | Serial.print("Maximum Cell :"); 49 | Serial.println(maxCellV()); 50 | printStatus(); 51 | Serial.println(); 52 | } 53 | else if (c == 'R') 54 | { 55 | continiousReadings = !continiousReadings; 56 | } 57 | else if (c == 'p') 58 | { 59 | continiousPlot = !continiousPlot; 60 | } 61 | else if (c == 'd') 62 | { 63 | Serial.println("Settings"); 64 | //dump settings 65 | Serial.print("Over Voltage Threshold "); 66 | Serial.println(OVThreshold()); 67 | Serial.print("Over Voltage Recovery "); 68 | Serial.println(OVRecovery()); 69 | Serial.print("Under Voltage Threshold "); 70 | Serial.println(UVThreshold()); 71 | Serial.print("Under Voltage Recovery "); 72 | Serial.println(UVRecovery()); 73 | } else if (c == 'e') 74 | { 75 | //Read EEPROM 76 | Serial.println(F("Reading User EEPROM")); 77 | enableEEPROMAccess(); 78 | delay(1); 79 | for (uint8_t i = 0; i < 4; i++) 80 | Serial.println(readUserEEPROM(i), HEX); 81 | disableEEPROMAccess(); 82 | } 83 | else if (c == 'E') 84 | { 85 | Serial.println(F("Writing User EEPROM")); 86 | Serial.println(writeUserEEPROM(0, millis() % 0xFF)); 87 | 88 | } else if (c == 's') 89 | { 90 | //Load in the settings 91 | setOVThres(4250, 1);//Turn off charging the pack at 4.25V 92 | setOVRecovery(4150);//Turn back on charging once discharged to 4.15V 93 | setUVThres(3000, 1);//Turn off the pack output when any cell is below 3V 94 | setUVRecovery(3100);//Turn discharging back on when the lowest cell is above 3.1V 95 | setOVLockout(4300);//Permanently shutdown the pack if a cell goes above 4.3V 96 | setUVLockout(2500);//Permanently shutdown the pack if a cell falls below 2.5V 97 | setEOCThreshold(4200);//Mark End of Charge once any cell is at 4.2V 98 | setDischargeOverCurrent(32, 500, TIMESCALE_MS);//Set the discharge current limit to 32mV == 16A. Averaged over 0.5S 99 | setChargeOverCurrent(24, 500, TIMESCALE_MS);//Set the charge current limit to 24mV == 12A. Averaged over 0.5S 100 | setDischargeShortCircuit(64, 500, TIMESCALE_US);//Set the short circuit protection to 64mV == 32A over 0.5mS 101 | setCellBalanceOnOffTime(9, TIMESCALE_S, 1, TIMESCALE_S);//Set balance time to 9S on, and 1S off 102 | setCellCountSleepMode(3, 10, 32);//Set the unit to 3S cell count. 10 minutes to enter lower power modes. 32 minutes to enter deep sleep 103 | setCellBalanceDifference(10);//Balance cells until they are withing 10mV maximum error 104 | setCellBalanceMin(3850);//Start the blanacing when the cells are above 3.85V 105 | setCellBalanceMax(4300);//Stop balancing if the cells are above 4.3V (Set high to disable this feature). 106 | setFeature1(true, true, false, false, false, true); 107 | setFeature2(false, true, true, true, true, true); 108 | Serial.println(F("Please disconnect and reconnect the battery to force an EEPROM reload.")); 109 | delay(10000); 110 | } 111 | } 112 | delay(500); 113 | if (continiousReadings) 114 | { 115 | Serial.print("Current : "); 116 | readCurrent(); 117 | Serial.print("Pack V: "); 118 | Serial.println(readPackV()); 119 | Serial.print("Minimum Cell :"); 120 | Serial.println(minCellV()); 121 | Serial.print("Maximum Cell :"); 122 | Serial.println(maxCellV()); 123 | printStatus(); 124 | Serial.println(); 125 | } 126 | if (continiousPlot) 127 | { 128 | uint8_t r2 = readReg(0x8E); 129 | uint8_t r1 = readReg(0x8F); 130 | float reading = (((uint16_t)(r2 << 8 | r1)) & 0xFFFF); 131 | reading *= (1.8); 132 | reading /= (4095 * 2.89); 133 | Serial.println(reading); 134 | 135 | } 136 | } 137 | //Settings 138 | 139 | 140 | void setDischargeOverCurrent(uint8_t threshold, uint16_t count, uint8_t timeScale) 141 | { 142 | //Threshold 000 is 4mV, each step ={4,8,16,24,32,48,64,96} 143 | //timescale = {us,ms,s,min} 144 | //default is 32mV,160ms 145 | uint8_t thres = 0xFF; 146 | switch (threshold) 147 | { 148 | case 4: 149 | thres = 0; 150 | break; 151 | case 8: 152 | thres = 1; 153 | break; 154 | case 16: 155 | thres = 2; 156 | break; 157 | case 24: 158 | thres = 3; 159 | break; 160 | case 32: 161 | thres = 4; 162 | break; 163 | case 48: 164 | thres = 5; 165 | break; 166 | case 64: 167 | thres = 6; 168 | break; 169 | case 96: 170 | thres = 7; 171 | break; 172 | default: 173 | thres = 0xFF; 174 | } 175 | if (thres == 0xFF) 176 | { 177 | Serial.println(F("Invalid threshold")); 178 | return; 179 | } 180 | writeEEPROMTimeout(0x16, count, timeScale, thres); 181 | } 182 | void setChargeOverCurrent(uint8_t threshold, uint16_t count, uint8_t timeScale) 183 | { 184 | //Threshold 000 is 1mV, each step ={1,2,4,6,8,12,16,24} 185 | //timescale = {us,ms,s,min} 186 | //default is 8mV,160ms 187 | uint8_t thres = 0xFF; 188 | switch (threshold) 189 | { 190 | case 1: 191 | thres = 0; 192 | break; 193 | case 2: 194 | thres = 1; 195 | break; 196 | case 4: 197 | thres = 2; 198 | break; 199 | case 6: 200 | thres = 3; 201 | break; 202 | case 8: 203 | thres = 4; 204 | break; 205 | case 12: 206 | thres = 5; 207 | break; 208 | case 16: 209 | thres = 6; 210 | break; 211 | case 24: 212 | thres = 7; 213 | break; 214 | default: 215 | thres = 0xFF; 216 | } 217 | if (thres == 0xFF) 218 | { 219 | Serial.println(F("Invalid threshold")); 220 | return; 221 | } 222 | writeEEPROMTimeout(0x18, count, timeScale, thres); 223 | } 224 | void setDischargeShortCircuit(uint8_t threshold, uint16_t count, uint8_t timeScale) 225 | { 226 | //Threshold 000 is 16mV, each step ={16,24,32,48,64,96,128,256} 227 | //timescale = {us,ms,s,min} 228 | //default is 128mV,200uS 229 | uint8_t thres = 0xFF; 230 | switch (threshold) 231 | { 232 | case 16: 233 | thres = 0; 234 | break; 235 | case 24: 236 | thres = 1; 237 | break; 238 | case 32: 239 | thres = 2; 240 | break; 241 | case 48: 242 | thres = 3; 243 | break; 244 | case 64: 245 | thres = 4; 246 | break; 247 | case 96: 248 | thres = 5; 249 | break; 250 | case 128: 251 | thres = 6; 252 | break; 253 | case 256: 254 | thres = 7; 255 | break; 256 | default: 257 | thres = 0xFF; 258 | } 259 | if (thres == 0xFF) 260 | { 261 | Serial.println(F("Invalid threshold")); 262 | return; 263 | } 264 | writeEEPROMTimeout(0x1A, count, timeScale, thres); 265 | } 266 | 267 | //Cell balancing 268 | void setCellBalanceMin(uint16_t mV) 269 | { 270 | writeEEPROMVoltage(0x1C, mV, 0x00); 271 | } 272 | void setCellBalanceMax(uint16_t mV) 273 | { 274 | writeEEPROMVoltage(0x1E, mV, 0x00); 275 | } 276 | void setCellBalanceDifference(uint16_t mV) 277 | { 278 | //If the cells are closer than this the balancing stops 279 | //defaults to 20mV 280 | writeEEPROMVoltage(0x20, mV, 0x00); 281 | } 282 | 283 | void setCellBalanceFaultLevel(uint16_t mV) 284 | { 285 | //If the difference is bigger than this its a fault and system gives up 286 | //default 500mV 287 | writeEEPROMVoltage(0x22, mV, 0x00); 288 | } 289 | void setCellBalanceOnOffTime(uint16_t onTime, uint8_t onTimeScale, uint16_t offTime, uint8_t offTimeScale) 290 | { 291 | //Sets on / off time for balancing cycle 292 | writeEEPROMTimeout(0x24, onTime, onTimeScale, 0); 293 | writeEEPROMTimeout(0x26, offTime, offTimeScale, 0); 294 | 295 | } 296 | 297 | void setCellSleepLevel(uint16_t mV) 298 | { 299 | //Set the voltage at which point the device goes into sleep forcefully 300 | //default 2.0v 301 | writeEEPROMVoltage(0x44, mV, 0x00); 302 | } 303 | void setCellCountSleepMode(uint8_t cellCount, uint8_t idleModeTimeout, uint8_t sleepModeTimeout) 304 | { 305 | //cellCount needs to be turned into the input bitmask 306 | uint8_t cellMask = 0b10000011; 307 | if (cellCount == 4) 308 | cellMask = 0b11000011; 309 | if (cellCount == 5) 310 | cellMask = 0b11000111; 311 | if (cellCount == 6) 312 | cellMask = 0b11100111; 313 | if (cellCount == 7) 314 | cellMask = 0b11101111; 315 | if (cellCount == 8) 316 | cellMask = 0b01111111; 317 | idleModeTimeout = idleModeTimeout & 0x0F; 318 | sleepModeTimeout = sleepModeTimeout & 0xF0; 319 | Serial.print("Setting Cell Count to : "); 320 | Serial.println(cellMask, BIN); 321 | Serial.print("Setting IDLE/Doze Time to : "); 322 | Serial.println(idleModeTimeout); 323 | Serial.print("Setting Sleep Time to : "); 324 | Serial.println(sleepModeTimeout); 325 | uint16_t output = cellMask << 8; 326 | output |= idleModeTimeout; 327 | output |= sleepModeTimeout; 328 | writeEEPROMWord(0x48, output); 329 | } 330 | void setOVThres(uint16_t mV, uint8_t ChargeDetectPulseWidth) 331 | { 332 | writeEEPROMVoltage(0x00, mV, ChargeDetectPulseWidth); 333 | } 334 | void setUVThres(uint16_t mV, uint8_t LoadDetectPulseWidth) 335 | { 336 | writeEEPROMVoltage(0x04, mV, LoadDetectPulseWidth); 337 | } 338 | void setOVRecovery(uint16_t mV) 339 | { 340 | writeEEPROMVoltage(0x02, mV, 0x00); 341 | } 342 | void setUVRecovery(uint16_t mV) 343 | { 344 | writeEEPROMVoltage(0x06, mV, 0x00); 345 | } 346 | 347 | void setOVLockout(uint16_t mV) 348 | { 349 | writeEEPROMVoltage(0x08, mV, 0x00); 350 | } 351 | void setUVLockout(uint16_t mV) 352 | { 353 | writeEEPROMVoltage(0x0A, mV, 0x00); 354 | } 355 | void setEOCThreshold(uint16_t mV) 356 | { 357 | writeEEPROMVoltage(0x0C, mV, 0x00); 358 | } 359 | void setLVCThreshold(uint16_t mV) 360 | { 361 | writeEEPROMVoltage(0x0E, mV, 0x00); 362 | } 363 | //Feature Controls 364 | void setFeature1(bool CellFActivatesPSD, bool XT2Mode, bool TGain, bool PreChargeFETEnabled, bool disableOpenWireScan, bool OpenWireSetsPSD) 365 | { 366 | uint8_t output = 0; 367 | output |= CellFActivatesPSD << 7; 368 | output |= XT2Mode << 5; 369 | output |= TGain << 4; 370 | output |= PreChargeFETEnabled << 2; 371 | output |= disableOpenWireScan << 1; 372 | output |= OpenWireSetsPSD; 373 | 374 | writeEEPROM(0x4A, output); 375 | delay(1); 376 | Serial.print("Feature 1 "); 377 | Serial.println(readReg(0x4A & 0xFC), HEX); 378 | } 379 | void setFeature2(bool CellBalanceDuringDischarge, bool CellbalanceDuringCharge, 380 | bool keepDFETonDuringCharge, bool keepCFETonDuringDischarge, bool shutdownOnUVLO, bool enableBalanceAtEOC) 381 | { 382 | uint8_t output = 0; 383 | output |= CellBalanceDuringDischarge ? 1 << 7 : 0; 384 | output |= CellbalanceDuringCharge ? 1 << 6 : 0; 385 | output |= keepDFETonDuringCharge ? 1 << 5 : 0; 386 | output |= keepCFETonDuringDischarge ? 1 << 4 : 0; 387 | output |= shutdownOnUVLO ? 1 << 3 : 0; 388 | output |= enableBalanceAtEOC ? 1 : 0; 389 | 390 | writeEEPROM(0x4B, output); 391 | Serial.print("Feature 2 "); 392 | Serial.println(readReg(0x4B & 0xFC), HEX); 393 | } 394 | //UserEEPROM 395 | //Interactions with the eeprom for user use. 396 | //Often used for serial number or other settings such as mfg date 397 | uint8_t readUserEEPROM(uint8_t address) 398 | { 399 | volatile byte r, r2; 400 | do { 401 | r = readReg(0x50 + (address & 0x0F)); 402 | delay(1); 403 | r2 = readReg(0x50 + (address & 0x0F)); 404 | 405 | } while (r != r2); 406 | return r; 407 | } 408 | bool writeUserEEPROM(uint8_t address, uint8_t value) 409 | { 410 | return writeEEPROM(0x50 + (address & 0x0F), value); 411 | } 412 | uint16_t milliVoltsToVScaleRaw(uint16_t mV) 413 | { 414 | //float retvalue =((float)mV)*((4095*3)/(1.8*8)); 415 | float retvalue = (((float)mV) / 1000.0) * 853.125; 416 | return retvalue; 417 | } 418 | void enableEEPROMAccess() 419 | { 420 | //Set the bit to change to read/write EEPROM 421 | writeReg(0x89, 0x01); 422 | } 423 | void disableEEPROMAccess() 424 | { 425 | //Set the bit to change to read/write EEPROM 426 | writeReg(0x89, 0x00); 427 | } 428 | void writeEEPROMTimeout(uint8_t add, uint16_t timeout, uint8_t timeScale, uint8_t headerFourBits) 429 | { 430 | uint16_t outputValue = 0; 431 | outputValue = headerFourBits << 12; 432 | outputValue |= (timeout & 0x3FF); 433 | outputValue |= ((timeScale & 0x03) << 10); 434 | writeEEPROMWord(add, outputValue); 435 | } 436 | void writeEEPROMVoltage(uint8_t add, uint16_t mV, uint8_t headerFourBits) 437 | { 438 | uint16_t outputValue = 0; 439 | outputValue = headerFourBits << 12; 440 | uint16_t calcValue = milliVoltsToVScaleRaw(mV); 441 | if (calcValue > 0x0FFF) 442 | { 443 | Serial.println(F("Over Range")); 444 | return; 445 | } 446 | //else we are in range 447 | outputValue |= (calcValue & 0x0FFF); 448 | //Write out LSB in lowest address 449 | float reading = (uint16_t)(outputValue & 0x0FFF); 450 | 451 | reading *= (1.8 * 8); 452 | reading /= (4.095 * 3); 453 | 454 | Serial.print(F("Setting Voltage To : ")); 455 | Serial.print(reading); 456 | Serial.println(F(" mV")); 457 | writeEEPROMWord(add, outputValue); 458 | } 459 | 460 | uint8_t readReg(uint8_t reg) 461 | { 462 | Wire.beginTransmission(0x28); 463 | Wire.write(reg); 464 | Wire.endTransmission(false); 465 | Wire.requestFrom(0x28, 1); 466 | //while (!Wire.available()); 467 | byte slaveByte2 = Wire.read(); 468 | //Wire.endTransmission(); 469 | return slaveByte2; 470 | } 471 | bool writeEEPROMWord(uint8_t reg, uint16_t value) 472 | { 473 | if ((reg > 0x58 && reg < 0x7F) || reg > 0xAB) 474 | return false; 475 | enableEEPROMAccess(); 476 | //^These are reserved areas for factory cal etc 477 | uint8_t buffer[4];//We need to write in pages 478 | uint8_t base = reg & 0xFC; 479 | buffer[0] = readReg(base); 480 | delay(1);//delay to allow EEPROM refresh 481 | Wire.beginTransmission(0x28); 482 | Wire.write(base); 483 | Wire.endTransmission(false); 484 | Wire.requestFrom(0x28, 4); 485 | for (byte i = 0; i < 4; i++) { 486 | while (!Wire.available()); 487 | buffer[i] = Wire.read(); 488 | } 489 | Wire.endTransmission(); 490 | //We have read in the buffer 491 | 492 | //Update the buffer 493 | buffer[reg & 0x03] = value & 0xFF; 494 | buffer[(reg & 0x03) + 1] = value >> 8; 495 | 496 | 497 | Wire.beginTransmission(0x28); 498 | Wire.write(base); 499 | Wire.write(buffer[0]); 500 | Wire.endTransmission(); 501 | delay(60);//pause for EEPROM write 502 | 503 | //^Special case for first byte causing EEPROM reload 504 | for (uint8_t i = 0; i < 4; i++) 505 | { 506 | Wire.beginTransmission(0x28); 507 | Wire.write(base + i); 508 | Wire.write(buffer[i]); 509 | Wire.endTransmission(); 510 | delay(35);//pause for EEPROM write 511 | } 512 | delay(50); 513 | disableEEPROMAccess(); 514 | 515 | return value == readReg(reg); 516 | //return true if the value was changed sucsessfully 517 | } 518 | bool writeEEPROM(uint8_t reg, uint8_t value) 519 | { 520 | if ((reg > 0x58 && reg < 0x7F) || reg > 0xAB) 521 | return false; 522 | enableEEPROMAccess(); 523 | //^These are reserved areas for factory cal etc 524 | uint8_t buffer[4];//We need to write in pages 525 | uint8_t base = reg & 0xFC; 526 | buffer[0] = readReg(base); 527 | delay(1);//delay to allow EEPROM refresh 528 | Wire.beginTransmission(0x28); 529 | Wire.write(base); 530 | Wire.endTransmission(false); 531 | Wire.requestFrom(0x28, 4); 532 | for (byte i = 0; i < 4; i++) { 533 | while (!Wire.available()); 534 | buffer[i] = Wire.read(); 535 | } 536 | Wire.endTransmission(); 537 | //We have read in the buffer 538 | //Update the buffer 539 | buffer[reg & 0x03] = value; 540 | 541 | Wire.beginTransmission(0x28); 542 | Wire.write(base ); 543 | Wire.write(buffer[0]); 544 | Wire.endTransmission(); 545 | delay(50);//pause for EEPROM write 546 | 547 | //^Special case for first byte causing EEPROM reload 548 | for (uint8_t i = 0; i < 4; i++) 549 | { 550 | Wire.beginTransmission(0x28); 551 | Wire.write(base + i); 552 | Wire.write(buffer[i]); 553 | Wire.endTransmission(); 554 | delay(35);//pause for EEPROM write 555 | } 556 | delay(50); 557 | disableEEPROMAccess(); 558 | 559 | return value == readReg(reg); 560 | //return true if the value was changed sucsessfully 561 | } 562 | void writeReg(uint8_t reg, uint8_t value) 563 | { 564 | if ((reg > 0x58 && reg < 0x7F) || reg > 0xAB) 565 | return false; 566 | Wire.beginTransmission(0x28); 567 | Wire.write(reg); 568 | Wire.write(value); 569 | Wire.endTransmission(); 570 | } 571 | 572 | uint16_t readCurrent() 573 | { 574 | uint8_t r2 = readReg(0x8E); 575 | uint8_t r1 = readReg(0x8F); 576 | float reading = (((uint16_t)(r2 << 8 | r1)) & 0xFFFF); 577 | reading *= (1.8); 578 | reading /= (4095 * 2.89); 579 | Serial.println(reading); 580 | 581 | return reading; 582 | } 583 | /// Readings 584 | uint16_t OVThreshold() 585 | { 586 | return readRegVScale(0x00); 587 | } 588 | uint16_t OVRecovery() 589 | { 590 | return readRegVScale(0x02); 591 | } 592 | uint16_t UVThreshold() 593 | { 594 | return readRegVScale(0x04); 595 | } 596 | uint16_t UVRecovery() 597 | { 598 | return readRegVScale(0x06); 599 | } 600 | 601 | void printStatus() 602 | { 603 | byte stat = readReg(0x80);//get status 1 604 | if (stat & 0x80) 605 | Serial.println(F("Charge disabled as its too cold")); 606 | if (stat & 0x40) 607 | Serial.println(F("Charge disabled as its too hot")); 608 | if (stat & 0x20) 609 | Serial.println(F("Discharge disabled as its too cold")); 610 | if (stat & 0x10) 611 | Serial.println(F("Discharge disabled as its too hot")); 612 | if (stat & 0x08) 613 | Serial.println(F("UVLO")); 614 | if (stat & 0x04) 615 | Serial.println(F("Pack Shutdown - Under Voltage")); 616 | if (stat & 0x02) 617 | Serial.println(F("OVLO")); 618 | if (stat & 0x01) 619 | Serial.println(F("Pack Shutdown - Over Voltage")); 620 | //Register 2 - Status 621 | stat = readReg(0x81);//get status 2 622 | if (stat & 0x80) 623 | Serial.println(F("Battery Fully charged")); 624 | if (stat & 0x20) 625 | Serial.println(F("Open Circuit on a Balance Lead!")); 626 | if (stat & 0x10) 627 | Serial.println(F("Cell failed!!! Battery needs replacement")); 628 | if (stat & 0x08) 629 | Serial.println(F("Short circuit tripped. Remove load to reset")); 630 | if (stat & 0x04) 631 | Serial.println(F("Overcurrent on dishcarge. Remove load to reset")); 632 | if (stat & 0x02) 633 | Serial.println(F("Overcurrent on charge. Remove charger to reset")); 634 | if (stat & 0x01) 635 | Serial.println(F("Outputs off. Battery too hot")); 636 | //Status 3 637 | stat = readReg(0x82);//get status 2 638 | if (stat & 0x80) 639 | Serial.println(F("Low Voltage Pre Charge on")); 640 | //if (stat & 0x40) 641 | // Serial.println(F("Internal Scan is running")); 642 | if (stat & 0x20) 643 | Serial.println(F("ECC failed to correct an error in EEPROM")); 644 | if (stat & 0x10) 645 | Serial.println(F("ECC used to fix error in EEPROM")); 646 | if (stat & 0x08) 647 | Serial.println(F("Current: Discharging")); 648 | if (stat & 0x04) 649 | Serial.println(F("Current: Charging")); 650 | if (stat & 0x02) 651 | Serial.println(F("Charger Connected")); 652 | if (stat & 0x01) 653 | Serial.println(F("Load Connected")); 654 | 655 | //Status 4 656 | stat = readReg(0x83);//get status 2 657 | 658 | if (stat & 0x40) 659 | Serial.println(F("Mode: ")); 660 | if (stat & 0x20) 661 | Serial.println(F("Mode: Doze")); 662 | if (stat & 0x10) 663 | Serial.println(F("Mode: Idle")); 664 | if (stat & 0x08) 665 | Serial.println(F("Cell Balance wants to run. But cells not charged enough")); 666 | if (stat & 0x04) 667 | Serial.println(F("Cell Balance wants to run. But cells charged more than the upper limit")); 668 | if (stat & 0x02) 669 | Serial.println(F("Cell Balance wants to run. But cells are too cold")); 670 | if (stat & 0x01) 671 | Serial.println(F("Cell Balance wants to run. But cells are too hot")); 672 | //cell bal status 673 | stat = readReg(0x84); 674 | for (byte i = 0; i < 8; i++) 675 | if (stat & (0x01 << i)) { 676 | Serial.print("Balancing Cell : "); 677 | Serial.println(i + 1); 678 | } 679 | } 680 | uint16_t minCellV() 681 | { 682 | return readRegVScale(0x8A); 683 | } 684 | uint16_t maxCellV() 685 | { 686 | return readRegVScale(0x8C); 687 | } 688 | uint16_t readPackV() 689 | { 690 | 691 | uint16_t r1 = readReg(0xA6); 692 | uint16_t r2 = readReg(0xA6 + 1); 693 | float reading = (uint16_t)(r2 << 8 | r1); 694 | 695 | reading *= (1.8 * 32); 696 | reading /= (4.095 ); 697 | 698 | return reading; 699 | } 700 | uint16_t readCellV(uint8_t cellNo) 701 | { 702 | return readRegVScale(0x90 + (2 * cellNo)); 703 | } 704 | uint16_t readRegVScale(uint8_t reg) 705 | { 706 | uint16_t r1 = readReg(reg); 707 | uint16_t r2 = (readReg(reg + 1)) & 0x0F; 708 | float reading = (uint16_t)(r2 << 8 | r1); 709 | 710 | reading *= (1.8 * 8); 711 | reading /= (4.095 * 3); 712 | 713 | return reading; 714 | } 715 | 716 | -------------------------------------------------------------------------------- /Electronics/BMS FrontEnd/OpenBMSFrontEnd.sch: -------------------------------------------------------------------------------- 1 | EESchema Schematic File Version 2 2 | LIBS:power 3 | LIBS:device 4 | LIBS:transistors 5 | LIBS:conn 6 | LIBS:linear 7 | LIBS:regul 8 | LIBS:74xx 9 | LIBS:cmos4000 10 | LIBS:adc-dac 11 | LIBS:memory 12 | LIBS:xilinx 13 | LIBS:microcontrollers 14 | LIBS:dsp 15 | LIBS:microchip 16 | LIBS:analog_switches 17 | LIBS:motorola 18 | LIBS:texas 19 | LIBS:intel 20 | LIBS:audio 21 | LIBS:interface 22 | LIBS:digital-audio 23 | LIBS:philips 24 | LIBS:display 25 | LIBS:cypress 26 | LIBS:siliconi 27 | LIBS:opto 28 | LIBS:atmel 29 | LIBS:contrib 30 | LIBS:valves 31 | LIBS:ISL94202 32 | LIBS:openbmsriser 33 | LIBS:mechanical 34 | LIBS:OpenBMSFrontEnd-cache 35 | EELAYER 25 0 36 | EELAYER END 37 | $Descr A4 11693 8268 38 | encoding utf-8 39 | Sheet 1 2 40 | Title "Open BMS Front End" 41 | Date "2017-06-17" 42 | Rev "1" 43 | Comp "Ralim TEk" 44 | Comment1 "" 45 | Comment2 "" 46 | Comment3 "" 47 | Comment4 "By Ben V. Browm" 48 | $EndDescr 49 | $Comp 50 | L ISL94202 U101 51 | U 1 1 59170B53 52 | P 5400 3700 53 | F 0 "U101" H 5400 3700 50 0000 C CNN 54 | F 1 "ISL94202" H 5400 4050 50 0000 C CNN 55 | F 2 "Housings_DFN_QFN:UQFN-48-1EP_6x6mm_Pitch0.4mm" H 5400 3850 50 0001 C CNN 56 | F 3 "DOCUMENTATION" H 5400 3950 50 0001 C CNN 57 | F 4 "968-ISL94202IRTZ-T7A" H 5400 3700 60 0001 C CNN "bom_partno" 58 | 1 5400 3700 59 | 1 0 0 -1 60 | $EndComp 61 | $Sheet 62 | S 3200 3150 1100 2050 63 | U 59170C93 64 | F0 "Cell Frontend" 60 65 | F1 "CellFrontend.sch" 60 66 | F2 "C0" I L 3200 4800 60 67 | F3 "C1" I L 3200 4700 60 68 | F4 "C2" I L 3200 4600 60 69 | F5 "C3" I L 3200 4500 60 70 | F6 "C4" I L 3200 4400 60 71 | F7 "VC8" I R 4300 3200 60 72 | F8 "CB8" I R 4300 3300 60 73 | F9 "VC7" I R 4300 3400 60 74 | F10 "CB7" I R 4300 3500 60 75 | F11 "VC6" I R 4300 3600 60 76 | F12 "VC3" I R 4300 4200 60 77 | F13 "CB3" I R 4300 4300 60 78 | F14 "VC2" I R 4300 4750 60 79 | F15 "CB2" I R 4300 4850 60 80 | F16 "VC1" I R 4300 4950 60 81 | F17 "CB1" I R 4300 5050 60 82 | F18 "VC0" I R 4300 5150 60 83 | F19 "CB6" I R 4300 3700 60 84 | F20 "VC5" I R 4300 3800 60 85 | F21 "CB5" I R 4300 3900 60 86 | F22 "VC4" I R 4300 4000 60 87 | F23 "CB4" I R 4300 4100 60 88 | F24 "C6" I L 3200 4200 60 89 | F25 "C7" I L 3200 4100 60 90 | F26 "C8" I L 3200 4000 60 91 | F27 "C5" I L 3200 4300 60 92 | $EndSheet 93 | $Comp 94 | L GND #PWR01 95 | U 1 1 591894B2 96 | P 6500 4400 97 | F 0 "#PWR01" H 6500 4150 50 0001 C CNN 98 | F 1 "GND" H 6500 4250 50 0000 C CNN 99 | F 2 "" H 6500 4400 50 0001 C CNN 100 | F 3 "" H 6500 4400 50 0001 C CNN 101 | 1 6500 4400 102 | 1 0 0 -1 103 | $EndComp 104 | $Comp 105 | L GND #PWR02 106 | U 1 1 5918954B 107 | P 5400 4750 108 | F 0 "#PWR02" H 5400 4500 50 0001 C CNN 109 | F 1 "GND" H 5400 4600 50 0000 C CNN 110 | F 2 "" H 5400 4750 50 0001 C CNN 111 | F 3 "" H 5400 4750 50 0001 C CNN 112 | 1 5400 4750 113 | 1 0 0 -1 114 | $EndComp 115 | $Comp 116 | L C C102 117 | U 1 1 5918994C 118 | P 5500 5350 119 | F 0 "C102" H 5525 5450 50 0000 L CNN 120 | F 1 "100n" H 5525 5250 50 0000 L CNN 121 | F 2 "Capacitors_SMD:C_0603" H 5538 5200 50 0001 C CNN 122 | F 3 "" H 5500 5350 50 0001 C CNN 123 | F 4 "710-885012206071" H 5500 5350 60 0001 C CNN "bom_partno" 124 | 1 5500 5350 125 | 1 0 0 -1 126 | $EndComp 127 | $Comp 128 | L GND #PWR03 129 | U 1 1 59189BFD 130 | P 5500 5500 131 | F 0 "#PWR03" H 5500 5250 50 0001 C CNN 132 | F 1 "GND" H 5500 5350 50 0000 C CNN 133 | F 2 "" H 5500 5500 50 0001 C CNN 134 | F 3 "" H 5500 5500 50 0001 C CNN 135 | 1 5500 5500 136 | 1 0 0 -1 137 | $EndComp 138 | $Comp 139 | L GND #PWR04 140 | U 1 1 5918A19D 141 | P 6000 4750 142 | F 0 "#PWR04" H 6000 4500 50 0001 C CNN 143 | F 1 "GND" H 6000 4600 50 0000 C CNN 144 | F 2 "" H 6000 4750 50 0001 C CNN 145 | F 3 "" H 6000 4750 50 0001 C CNN 146 | 1 6000 4750 147 | 1 0 0 -1 148 | $EndComp 149 | Text Label 6750 4150 0 60 ~ 0 150 | SDA 151 | Text Label 6750 4300 0 60 ~ 0 152 | SCL 153 | $Comp 154 | L GND #PWR05 155 | U 1 1 5918C1EC 156 | P 7050 4400 157 | F 0 "#PWR05" H 7050 4150 50 0001 C CNN 158 | F 1 "GND" H 7050 4250 50 0000 C CNN 159 | F 2 "" H 7050 4400 50 0001 C CNN 160 | F 3 "" H 7050 4400 50 0001 C CNN 161 | 1 7050 4400 162 | 1 0 0 -1 163 | $EndComp 164 | $Comp 165 | L GND #PWR06 166 | U 1 1 5918C281 167 | P 7150 4400 168 | F 0 "#PWR06" H 7150 4150 50 0001 C CNN 169 | F 1 "GND" H 7150 4250 50 0000 C CNN 170 | F 2 "" H 7150 4400 50 0001 C CNN 171 | F 3 "" H 7150 4400 50 0001 C CNN 172 | 1 7150 4400 173 | 1 0 0 -1 174 | $EndComp 175 | $Comp 176 | L R R107 177 | U 1 1 5918F88C 178 | P 3900 2700 179 | F 0 "R107" V 3980 2700 50 0000 C CNN 180 | F 1 "100" V 3900 2700 50 0000 C CNN 181 | F 2 "Resistors_SMD:R_0603" V 3830 2700 50 0001 C CNN 182 | F 3 "" H 3900 2700 50 0001 C CNN 183 | F 4 "660-RK73H1JTTD1000F" H 3900 2700 60 0001 C CNN "bom_partno" 184 | 1 3900 2700 185 | 0 1 1 0 186 | $EndComp 187 | $Comp 188 | L GND #PWR07 189 | U 1 1 59191316 190 | P 2250 1925 191 | F 0 "#PWR07" H 2250 1675 50 0001 C CNN 192 | F 1 "GND" H 2250 1775 50 0000 C CNN 193 | F 2 "" H 2250 1925 50 0001 C CNN 194 | F 3 "" H 2250 1925 50 0001 C CNN 195 | 1 2250 1925 196 | 1 0 0 -1 197 | $EndComp 198 | $Comp 199 | L R R102 200 | U 1 1 59191EC2 201 | P 2850 1500 202 | F 0 "R102" V 2930 1500 50 0000 C CNN 203 | F 1 "0.002" V 2850 1500 50 0000 C CNN 204 | F 2 "Resistors_SMD:R_2512" V 2780 1500 50 0001 C CNN 205 | F 3 "" H 2850 1500 50 0001 C CNN 206 | 1 2850 1500 207 | 0 -1 -1 0 208 | $EndComp 209 | $Comp 210 | L FDMS8050 Q101 211 | U 1 1 591940C4 212 | P 3650 1700 213 | F 0 "Q101" H 3450 2000 50 0000 L CNN 214 | F 1 "FDMS8050" H 3450 1450 50 0000 L CNN 215 | F 2 "TO_SOT_Packages_SMD:TDSON-8-1" H 3650 1356 50 0001 C CIN 216 | F 3 "" V 3650 1700 50 0001 L CNN 217 | F 4 "726-BSC882N03LSG" H 3650 1700 60 0001 C CNN "bom_partno" 218 | 1 3650 1700 219 | 1 0 0 -1 220 | $EndComp 221 | $Comp 222 | L R R101 223 | U 1 1 59195560 224 | P 2700 2050 225 | F 0 "R101" V 2780 2050 50 0000 C CNN 226 | F 1 "100" V 2700 2050 50 0000 C CNN 227 | F 2 "Resistors_SMD:R_0603" V 2630 2050 50 0001 C CNN 228 | F 3 "" H 2700 2050 50 0001 C CNN 229 | F 4 "660-RK73H1JTTD1000F" H 2700 2050 60 0001 C CNN "bom_partno" 230 | 1 2700 2050 231 | 1 0 0 -1 232 | $EndComp 233 | $Comp 234 | L R R104 235 | U 1 1 59195613 236 | P 3000 2050 237 | F 0 "R104" V 3080 2050 50 0000 C CNN 238 | F 1 "100" V 3000 2050 50 0000 C CNN 239 | F 2 "Resistors_SMD:R_0603" V 2930 2050 50 0001 C CNN 240 | F 3 "" H 3000 2050 50 0001 C CNN 241 | F 4 "660-RK73H1JTTD1000F" H 3000 2050 60 0001 C CNN "bom_partno" 242 | 1 3000 2050 243 | -1 0 0 1 244 | $EndComp 245 | $Comp 246 | L C C101 247 | U 1 1 59196A2F 248 | P 2850 2300 249 | F 0 "C101" H 2875 2400 50 0000 L CNN 250 | F 1 "4.7n" H 2875 2200 50 0000 L CNN 251 | F 2 "Capacitors_SMD:C_0603" H 2888 2150 50 0001 C CNN 252 | F 3 "" H 2850 2300 50 0001 C CNN 253 | F 4 "710-885012206087" H 2850 2300 60 0001 C CNN "bom_partno" 254 | 1 2850 2300 255 | 0 1 1 0 256 | $EndComp 257 | $Comp 258 | L FDMS8050 Q102 259 | U 1 1 5919A45C 260 | P 4450 1700 261 | F 0 "Q102" H 4250 2000 50 0000 L CNN 262 | F 1 "FDMS8050" H 4250 1450 50 0000 L CNN 263 | F 2 "TO_SOT_Packages_SMD:TDSON-8-1" H 4450 1356 50 0001 C CIN 264 | F 3 "" V 4450 1700 50 0001 L CNN 265 | F 4 "726-BSC882N03LSG" H 4450 1700 60 0001 C CNN "bom_partno" 266 | 1 4450 1700 267 | -1 0 0 -1 268 | $EndComp 269 | $Comp 270 | L R R105 271 | U 1 1 5919AF49 272 | P 3150 1650 273 | F 0 "R105" V 3230 1650 50 0000 C CNN 274 | F 1 "1M" V 3150 1650 50 0000 C CNN 275 | F 2 "Resistors_SMD:R_0603" V 3080 1650 50 0001 C CNN 276 | F 3 "" H 3150 1650 50 0001 C CNN 277 | F 4 "71-CRCW0603-1.0M-E3" H 3150 1650 60 0001 C CNN "bom_partno" 278 | 1 3150 1650 279 | -1 0 0 1 280 | $EndComp 281 | $Comp 282 | L R R106 283 | U 1 1 5919BB30 284 | P 3150 1950 285 | F 0 "R106" V 3230 1950 50 0000 C CNN 286 | F 1 "100" V 3150 1950 50 0000 C CNN 287 | F 2 "Resistors_SMD:R_0603" V 3080 1950 50 0001 C CNN 288 | F 3 "" H 3150 1950 50 0001 C CNN 289 | F 4 "660-RK73H1JTTD1000F" H 3150 1950 60 0001 C CNN "bom_partno" 290 | 1 3150 1950 291 | -1 0 0 1 292 | $EndComp 293 | $Comp 294 | L R R108 295 | U 1 1 5919D122 296 | P 4900 1650 297 | F 0 "R108" V 4980 1650 50 0000 C CNN 298 | F 1 "1M" V 4900 1650 50 0000 C CNN 299 | F 2 "Resistors_SMD:R_0603" V 4830 1650 50 0001 C CNN 300 | F 3 "" H 4900 1650 50 0001 C CNN 301 | F 4 "71-CRCW0603-1.0M-E3" H 4900 1650 60 0001 C CNN "bom_partno" 302 | 1 4900 1650 303 | -1 0 0 1 304 | $EndComp 305 | $Comp 306 | L R R109 307 | U 1 1 5919D228 308 | P 4900 1950 309 | F 0 "R109" V 4980 1950 50 0000 C CNN 310 | F 1 "100" V 4900 1950 50 0000 C CNN 311 | F 2 "Resistors_SMD:R_0603" V 4830 1950 50 0001 C CNN 312 | F 3 "" H 4900 1950 50 0001 C CNN 313 | F 4 "660-RK73H1JTTD1000F" H 4900 1950 60 0001 C CNN "bom_partno" 314 | 1 4900 1950 315 | -1 0 0 1 316 | $EndComp 317 | $Comp 318 | L R R110 319 | U 1 1 5919FBEE 320 | P 5900 1850 321 | F 0 "R110" V 5980 1850 50 0000 C CNN 322 | F 1 "1k" V 5900 1850 50 0000 C CNN 323 | F 2 "Resistors_SMD:R_0603" V 5830 1850 50 0001 C CNN 324 | F 3 "" H 5900 1850 50 0001 C CNN 325 | F 4 "71-CRCW0603-1.0K-E3" H 5900 1850 60 0001 C CNN "bom_partno" 326 | 1 5900 1850 327 | -1 0 0 1 328 | $EndComp 329 | $Comp 330 | L C C106 331 | U 1 1 591A1D4A 332 | P 5800 2300 333 | F 0 "C106" H 5825 2400 50 0000 L CNN 334 | F 1 "4.7n" H 5825 2200 50 0000 L CNN 335 | F 2 "Capacitors_SMD:C_0603" H 5838 2150 50 0001 C CNN 336 | F 3 "" H 5800 2300 50 0001 C CNN 337 | F 4 "710-885012206087" H 5800 2300 60 0001 C CNN "bom_partno" 338 | 1 5800 2300 339 | -1 0 0 1 340 | $EndComp 341 | $Comp 342 | L C C105 343 | U 1 1 591A1FE3 344 | P 5600 2500 345 | F 0 "C105" H 5625 2600 50 0000 L CNN 346 | F 1 "4.7n" H 5625 2400 50 0000 L CNN 347 | F 2 "Capacitors_SMD:C_0603" H 5638 2350 50 0001 C CNN 348 | F 3 "" H 5600 2500 50 0001 C CNN 349 | F 4 "710-885012206087" H 5600 2500 60 0001 C CNN "bom_partno" 350 | 1 5600 2500 351 | -1 0 0 1 352 | $EndComp 353 | $Comp 354 | L Jumper_NO_Small JP101 355 | U 1 1 591A9C77 356 | P 1875 5125 357 | F 0 "JP101" H 1875 5205 50 0000 C CNN 358 | F 1 "." H 1885 5065 50 0000 C CNN 359 | F 2 "conn-test:JUMPER-SOLDER-SMD" H 1875 5125 50 0001 C CNN 360 | F 3 "" H 1875 5125 50 0001 C CNN 361 | 1 1875 5125 362 | 1 0 0 -1 363 | $EndComp 364 | $Comp 365 | L GND #PWR08 366 | U 1 1 591B86DD 367 | P 6500 1925 368 | F 0 "#PWR08" H 6500 1675 50 0001 C CNN 369 | F 1 "GND" H 6500 1775 50 0000 C CNN 370 | F 2 "" H 6500 1925 50 0001 C CNN 371 | F 3 "" H 6500 1925 50 0001 C CNN 372 | 1 6500 1925 373 | 1 0 0 -1 374 | $EndComp 375 | Text Notes 6800 2800 2 60 ~ 0 376 | VREF=1.8V\nRGO=2.5V\n 377 | $Comp 378 | L GND #PWR09 379 | U 1 1 591BDC3F 380 | P 7350 4400 381 | F 0 "#PWR09" H 7350 4150 50 0001 C CNN 382 | F 1 "GND" H 7350 4250 50 0000 C CNN 383 | F 2 "" H 7350 4400 50 0001 C CNN 384 | F 3 "" H 7350 4400 50 0001 C CNN 385 | 1 7350 4400 386 | 1 0 0 -1 387 | $EndComp 388 | $Comp 389 | L R R113 390 | U 1 1 591C0A45 391 | P 6600 5200 392 | F 0 "R113" V 6680 5200 50 0000 C CNN 393 | F 1 "22k" V 6600 5200 50 0000 C CNN 394 | F 2 "Resistors_SMD:R_0603" V 6530 5200 50 0001 C CNN 395 | F 3 "" H 6600 5200 50 0001 C CNN 396 | F 4 "652-CR0603FX-2202ELF" H 6600 5200 60 0001 C CNN "bom_partno" 397 | 1 6600 5200 398 | -1 0 0 1 399 | $EndComp 400 | $Comp 401 | L R R114 402 | U 1 1 591C0B7A 403 | P 6950 5200 404 | F 0 "R114" V 7030 5200 50 0000 C CNN 405 | F 1 "22k" V 6950 5200 50 0000 C CNN 406 | F 2 "Resistors_SMD:R_0603" V 6880 5200 50 0001 C CNN 407 | F 3 "" H 6950 5200 50 0001 C CNN 408 | F 4 "652-CR0603FX-2202ELF" H 6950 5200 60 0001 C CNN "bom_partno" 409 | 1 6950 5200 410 | -1 0 0 1 411 | $EndComp 412 | $Comp 413 | L Thermistor TH101 414 | U 1 1 591C1467 415 | P 6600 5700 416 | F 0 "TH101" V 6700 5750 50 0000 C CNN 417 | F 1 "Thermistor" V 6500 5700 50 0000 C BNN 418 | F 2 "Resistors_SMD:R_0603" H 6600 5700 50 0001 C CNN 419 | F 3 "" H 6600 5700 50 0001 C CNN 420 | F 4 "NCP18XH103J03RB" H 6600 5700 60 0001 C CNN "bom_partno" 421 | 1 6600 5700 422 | 1 0 0 -1 423 | $EndComp 424 | $Comp 425 | L GND #PWR010 426 | U 1 1 591C20D1 427 | P 6750 6050 428 | F 0 "#PWR010" H 6750 5800 50 0001 C CNN 429 | F 1 "GND" H 6750 5900 50 0000 C CNN 430 | F 2 "" H 6750 6050 50 0001 C CNN 431 | F 3 "" H 6750 6050 50 0001 C CNN 432 | 1 6750 6050 433 | 1 0 0 -1 434 | $EndComp 435 | $Comp 436 | L R R115 437 | U 1 1 591C2799 438 | P 7200 5700 439 | F 0 "R115" V 7280 5700 50 0000 C CNN 440 | F 1 "10k" V 7200 5700 50 0000 C CNN 441 | F 2 "Resistors_SMD:R_0603" V 7130 5700 50 0001 C CNN 442 | F 3 "" H 7200 5700 50 0001 C CNN 443 | F 4 "71-CRCW0603-10K-E3" H 7200 5700 60 0001 C CNN "bom_partno" 444 | 1 7200 5700 445 | -1 0 0 1 446 | $EndComp 447 | $Comp 448 | L R R112 449 | U 1 1 591C28D3 450 | P 6350 5700 451 | F 0 "R112" V 6430 5700 50 0000 C CNN 452 | F 1 "10k" V 6350 5700 50 0000 C CNN 453 | F 2 "Resistors_SMD:R_0603" V 6280 5700 50 0001 C CNN 454 | F 3 "" H 6350 5700 50 0001 C CNN 455 | F 4 "71-CRCW0603-10K-E3" H 6350 5700 60 0001 C CNN "bom_partno" 456 | 1 6350 5700 457 | -1 0 0 1 458 | $EndComp 459 | Text Label 6600 3200 0 60 ~ 0 460 | RGO 461 | Text Label 6600 3700 0 60 ~ 0 462 | ~INT 463 | $Comp 464 | L C C107 465 | U 1 1 591852C0 466 | P 7800 4250 467 | F 0 "C107" H 7825 4350 50 0000 L CNN 468 | F 1 "100n" H 7825 4150 50 0000 L CNN 469 | F 2 "Capacitors_SMD:C_0603" H 7838 4100 50 0001 C CNN 470 | F 3 "" H 7800 4250 50 0001 C CNN 471 | F 4 "710-885012206071" H 7800 4250 60 0001 C CNN "bom_partno" 472 | 1 7800 4250 473 | 1 0 0 -1 474 | $EndComp 475 | $Comp 476 | L GND #PWR011 477 | U 1 1 59185407 478 | P 7800 4400 479 | F 0 "#PWR011" H 7800 4150 50 0001 C CNN 480 | F 1 "GND" H 7800 4250 50 0000 C CNN 481 | F 2 "" H 7800 4400 50 0001 C CNN 482 | F 3 "" H 7800 4400 50 0001 C CNN 483 | 1 7800 4400 484 | 1 0 0 -1 485 | $EndComp 486 | $Comp 487 | L C C119 488 | U 1 1 5918D1C3 489 | P 5300 5350 490 | F 0 "C119" H 5325 5450 50 0000 L CNN 491 | F 1 "1u" H 5325 5250 50 0000 L CNN 492 | F 2 "Capacitors_SMD:C_0603" H 5338 5200 50 0001 C CNN 493 | F 3 "" H 5300 5350 50 0001 C CNN 494 | F 4 "710-885012106022" H 5300 5350 60 0001 C CNN "bom_partno" 495 | 1 5300 5350 496 | 1 0 0 -1 497 | $EndComp 498 | $Comp 499 | L C C120 500 | U 1 1 5918D69C 501 | P 7600 4250 502 | F 0 "C120" H 7625 4350 50 0000 L CNN 503 | F 1 "1u" H 7625 4150 50 0000 L CNN 504 | F 2 "Capacitors_SMD:C_0603" H 7638 4100 50 0001 C CNN 505 | F 3 "" H 7600 4250 50 0001 C CNN 506 | F 4 "710-885012106022" H 7600 4250 60 0001 C CNN "bom_partno" 507 | 1 7600 4250 508 | 1 0 0 -1 509 | $EndComp 510 | Wire Wire Line 511 | 5000 4850 5000 4750 512 | Wire Wire Line 513 | 5100 4950 5100 4750 514 | Wire Wire Line 515 | 5200 5050 5200 4750 516 | Wire Wire Line 517 | 5300 5150 5300 4750 518 | Wire Wire Line 519 | 4900 4750 4300 4750 520 | Wire Wire Line 521 | 5500 5200 5500 4750 522 | Wire Wire Line 523 | 6750 4150 6600 4150 524 | Wire Wire Line 525 | 6600 4100 6600 4200 526 | Connection ~ 6600 4150 527 | Wire Wire Line 528 | 6750 4300 6600 4300 529 | Wire Wire Line 530 | 6600 4000 7050 4000 531 | Wire Wire Line 532 | 7050 4000 7050 4400 533 | Wire Wire Line 534 | 6600 3900 7150 3900 535 | Wire Wire Line 536 | 7150 3900 7150 4400 537 | Wire Wire Line 538 | 2700 1500 2700 1900 539 | Wire Wire Line 540 | 2250 1600 2700 1600 541 | Connection ~ 2700 1600 542 | Wire Wire Line 543 | 3000 1500 3000 1900 544 | Connection ~ 3000 1650 545 | Connection ~ 2700 1650 546 | Wire Wire Line 547 | 5000 2700 5000 2500 548 | Wire Wire Line 549 | 5000 2500 2700 2500 550 | Connection ~ 2700 2300 551 | Wire Wire Line 552 | 5100 2700 5100 2450 553 | Wire Wire Line 554 | 5100 2450 3000 2450 555 | Connection ~ 3000 2300 556 | Wire Wire Line 557 | 4150 1800 3950 1800 558 | Wire Wire Line 559 | 4150 1700 3950 1700 560 | Wire Wire Line 561 | 4150 1600 3950 1600 562 | Wire Wire Line 563 | 3950 1500 4150 1500 564 | Connection ~ 4050 1600 565 | Connection ~ 4050 1500 566 | Connection ~ 4050 1700 567 | Connection ~ 4050 1800 568 | Wire Wire Line 569 | 3000 1500 3350 1500 570 | Connection ~ 3150 1500 571 | Wire Wire Line 572 | 3350 1700 3000 1700 573 | Connection ~ 3000 1700 574 | Wire Wire Line 575 | 3350 1600 3000 1600 576 | Connection ~ 3000 1600 577 | Wire Wire Line 578 | 3350 1800 3150 1800 579 | Wire Wire Line 580 | 5200 2700 5200 2400 581 | Wire Wire Line 582 | 5200 2400 3150 2400 583 | Wire Wire Line 584 | 3150 2400 3150 2100 585 | Wire Wire Line 586 | 4900 1800 4750 1800 587 | Wire Wire Line 588 | 4750 1500 5100 1500 589 | Wire Wire Line 590 | 4750 1600 6500 1600 591 | Connection ~ 4900 1500 592 | Wire Wire Line 593 | 5100 1700 4750 1700 594 | Wire Wire Line 595 | 5100 1500 5100 1700 596 | Connection ~ 5100 1600 597 | Wire Wire Line 598 | 5500 2700 5500 2100 599 | Wire Wire Line 600 | 5500 2100 4900 2100 601 | Wire Wire Line 602 | 5400 2150 5400 2700 603 | Wire Wire Line 604 | 5900 2000 5900 2700 605 | Wire Wire Line 606 | 5900 1700 5900 1600 607 | Connection ~ 5900 1600 608 | Wire Wire Line 609 | 5800 2150 5400 2150 610 | Wire Wire Line 611 | 5800 2450 5800 2700 612 | Wire Wire Line 613 | 5600 2350 5700 2350 614 | Wire Wire Line 615 | 5700 2350 5700 2700 616 | Wire Wire Line 617 | 5600 2650 5600 2700 618 | Connection ~ 4900 1800 619 | Wire Wire Line 620 | 7350 4100 7350 3500 621 | Wire Wire Line 622 | 7350 3500 6600 3500 623 | Wire Wire Line 624 | 6600 3200 8100 3200 625 | Wire Wire Line 626 | 5800 5050 6950 5050 627 | Wire Wire Line 628 | 5800 5050 5800 4750 629 | Connection ~ 6600 5050 630 | Connection ~ 6950 5400 631 | Wire Wire Line 632 | 5700 4750 5700 5150 633 | Wire Wire Line 634 | 5700 5150 6400 5150 635 | Wire Wire Line 636 | 6400 5150 6400 5400 637 | Wire Wire Line 638 | 6400 5400 7200 5400 639 | Wire Wire Line 640 | 6600 5500 6600 5350 641 | Wire Wire Line 642 | 6600 5450 6250 5450 643 | Wire Wire Line 644 | 6250 5450 6250 5200 645 | Wire Wire Line 646 | 6250 5200 5600 5200 647 | Wire Wire Line 648 | 5600 5200 5600 4750 649 | Connection ~ 6600 5450 650 | Wire Wire Line 651 | 6350 6050 7200 6050 652 | Wire Wire Line 653 | 6600 5900 6600 6050 654 | Connection ~ 6750 6050 655 | Wire Wire Line 656 | 6350 5550 6350 5450 657 | Connection ~ 6350 5450 658 | Wire Wire Line 659 | 6350 5850 6350 6050 660 | Connection ~ 6600 6050 661 | Wire Wire Line 662 | 7200 6050 7200 5850 663 | Wire Wire Line 664 | 7200 5400 7200 5550 665 | Connection ~ 3250 1800 666 | Connection ~ 4800 1800 667 | Wire Wire Line 668 | 7800 3200 7800 4100 669 | Connection ~ 7700 3200 670 | Wire Wire Line 671 | 5300 5200 5500 5200 672 | Wire Wire Line 673 | 5300 5500 5500 5500 674 | Wire Wire Line 675 | 7800 4100 7600 4100 676 | Wire Wire Line 677 | 7600 4400 7800 4400 678 | Connection ~ 4300 5150 679 | Connection ~ 4300 5050 680 | Connection ~ 4300 4950 681 | Connection ~ 4300 4850 682 | Connection ~ 4300 4300 683 | Connection ~ 4300 4200 684 | Connection ~ 4300 3600 685 | Connection ~ 4300 3500 686 | Connection ~ 4300 3400 687 | Connection ~ 4300 3300 688 | Connection ~ 4300 3200 689 | Wire Wire Line 690 | 4300 4850 5000 4850 691 | Wire Wire Line 692 | 5100 4950 4300 4950 693 | Wire Wire Line 694 | 4300 5050 5200 5050 695 | Wire Wire Line 696 | 5300 5150 4300 5150 697 | $Comp 698 | L CONN_02X05 J1 699 | U 1 1 5945D9D3 700 | P 1725 4325 701 | F 0 "J1" H 1725 4625 50 0000 C CNN 702 | F 1 "CONN_02X05" H 1725 4025 50 0000 C CNN 703 | F 2 "Connectors:IDC_Header_Straight_10pins" H 1725 3125 50 0001 C CNN 704 | F 3 "" H 1725 3125 50 0001 C CNN 705 | 1 1725 4325 706 | -1 0 0 1 707 | $EndComp 708 | Text Label 3200 4000 2 60 ~ 0 709 | C8 710 | Text Label 3200 4100 2 60 ~ 0 711 | C7 712 | Text Label 3200 4200 2 60 ~ 0 713 | C6 714 | Text Label 3200 4300 2 60 ~ 0 715 | C5 716 | Text Label 3200 4400 2 60 ~ 0 717 | C4 718 | Text Label 3200 4500 2 60 ~ 0 719 | C3 720 | Text Label 3200 4600 2 60 ~ 0 721 | C2 722 | Text Label 3200 4700 2 60 ~ 0 723 | C1 724 | Text Label 3200 4800 2 60 ~ 0 725 | C0 726 | Text Label 1475 4125 2 60 ~ 0 727 | C8 728 | Text Label 1475 4225 2 60 ~ 0 729 | C6 730 | Text Label 1475 4325 2 60 ~ 0 731 | C4 732 | Text Label 1475 4425 2 60 ~ 0 733 | C2 734 | Text Label 1475 4525 2 60 ~ 0 735 | C0 736 | Text Label 1975 4125 0 60 ~ 0 737 | C7 738 | Text Label 1975 4225 0 60 ~ 0 739 | C5 740 | Text Label 1975 4325 0 60 ~ 0 741 | C3 742 | Text Label 1975 4425 0 60 ~ 0 743 | C1 744 | Text Label 1975 4525 0 60 ~ 0 745 | RemoteTemp 746 | Text Label 3750 2700 2 60 ~ 0 747 | C8 748 | Wire Wire Line 749 | 4900 2700 4050 2700 750 | Connection ~ 4300 4100 751 | Connection ~ 4300 4000 752 | Connection ~ 4300 3900 753 | Connection ~ 4300 3800 754 | Connection ~ 4300 3700 755 | Connection ~ 4300 4750 756 | Text Label 7200 5400 0 60 ~ 0 757 | RemoteTemp 758 | Wire Wire Line 759 | 6950 5350 6950 5400 760 | Text Notes 6825 5550 3 60 ~ 0 761 | FET Temp 762 | Wire Wire Line 763 | 4050 2325 5400 2325 764 | Wire Wire Line 765 | 5300 2325 5300 2700 766 | Text Notes 2575 5850 2 60 ~ 0 767 | <=7 Cells\n\n<=6 Cells\n\n<=5 Cells\n\n<=4 Cells\n\n==3 Cells 768 | Text Label 1775 5125 2 60 ~ 0 769 | C5 770 | Text Label 1975 5125 0 60 ~ 0 771 | C4 772 | $Comp 773 | L Jumper_NO_Small JP1 774 | U 1 1 59471FC3 775 | P 1875 5300 776 | F 0 "JP1" H 1875 5380 50 0000 C CNN 777 | F 1 "." H 1885 5240 50 0000 C CNN 778 | F 2 "conn-test:JUMPER-SOLDER-SMD" H 1875 5300 50 0001 C CNN 779 | F 3 "" H 1875 5300 50 0001 C CNN 780 | 1 1875 5300 781 | 1 0 0 -1 782 | $EndComp 783 | Text Label 1775 5300 2 60 ~ 0 784 | C4 785 | Text Label 1975 5300 0 60 ~ 0 786 | C3 787 | $Comp 788 | L Jumper_NO_Small JP2 789 | U 1 1 59472311 790 | P 1875 5475 791 | F 0 "JP2" H 1875 5555 50 0000 C CNN 792 | F 1 "." H 1885 5415 50 0000 C CNN 793 | F 2 "conn-test:JUMPER-SOLDER-SMD" H 1875 5475 50 0001 C CNN 794 | F 3 "" H 1875 5475 50 0001 C CNN 795 | 1 1875 5475 796 | 1 0 0 -1 797 | $EndComp 798 | Text Label 1775 5475 2 60 ~ 0 799 | C6 800 | Text Label 1975 5475 0 60 ~ 0 801 | C5 802 | $Comp 803 | L Jumper_NO_Small JP3 804 | U 1 1 594728B5 805 | P 1875 5650 806 | F 0 "JP3" H 1875 5730 50 0000 C CNN 807 | F 1 "." H 1885 5590 50 0000 C CNN 808 | F 2 "conn-test:JUMPER-SOLDER-SMD" H 1875 5650 50 0001 C CNN 809 | F 3 "" H 1875 5650 50 0001 C CNN 810 | 1 1875 5650 811 | 1 0 0 -1 812 | $EndComp 813 | Text Label 1775 5650 2 60 ~ 0 814 | C3 815 | Text Label 1975 5650 0 60 ~ 0 816 | C2 817 | $Comp 818 | L Jumper_NO_Small JP4 819 | U 1 1 59472C0D 820 | P 1875 5825 821 | F 0 "JP4" H 1875 5905 50 0000 C CNN 822 | F 1 "." H 1885 5765 50 0000 C CNN 823 | F 2 "conn-test:JUMPER-SOLDER-SMD" H 1875 5825 50 0001 C CNN 824 | F 3 "" H 1875 5825 50 0001 C CNN 825 | 1 1875 5825 826 | 1 0 0 -1 827 | $EndComp 828 | Text Label 1775 5825 2 60 ~ 0 829 | C7 830 | Text Label 1975 5825 0 60 ~ 0 831 | C6 832 | Text Notes 1275 4725 3 60 ~ 0 833 | Short these jumpers when cell count < 8 834 | Text Notes 7825 6375 2 60 ~ 0 835 | R115 =5K when no remote temp 836 | $Comp 837 | L OpenBMSRiser J2 838 | U 1 1 5947A060 839 | P 9325 3575 840 | F 0 "J2" H 9325 3575 60 0000 C CNN 841 | F 1 "OpenBMSRiser" H 9325 3475 60 0000 C CNN 842 | F 2 "BMSFootprints:OpenBMSRiser" H 9325 3575 60 0001 C CNN 843 | F 3 "" H 9325 3575 60 0001 C CNN 844 | 1 9325 3575 845 | 1 0 0 -1 846 | $EndComp 847 | Text Label 8725 4425 2 60 ~ 0 848 | RGO 849 | Text Label 6600 3400 0 60 ~ 0 850 | SD 851 | Text Label 8725 4325 2 60 ~ 0 852 | SD 853 | Text Label 7350 3500 0 60 ~ 0 854 | FETSOFF 855 | Text Label 8725 4225 2 60 ~ 0 856 | FETSOFF 857 | Text Label 8725 4125 2 60 ~ 0 858 | ~INT 859 | Text Label 8725 4025 2 60 ~ 0 860 | SDA 861 | Text Label 8725 3925 2 60 ~ 0 862 | SCL 863 | Text Label 8725 3825 2 60 ~ 0 864 | GND 865 | $Comp 866 | L R R18 867 | U 1 1 5947B974 868 | P 7550 3300 869 | F 0 "R18" V 7630 3300 50 0000 C CNN 870 | F 1 "10k" V 7550 3300 50 0000 C CNN 871 | F 2 "Resistors_SMD:R_0603" V 7480 3300 50 0001 C CNN 872 | F 3 "" H 7550 3300 50 0001 C CNN 873 | F 4 "71-CRCW0603-10K-E3" H 7550 3300 60 0001 C CNN "bom_partno" 874 | 1 7550 3300 875 | 0 -1 -1 0 876 | $EndComp 877 | Wire Wire Line 878 | 6600 3400 7400 3400 879 | Wire Wire Line 880 | 7400 3400 7400 3300 881 | $Comp 882 | L R R17 883 | U 1 1 5947BFE8 884 | P 7350 4250 885 | F 0 "R17" V 7430 4250 50 0000 C CNN 886 | F 1 "10k" V 7350 4250 50 0000 C CNN 887 | F 2 "Resistors_SMD:R_0603" V 7280 4250 50 0001 C CNN 888 | F 3 "" H 7350 4250 50 0001 C CNN 889 | F 4 "71-CRCW0603-10K-E3" H 7350 4250 60 0001 C CNN "bom_partno" 890 | 1 7350 4250 891 | 1 0 0 -1 892 | $EndComp 893 | $Comp 894 | L R R19 895 | U 1 1 5947CA92 896 | P 7550 3700 897 | F 0 "R19" V 7630 3700 50 0000 C CNN 898 | F 1 "10k" V 7550 3700 50 0000 C CNN 899 | F 2 "Resistors_SMD:R_0603" V 7480 3700 50 0001 C CNN 900 | F 3 "" H 7550 3700 50 0001 C CNN 901 | F 4 "71-CRCW0603-10K-E3" H 7550 3700 60 0001 C CNN "bom_partno" 902 | 1 7550 3700 903 | 0 -1 -1 0 904 | $EndComp 905 | Connection ~ 7700 3300 906 | Wire Wire Line 907 | 6600 3700 7400 3700 908 | Wire Wire Line 909 | 7700 3200 7700 3700 910 | $Comp 911 | L R R20 912 | U 1 1 5947D372 913 | P 7925 3350 914 | F 0 "R20" V 8005 3350 50 0000 C CNN 915 | F 1 "10k" V 7925 3350 50 0000 C CNN 916 | F 2 "Resistors_SMD:R_0603" V 7855 3350 50 0001 C CNN 917 | F 3 "" H 7925 3350 50 0001 C CNN 918 | F 4 "71-CRCW0603-10K-E3" H 7925 3350 60 0001 C CNN "bom_partno" 919 | 1 7925 3350 920 | 1 0 0 -1 921 | $EndComp 922 | $Comp 923 | L R R21 924 | U 1 1 5947D4CB 925 | P 8100 3350 926 | F 0 "R21" V 8180 3350 50 0000 C CNN 927 | F 1 "10k" V 8100 3350 50 0000 C CNN 928 | F 2 "Resistors_SMD:R_0603" V 8030 3350 50 0001 C CNN 929 | F 3 "" H 8100 3350 50 0001 C CNN 930 | F 4 "71-CRCW0603-10K-E3" H 8100 3350 60 0001 C CNN "bom_partno" 931 | 1 8100 3350 932 | 1 0 0 -1 933 | $EndComp 934 | Connection ~ 7800 3200 935 | Connection ~ 7925 3200 936 | Text Label 7925 3500 3 60 ~ 0 937 | SDA 938 | Text Label 8100 3500 3 60 ~ 0 939 | SCL 940 | Wire Wire Line 941 | 5900 2700 6000 2700 942 | Connection ~ 5900 2700 943 | Connection ~ 5400 2325 944 | Connection ~ 5300 2325 945 | $Comp 946 | L Mounting_Hole MK1 947 | U 1 1 594841F3 948 | P 9100 6225 949 | F 0 "MK1" H 9100 6425 50 0000 C CNN 950 | F 1 "Mounting_Hole" H 9100 6350 50 0000 C CNN 951 | F 2 "Mounting_Holes:MountingHole_3.2mm_M3" H 9100 6225 50 0001 C CNN 952 | F 3 "" H 9100 6225 50 0001 C CNN 953 | 1 9100 6225 954 | 1 0 0 -1 955 | $EndComp 956 | $Comp 957 | L Mounting_Hole MK2 958 | U 1 1 59485358 959 | P 9650 6225 960 | F 0 "MK2" H 9650 6425 50 0000 C CNN 961 | F 1 "Mounting_Hole" H 9650 6350 50 0000 C CNN 962 | F 2 "Mounting_Holes:MountingHole_3.2mm_M3" H 9650 6225 50 0001 C CNN 963 | F 3 "" H 9650 6225 50 0001 C CNN 964 | 1 9650 6225 965 | 1 0 0 -1 966 | $EndComp 967 | $Comp 968 | L Mounting_Hole MK3 969 | U 1 1 59485495 970 | P 10200 6225 971 | F 0 "MK3" H 10200 6425 50 0000 C CNN 972 | F 1 "Mounting_Hole" H 10200 6350 50 0000 C CNN 973 | F 2 "Mounting_Holes:MountingHole_3.2mm_M3" H 10200 6225 50 0001 C CNN 974 | F 3 "" H 10200 6225 50 0001 C CNN 975 | 1 10200 6225 976 | 1 0 0 -1 977 | $EndComp 978 | $Comp 979 | L Mounting_Hole MK4 980 | U 1 1 594855DB 981 | P 10750 6225 982 | F 0 "MK4" H 10750 6425 50 0000 C CNN 983 | F 1 "Mounting_Hole" H 10750 6350 50 0000 C CNN 984 | F 2 "Mounting_Holes:MountingHole_3.2mm_M3" H 10750 6225 50 0001 C CNN 985 | F 3 "" H 10750 6225 50 0001 C CNN 986 | 1 10750 6225 987 | 1 0 0 -1 988 | $EndComp 989 | Wire Wire Line 990 | 4050 1500 4050 2325 991 | $Comp 992 | L CONN_01X01 J3 993 | U 1 1 59491371 994 | P 2050 1600 995 | F 0 "J3" H 2050 1700 50 0000 C CNN 996 | F 1 "VBATT+" V 2150 1600 50 0000 C CNN 997 | F 2 "Wire_Pads:SolderWirePad_single_2mmDrill" H 2050 1600 50 0001 C CNN 998 | F 3 "" H 2050 1600 50 0001 C CNN 999 | 1 2050 1600 1000 | -1 0 0 1 1001 | $EndComp 1002 | $Comp 1003 | L CONN_01X01 J4 1004 | U 1 1 59491D1C 1005 | P 2050 1925 1006 | F 0 "J4" H 2050 2025 50 0000 C CNN 1007 | F 1 "VBATT-" V 2150 1925 50 0000 C CNN 1008 | F 2 "Wire_Pads:SolderWirePad_single_2mmDrill" H 2050 1925 50 0001 C CNN 1009 | F 3 "" H 2050 1925 50 0001 C CNN 1010 | 1 2050 1925 1011 | -1 0 0 1 1012 | $EndComp 1013 | $Comp 1014 | L CONN_01X01 J5 1015 | U 1 1 59493A23 1016 | P 6700 1600 1017 | F 0 "J5" H 6700 1700 50 0000 C CNN 1018 | F 1 "PACK+" V 6800 1600 50 0000 C CNN 1019 | F 2 "Wire_Pads:SolderWirePad_single_2mmDrill" H 6700 1600 50 0001 C CNN 1020 | F 3 "" H 6700 1600 50 0001 C CNN 1021 | 1 6700 1600 1022 | 1 0 0 1 1023 | $EndComp 1024 | $Comp 1025 | L CONN_01X01 J6 1026 | U 1 1 59493A29 1027 | P 6700 1925 1028 | F 0 "J6" H 6700 2025 50 0000 C CNN 1029 | F 1 "PACK-" V 6800 1925 50 0000 C CNN 1030 | F 2 "Wire_Pads:SolderWirePad_single_2mmDrill" H 6700 1925 50 0001 C CNN 1031 | F 3 "" H 6700 1925 50 0001 C CNN 1032 | 1 6700 1925 1033 | 1 0 0 1 1034 | $EndComp 1035 | Wire Wire Line 1036 | 2700 2500 2700 2200 1037 | Wire Wire Line 1038 | 3000 2450 3000 2200 1039 | $Comp 1040 | L GND #PWR? 1041 | U 1 1 594980C9 1042 | P 1475 4525 1043 | F 0 "#PWR?" H 1475 4275 50 0001 C CNN 1044 | F 1 "GND" H 1475 4375 50 0000 C CNN 1045 | F 2 "" H 1475 4525 50 0001 C CNN 1046 | F 3 "" H 1475 4525 50 0001 C CNN 1047 | 1 1475 4525 1048 | 1 0 0 -1 1049 | $EndComp 1050 | $EndSCHEMATC 1051 | -------------------------------------------------------------------------------- /Front Panel Code/OpenBMS/.cproject: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 28 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 139 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | --------------------------------------------------------------------------------