User manual
MCP3901 ADC Evaluation Board for 16-Bit MCUs User’s Guide
DS51845B-page 16 2010 Microchip Technology Inc.
2.2 DATA ACQUISITION
The end of a conversion is indicated with a short high pulse on the Data Ready (DR)
pin of the ADC. The DR pin is connected to the External Interrupt 3 pin and is used for
detecting the end of a conversion on MCP3901. In the INT3 interrupt, the SPI interrupt
is activated and the first transmission on the SPI is initiated. The SPI communication
that follows can be a read of the ADC conversion register or the Configuration register.
CCT = 0 is a read of the ADC Conversion register, and CCT = 1 is a read of the
MCP3901 Configuration register. It is possible to read the ADC conversion registers
and MCP3901 configuration registers at the same time, but due to transfer volume and
its impact on speed, this will prevent achieving a high sampling rate. SPI communica-
tion is always in 8-bit mode.
FIGURE 2-1: INT3 Flowchart.
An SPI interrupt takes place after each successful data transfer between master and
slave on the SPI. As with any interrupt, the first thing to do is to clear the interrupt flag;
otherwise, a new interrupt will occur without reason. The CCSPI global value is the
counter that indicates if the SPI transfer that is occuring is the first, the second, etc.
After saving the samples into the MCU, SPI communication is disabled by setting CS
high. If CCT was ‘0’, then the data that comes from the MCP3901 is ADC conversion
data and will be converted from 3 bytes into an unsigned long number. This 24-bit value
will be saved into the current or voltage buffers.
External Interrupt 3 Detected
Clear External Interrupt 3 Flag
Disable External Interrupt 3
Enable SPI1 Interrupt
Tight to GND CS to Select MCP3901
Turn ON Red LED
If CCT = 0
(If true, follows the reading of
the ADC results)
If CCT = 1
(If true, follows the reading of
the ADC configuration
registers)
NO
Send on SPI 0b00000001
(Read Address 0 – CH0 MSB)
Send on SPI 0b00001101
(Read Address 6 – ModOut)
YES
YES
Exit External Interrupt 3