2012-2014 Microchip Technology Inc. DS20005116B-page 43
MCP3910
6.0 SPI SERIAL INTERFACE
DESCRIPTION
6.1 Overview
The MCP3910 device includes a four-wire (CS, SCK,
SDI, SDO) digital serial interface that is compatible with
SPI Modes 0,0 and 1,1. Data is clocked out of the
MCP3910 on the falling edge of SCK, and data is
clocked into the MCP3910 on the rising edge of SCK.
In these modes, the SCK clock can idle either high (1,1)
or low (0,0). The digital interface is asynchronous with
the MCLK clock that controls the ADC sampling and
digital filtering. All the digital input pins are Schmitt-
triggered to avoid system noise perturbations on the
communications.
Each SPI communication starts with a CS falling edge
and stops with the CS rising edge. Each SPI communi-
cation is independent. When CS is logic high, SDO is
in high-impedance, transitions on SCK, and SDI have
no effect. Changing from an SPI Mode 1,1 to an SPI
Mode 0,0 and vice-versa is possible and can be done
while the CS pin is logic high. Any CS rising edge clears
the communication and resets the SPI digital interface.
Additional control pins (RESET
, DR) are also provided
on separate pins for advanced communication
features. The Data Ready pin (DR) outputs pulses
when a new ADC channel data is available for reading,
which can be used as an interrupt for an MCU. The
master reset pin (RESET) acts like a hard reset and
can reset the part to its default power-up configuration
(equivalent to a POR state).
The MCP3910 interface has a simple command
structure. Every command is either a READ command
from a register, or a WRITE command to a register. The
MCP3910 device includes 13 registers defined in the
register map in Tab le 9 -1. The register map is fully
compatible with the MCP391x family to allow easy
porting of MCU code from one design to another inside
the MCP391X family. The first byte (8-bit wide)
transmitted is always the control byte that defines the
address of the register and the type of command (Read
or Write). It is followed by the register itself, which can
be in a 16-, 24- or 32-bit format, depending on the
multiple format settings defined in the STATUSCOM
register. The MCP3910 is compatible with multiple
formats that help reduce overhead in the data handling
for most MCUs and processors available on the market
(8-, 16- or 32-bit MCUs) and improve MCU-code
compaction and efficiency.
The MCP3910 digital interface is capable of handling
various continuous read and write modes, which allow
the device to perform ADC data streaming or full
register map writing within only one communication
(and therefore with only one unique control byte). The
internal registers can be grouped together with various
configurations through the READ<1:0> and WRITE
bits. The internal address counter of the serial interface
can be automatically incremented with no additional
control byte needed, in order to loop through the
various groups of registers within the register map. The
groups are defined in Tab le 9 - 2.
The MCP3910 device also includes advanced security
features to secure each communication, to avoid pro-
cessing unwanted write commands in order to change
the desired configuration, and to alert the user in case
of a change in the desired configuration.
Each SPI read communication can be secured through
a selectable CRC-16 checksum provided on the SDO
pin at the end of every communication sequence. This
CRC-16 computation is compatible with the DMA CRC
hardware of the PIC24 and PIC32 MCUs, resulting in
no additional overhead for added security.
In order to secure the entire configuration of the device,
the MCP3910 includes an 8-bit lock code
(LOCK<7:0>), which blocks all write commands to the
full register map if the value of the LOCK<7:0> is not
equal to a defined password (0xA5). The user can
protect its configuration by changing the LOCK<7:0>
value to 0x00 after the full programming, so that no
unwanted write command will result in a change in the
configuration (because LOCK<7:0> is different from
the 0xA5 password).
An additional CRC-16 calculation is also running con-
tinuously in background to ensure the integrity of the
full register map. All writable registers of the register
map (except of the MOD register) are processed
through a CRC-16 calculation engine and give a CRC-
16 checksum that depends on the configuration. This
checksum is readable on the LOCK/CRC register and
updated at all times. If a change in this checksum hap-
pens, a selectable interrupt can give a flag on the DR
pin (the DR pin becomes logic low) to warn the user
that the configuration is corrupted.
6.2 Control Byte
The control byte of the MCP3910 contains two device
Address bits (A<6:5>), five register Address bits
(A<4:0>) and a Read/Write bit (R/W). The first byte
transmitted to the MCP3910 in any communication is
always the control byte. During the control byte trans-
fer, the SDO pin is always in a high-impedance state.
The MCP3910 interface is device addressable
(through A<6:5>), so that multiple chips can be present
on the same SPI bus with no data bus contention, even
if they use the same CS pin, they use a provided half-
duplex SPI interface, with a different address identifier.
This functionality enables, for example, to have a Serial
EEPROM like 24AAXXX/24LCXXX or 24FCXXX and
the MCP3910 to share all the SPI pins and consume
less I/O pins in the application processor, since all
these Serial EEPROM circuits use A<6:5> = 00.