MAX11068EVKIT+ Maxim Integrated Products, MAX11068EVKIT+ Datasheet - Page 68

no-image

MAX11068EVKIT+

Manufacturer Part Number
MAX11068EVKIT+
Description
KIT SMART BATT MEASUREMENT 12CH
Manufacturer
Maxim Integrated Products
Datasheets

Specifications of MAX11068EVKIT+

Main Purpose
Power Management, Battery Monitor, Car
Utilized Ic / Part
MAX11068
Primary Attributes
Monitors Current, Voltage, Temperature
Secondary Attributes
1 ~ 12 Cell- Li-Ion, 1 ~ 12 Cell- NiMH
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Embedded
-
12-Channel, High-Voltage Sensor, Smart
Data-Acquisition Interface
an 8-bit pipeline is shown for all parts of the circuit. The
MSB of the remainder controls a mux to select which
operation is performed on the left-shifted version of the
remainder byte. Once the remainder is operated on, it
is latched and fed back to the input of the shift register
through another mux. This is repeated until eight left
shifts have occurred. After eight left-shift operations
have been processed, the process is repeated on the
next input byte using the working CRC value, which is
the remainder following the left-shift operations. After all
input bytes have been processed, the CRC output byte
is the final result. Figure 42 shows a pseudo-code algo-
rithm for the CRC-8 logic that can be used in a software
or firmware implementation.
For write commands that require a PEC byte, the host
should perform this calculation on the byte sequence
that is transmitted. In applications where processing
time is extremely critical, it is possible to precalculate
the CRC value for the first few bytes of common com-
mands, or sometimes even for full commands, and store
these as constants. Then, when those commands are
used, the microcontroller can use the stored CRC value
for the precalculated portion of the message as an initial
value and only calculate the portion of a message that
may have changed in real time. This can save some pro-
cessing time, although the PEC algorithm is designed
to require a relatively small amount of processing
resources in most cases. For a READALL command, the
host should store the bytes of the received data stream,
perform the PEC calculation on the relevant bytes, and
compare the results to the received PEC byte. The PEC
may also be calculated as each byte is received instead
of waiting for the entire message to arrive by storing the
running CRC value and passing it to the PEC calculation
function for each new byte.
Figure 43 shows a typical WRITEALL command that is
being sent by the host controller for which the PEC byte
must be calculated.
Figure 43 shows 4 bytes preceding the transmission of
the PEC byte. The first is the broadcast address, which
is assumed to be the default of 0x40. The next byte 0x09
is the register address corresponding to the CELLEN
register that is written. The last 2 bytes are the new val-
ues of the register with the LSB first. The value of 0x03FF
that is written corresponds to enabling the first 10 cells
for measurement. These 4 bytes shown above represent
68
Example PEC Calculation
Figure 42. Example Pseudo-Code Algorithm for a CRC-8 PEC
Calculation
all bits included in the PEC byte calculation, and would
comprise the ByteList() array from the previous pseudo-
code algorithm. Applying the bytes 0x40, 0x09, 0xFF,
and 0x03 in sequence to the CRC algorithm yields a final
CRC result of 0x7F, which would be the value of the PEC
byte that the host should send immediately following the
data MSB.
Function PEC_Calculation(ByteList(), NumberOfBytes, CRCByte)
{
}
//CRCByte is typically initialized to 0 for each ByteList. If processing time
//must be conserved, it is possible to precalculate the CRCByte value
//for a known set of bytes at the beginning of a message. Then, this
//CRCByte value for the partial ByteList may be passed into the function
//as the initial value along with the remaining bytes of the message
//resulting in less computation steps.
//Loop once for each byte in the ByteList
For Counter1 = 0 to (NumberOfBytes –1)
(
)
Return CRCByte
//Bitwise XOR the current CRC value with the ByteList byte
Remainder = CRCByte XOR ByteList(Counter1)
//Process each of the 8 Remainder bits
For Counter2 = 8 To 1 Step -1
(
)
CRCByte = Remainder
//Operate on the next data byte in the ByteList
Next Counter1
//Determine if MSB = 1 prior to left shift
If (Remainder And &H80) = &H80 Then
Else
End If
//Truncate the CRC value to 8 bits
Remainder = Remainder And &HFF
//Proceed to the next Remainder bit
Next Counter2
//When MSB = 1, left shift and XOR with 8 lsbs of the polynomial
Remainder = ((Remainder * 2) XOR &H7)
//When MSB = 0, left shift 1 bit
Remainder = (Remainder * 2)

Related parts for MAX11068EVKIT+