Data Sheet AD7284
Rev. C | Page 29 of 49
SERIAL PERIPHERAL INTERFACE (SPI)
The AD7284 SPI is Mode 1 SPI compatible, that is, the clock
polarity (CPOL) is 0, and the clock phase (CPHA) is 1. The
interface consists of four signals: CS, SCLK, SDI, and SDO, as
shown in Figure 3. The SDI line transfers data into the on-chip
registers, and the SDO line reads the on-chip registers and
conversion result registers. SCLK is the serial clock input for the
device, and all data transfers, either on SDI or on SDO, take
place with respect to SCLK. Data clocks into the AD7284 on the
SCLK falling edge, and data clocks out of the AD7284 on the
SCLK rising edge. The CS input frames the serial data being
transferred to or from the device. The register data and the
ADC conversion readback data can be framed by CS in 32-bit
or 16-bit SCLK bursts, allowing the greatest flexibility for
connecting to processors.
All register reads and writes are configured as 32 bits of data,
while all conversion results are configured as 64-bits words.
The AD7284 powers up in 32-bit mode and automatically enters
64-bit mode when conversions initiate. The device remains in
64-bit mode until returned to 32-bit mode by writing 0x04 to
the ADC functional control register. Conversion data cannot be
reread from the AD7284; if an attempt is made to reread data, it
reads as 0. The life counter value is identical to the previous
read because it increments between conversion sets.
REGISTER WRITE AND REGISTER READ OPERATIONS
Up to 30 AD7284 devices can be daisy-chained together to
allow monitoring up to 240 individual Li-Ion cell voltages. The
AD7284 SPI interface, in combination with the daisy-chain
interface, allows any register in the 30 AD7284 stack to be
updated using one 32-bit write command.
All register write and read operations are performed via the SPI
using a 32-bit data packet. The format of the 32-bit data packet
is described in Table 10.
Each register access must include a device address and a register
address, in addition to the data to be written. The AD7284 also
requires a 12-bit cyclic redundancy check (CRC) to be included
in each 32-bit write command.
Register Read Operation
To read back a register from a chain of AD7284 devices, write
the address of the desired register to be read back to the read
register (Register 0x3F).
Follow this with null frames (0x00000000) for each device in
the daisy chain. For example, eight null frames for an eight
device chain. Each of these frame returns the register content of
each device, starting with the master. See the Examples of
Interfacing with the AD7284 section for more details.
It is not possible to read one register from one device in the
chain, that register in all devices in the chain must be read.
Device Address
The device address is a 5-bit address that allows each individual
AD7284 in the battery monitoring stack to be uniquely identified.
A maximum of 30 devices can be supported in one chain. On
initial power-up, each AD7284 is configured with a default
address of 0x00. A simple sequence of commands allows each
AD7284 to recognize its unique device address in the stack (see
the Example 1: Initialize All Devices in a Daisy Chain section).
This device address can then be locked to the AD7284 and is
used in subsequent read and write commands. A unique device
address of 0x1F is used to address all devices in the stack.
Register Address
As shown in Table 10, D25 to D20 form a 6-bit register address.
Register addresses can be found in Table 14.
Write and Write/Read
As shown in Table 10, Bit D26 controls the data transfer mode
on the daisy chain, unidirectional (write) or bidirectional
(write/read) communication.
With D26 high, the next communication in the chain is
unidirectional, and the master transmits the SPI command to
the slaves up the chain. D26 is typically high for register write
operations. The maximum SCLK frequency is 725 kHz when
the daisy chain operates in unidirectional mode.
With D26 low, the next communication in the chain is
bidirectional. The master transmits the SPI command to the
slaves and then switches to receive mode, expecting data back
from the slaves. The slaves start in receive mode and switch to
transmit mode after reception of the command.
A minimum delay of 50 μs is required prior to switching from
bidirectional to unidirectional mode (not applicable for the
master only setup). The maximum SCLK frequency is 500 kHz
when the daisy chain operates in bidirectional mode.
Examples of register read and register write operations can be
found in the Examples of Interfacing with the AD7284 section.
Register Data
As shown in Table 10, the register data field (Bits[D19:D12])
contains the data to be written into the register during a register
write operation. All AD7284 registers are 8 bits wide and are
listed in Table 14 in the Register Map section.
12-Bit CRC
The AD7284 includes a 12-bit CRC with a Hamming distance of
six on all write commands to either individual devices or to a chain
of devices. An AD7284 that receives an invalid CRC in the write
command does not execute the command. The CRC on the write
command is calculated based on Bits[D31:D12] of the write
command, which includes the device address, the register address,
and the register data. The CRC polynomial ((0xB41) in Koopman’s
notation) used when writing to or reading from the AD7284 is
x12 + x10 + x9 + x7 + x1 + 1