DC2100A  1.2.0
Bi-Directional Cell Balancer Using the LTC3300-1 and the LTC6804-2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages

Reference Application File for Monitoring Voltages from the LTC6804-2 Battery Monitor on the DC2100A PCB. More...

Go to the source code of this file.

Detailed Description

Reference Application File for Monitoring Voltages from the LTC6804-2 Battery Monitor on the DC2100A PCB.

Definition in file Voltage.h.

Functions

void Voltage_Init (void)
 Initializes the parts of the Voltage Module, that need to be initialized upon power-up of the PIC. More...
 
BOOLEAN Voltage_Wakeup_Init (void)
 Initializes the parts of the Voltage Module, that need to be initialized upon wakeup of the LTC6804. More...
 
void Voltage_Monitor_Task (void)
 Executes the Voltage Monitor task. More...
 
BOOLEAN Voltage_UVOV_Thresholds_Set (unsigned int16 vuv_value, unsigned int16 vov_value)
 Sets the under-voltage and over-voltage thresholds in all DC2100A in the system. More...
 

Macros

Voltage Monitor Module Constants
#define VOLTAGE_TASK_RATE   100
 in ms, the rate at which the voltage monitor task is executed More...
 
#define VOLTAGE_CELL_BITS_PER_MV   (UV_PER_V/MV_PER_V/LTC6804_VOLTAGE_RESOLUTION)
 number of bits per mV in cell voltage measurements More...
 

Typedefs

typedef unsigned int16 VOLTAGE_CELL_PRESENT_TYPE
 Bitmap indicating if a cell input on the LTC6804 is populated or shorted. More...
 

Variables

Voltage Measurements
unsigned int16 voltage_cell [DC2100A_MAX_BOARDS][DC2100A_NUM_CELLS]
 Measured cell voltages for each board in LTC6804_VOLTAGE_RESOLUTION. More...
 
unsigned int16 voltage_sum [DC2100A_MAX_BOARDS]
 Measured sum of the cell voltages for this board in LTC6804_SOC_RESOLUTION. More...
 
unsigned int32 voltage_timestamp
 Timestamp taken when voltage measurements were started. More...
 
unsigned int8 voltage_balancestamp
 1 if balancers were on when these measurements were taken, otherwise 0 More...
 
Under-Voltage and Over-Voltage Monitoring
unsigned int16 voltage_vov_threshold
 over-voltage threshold in LTC6804_VOLTAGE_RESOLUTION. More...
 
unsigned int16 voltage_vuv_threshold
 under-voltage threshold in LTC6804_VOLTAGE_RESOLUTION. More...
 
unsigned int16 voltage_ov_flags [DC2100A_MAX_BOARDS]
 Bitmap indicating if a cell input on the LTC6804 is over-voltage (1) or not (0). More...
 
unsigned int16 voltage_uv_flags [DC2100A_MAX_BOARDS]
 Bitmap indicating if a cell input on the LTC6804 is under-voltage (1) or not (0). More...
 
VOLTAGE_CELL_PRESENT_TYPE voltage_cell_present_flags [DC2100A_MAX_BOARDS]
 Bitmap indicating if a cell input on the LTC6804 is unpopulated (0), such that UV conditions should be ignored. More...
 

Function Documentation

void Voltage_Init ( void  )

Initializes the parts of the Voltage Module, that need to be initialized upon power-up of the PIC.

Returns
void

Definition at line 106 of file Voltage.c.

void Voltage_Monitor_Task ( void  )

Executes the Voltage Monitor task.

  • Measures all cell voltages in the system. Note that all DC2100A voltages are started simultaneously and read sequentially.
  • A timestamp is attached to each voltage for mathematical operations to be performed on the samples.
  • The state of the balancers is saved, as the cell voltage measurements are affected by the large DC2100A balance currents.
  • Calculates the sum-of-cells voltages for each LTC6804 in the system.
  • Monitors each cell for UV and OV. Balancing is stopped if UV or OV occurs, and in USB message is sent to the GUI
    Returns
    void

Definition at line 140 of file Voltage.c.

BOOLEAN Voltage_UVOV_Thresholds_Set ( unsigned int16  vuv_value,
unsigned int16  vov_value 
)

Sets the under-voltage and over-voltage thresholds in all DC2100A in the system.

Returns
TRUE if voltage thresholds successfully set.
Parameters
vuv_valueover-voltage threshold in LTC6804_VOLTAGE_RESOLUTION.
vov_valueunder-voltage threshold in LTC6804_VOLTAGE_RESOLUTION.

Definition at line 248 of file Voltage.c.

BOOLEAN Voltage_Wakeup_Init ( void  )

Initializes the parts of the Voltage Module, that need to be initialized upon wakeup of the LTC6804.

Returns
TRUE if initialization was successful.

Definition at line 128 of file Voltage.c.

Macro Definition Documentation

#define VOLTAGE_CELL_BITS_PER_MV   (UV_PER_V/MV_PER_V/LTC6804_VOLTAGE_RESOLUTION)

number of bits per mV in cell voltage measurements

Definition at line 69 of file Voltage.h.

#define VOLTAGE_TASK_RATE   100

in ms, the rate at which the voltage monitor task is executed

Definition at line 68 of file Voltage.h.

Typedef Documentation

typedef unsigned int16 VOLTAGE_CELL_PRESENT_TYPE

Bitmap indicating if a cell input on the LTC6804 is populated or shorted.

Definition at line 72 of file Voltage.h.

Variable Documentation

unsigned int8 voltage_balancestamp

1 if balancers were on when these measurements were taken, otherwise 0

Definition at line 84 of file Voltage.c.

unsigned int16 voltage_cell[DC2100A_MAX_BOARDS][DC2100A_NUM_CELLS]

Measured cell voltages for each board in LTC6804_VOLTAGE_RESOLUTION.

Definition at line 81 of file Voltage.c.

VOLTAGE_CELL_PRESENT_TYPE voltage_cell_present_flags[DC2100A_MAX_BOARDS]

Bitmap indicating if a cell input on the LTC6804 is unpopulated (0), such that UV conditions should be ignored.

Definition at line 90 of file Voltage.c.

unsigned int16 voltage_ov_flags[DC2100A_MAX_BOARDS]

Bitmap indicating if a cell input on the LTC6804 is over-voltage (1) or not (0).

Definition at line 88 of file Voltage.c.

unsigned int16 voltage_sum[DC2100A_MAX_BOARDS]

Measured sum of the cell voltages for this board in LTC6804_SOC_RESOLUTION.

Definition at line 82 of file Voltage.c.

unsigned int32 voltage_timestamp

Timestamp taken when voltage measurements were started.

Definition at line 83 of file Voltage.c.

unsigned int16 voltage_uv_flags[DC2100A_MAX_BOARDS]

Bitmap indicating if a cell input on the LTC6804 is under-voltage (1) or not (0).

Definition at line 89 of file Voltage.c.

unsigned int16 voltage_vov_threshold

over-voltage threshold in LTC6804_VOLTAGE_RESOLUTION.

Definition at line 86 of file Voltage.c.

unsigned int16 voltage_vuv_threshold

under-voltage threshold in LTC6804_VOLTAGE_RESOLUTION.

Definition at line 87 of file Voltage.c.