Adds Balancing function (on the top of SPI_I2C_Parser.cpp) and changes main function adding a test case for balancing to show that it is working as intended.

Dependencies:   CUER_CAN mbed

Fork of BMS_BMUCore_cellvoltage_Mrinank by Mrinank Sharma

Committer:
ItsJustZi
Date:
Tue Aug 23 01:08:29 2016 +0000
Revision:
2:34d6953c3623
Parent:
1:7f03b5aba5d2
Child:
3:2238838234e1
Added SPI Parser needed to read cell voltages from LTC6804 CMUs. Empty Main loop. Mainly based on Linear Tech Linduino code with very minor modifications.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ItsJustZi 2:34d6953c3623 1 #ifndef BMU_H
ItsJustZi 2:34d6953c3623 2 #define BMU_H
ItsJustZi 2:34d6953c3623 3
ItsJustZi 2:34d6953c3623 4 #include "SPI_I2C_Parser.h"
ItsJustZi 2:34d6953c3623 5 #include "mbed.h"
ItsJustZi 2:34d6953c3623 6 #include "CAN_Data.h"
ItsJustZi 2:34d6953c3623 7 #include "CAN_IDs.h"
ItsJustZi 2:34d6953c3623 8 #include <stdlib.h>
ItsJustZi 2:34d6953c3623 9
ItsJustZi 2:34d6953c3623 10
ItsJustZi 2:34d6953c3623 11 const int numberOfCMUs=3;
ItsJustZi 2:34d6953c3623 12 const int numberOfCells=34;
ItsJustZi 2:34d6953c3623 13
ItsJustZi 2:34d6953c3623 14
ItsJustZi 1:7f03b5aba5d2 15 enum bms_overall_status {
ItsJustZi 1:7f03b5aba5d2 16 BMS_ERROR = 0,
ItsJustZi 1:7f03b5aba5d2 17 BMS_IDLE = 1,
ItsJustZi 1:7f03b5aba5d2 18 BMS_ENABLE = 5, // defined this way to keep consistency with old Tritium BMS
ItsJustZi 1:7f03b5aba5d2 19 BMS_MEASURE = 2,
ItsJustZi 1:7f03b5aba5d2 20 BMS_PRECHARGE = 3,
ItsJustZi 1:7f03b5aba5d2 21 BMS_RUN = 4
ItsJustZi 2:34d6953c3623 22 };
ItsJustZi 2:34d6953c3623 23
ItsJustZi 2:34d6953c3623 24 #endif