
14
Rev. 0
APPENDIX A: THE SKETCHBOOK CONTENTS
The bmsSketchbook will generally contain the follow-
ing folders: Libraries, Part Number, Documentation,
and Utilities.
Libraries directory:
contains a subdirectory for each IC
in the sketchbook. Each subdirectory contains a .cpp and
.h file. These files contain all of the constant definitions
and low-level IC command implementations. Porting to
a different microcontroller requires changes to some
library files.
Part Number directory:
contains example control pro-
grams for each IC. Inside the Part Number folder, each
BMS IC has a sketch(.ino) file that implements a control
program to evaluate the functionality of the IC. This sketch
allows the user to control the IC through a serial terminal
and make all primary measurements. This sketch also
allows for evaluation of self-test and discharge features
of the IC. Generally, the name of a sketch relates to the
IC’s demo board. For example, the sketch for LTC6804
is DC1942.ino, for LTC6811 it is DC2259.ino, and for
LTC6810 it is DC2515_New.ino.
Utilities directory:
contains support programs, including
a program that emulates a standard Linear Technology
DC590 isolated USB to serial controller.
Documentation directory:
contains html documentation
for the provided code base. Documentation for all of the
BMS ICs can be accessed by opening the Linduino.html
file, as found in the main sketchbook directory (shown
below) and in the Documentation directory.
What Is A Sketch
A “sketch” is simply another word for a microcontroller/
Linduino program. The term is generally only used when
referring to Arduino based programs, as sketches have
several abstractions that remove some of the complex-
ity of a standard microcontroller(MCU) program. All
sketches contains two primary functions, the setup() and
the loop() function. These are in fact the only functions
that are mandatory in a sketch and are almost always
implemented in some form in a typical MCU program. The
setup() function is run once at power on or after the MCU
is reset. The setup() function generally is used to initial-
ize the MCU peripheral circuits and to initialize all of the
control variables. The loop() function is similar to a main()
function that has implemented an infinite loop inside a
standard C program. The code within the loop() function
is typically where the primary program code is placed.
The code within the loop() function will repeat infinitely.
Sketch Modifications
Sketches can be modified to a set of applications spe-
cific requirements. All sketches are written such that the
most common modifications can be made by changing
the variables listed in the /*Setup Variables */ table at the
top of the sketch. For reference, example modifications
to a DC2259 (LTC6811) sketch are shown below. These
modifications are applicable to most of the available BMS
ICs in the sketchbook.