Electronic Components Datasheet Search
  English  ▼
ALLDATASHEET.NET

X  

ADS131M08IPBSR Datasheet(PDF) 93 Page - Texas Instruments

Part # ADS131M08IPBSR
Description  ADS131M08 8-Channel, Simultaneously-Sampling, 24-Bit, Delta-Sigma ADC
PDF  118 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  TI2 [Texas Instruments]
Direct Link  https://www.ti.com
Logo TI2 - Texas Instruments

ADS131M08IPBSR Datasheet(HTML) 93 Page - Texas Instruments

Back Button ADS131M08IPBSR Datasheet HTML 89Page - Texas Instruments ADS131M08IPBSR Datasheet HTML 90Page - Texas Instruments ADS131M08IPBSR Datasheet HTML 91Page - Texas Instruments ADS131M08IPBSR Datasheet HTML 92Page - Texas Instruments ADS131M08IPBSR Datasheet HTML 93Page - Texas Instruments ADS131M08IPBSR Datasheet HTML 94Page - Texas Instruments ADS131M08IPBSR Datasheet HTML 95Page - Texas Instruments ADS131M08IPBSR Datasheet HTML 96Page - Texas Instruments ADS131M08IPBSR Datasheet HTML 97Page - Texas Instruments Next Button
Zoom Inzoom in Zoom Outzoom out
 93 / 118 page
background image
9.1.6 Code Example
This section contains example pseudocode for a simple program that configures and streams data from the
ADS131M08. The pseudocode is written to resemble C code. The code uses several descriptive precompiler-
defined constants that are indicated in upper case. The definitions are not included for brevity. The program
works in three sections: MCU initialization, ADC configuration, and data streaming. This code is not optimized for
using the fast startup feature of the ADS131M08.
The MCU is initialized by enabling the necessary peripherals for this example. These peripherals include an SPI
port, a GPIO configured as an input for the ADS131M08 DRDY output, a clock output to connect to the
ADS131M08 CLKIN input, and a direct memory access (DMA) module that streams data from the SPI port into
memory without significant processor intervention. The SPI port is configured to a 24-bit word size because the
ADC default SPI word size is 24 bits. The CS pin is configured to remain low as long as the SPI port is busy so
that it does not de-assert in the middle of a frame.
The ADC is configured through register writes. A function referred to as adcRegisterWrite writes an ADC register
using the SPI peripheral. No CRC data integrity is used in this example for simplicity, but is recommended. The
ADC outputs are initially disabled so short frames can be written during initialization consistent with the guidance
provided in the Short SPI Frames section. The ADC is configured to output DRDY as pulses, the gain is changed
to 32 for channels 1 and 3, and the DC block filter is used with a corner frequency of 622 mHz. Finally, the ADC
word size is changed to 32 bits with an MSB sign extension to accommodate the MCU memory length and to
allow for 32-bit DMA transfers. All other settings are left as defaults.
Data streaming is performed by using an interrupt that is configured to trigger on a negative edge received on
the GPIO connected to the DRDY pin. The interrupt service routine, referred to as DRDYinterrupt, sends six 32-
bit dummy words to assert CS and to toggle SCLK for the length of the entire ADC output frame. The ADC
output frame consists of one 32-bit status word, four 32-bit ADC conversion data words, and an optional 32-bit
CRC word. The frame is long enough for output CRC even though the CRC word is disabled in this example.
The DMA module is configured to trigger upon receiving data on the SPI input. The DMA automatically sends the
ADC data to a predetermined memory location as soon as the data are shifted into the MCU through the SPI
input.
numFrameWords = 10;
// Number of words in a full ADS131M08 SPI frame
unsigned long spiDummyWord[numFrameWords] =
{
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000,
0x00000000};
// Dummy word frame to write ADC during ADC data reads
bool firstRead = true;
// Flag to tell us if we are reading ADC data for the// first time
signed long adcData;
// Location where DMA will store ADC data in memory,
// length defined elsewhere/*
Interrupt the MCU each time DRDY asserts when collecting data
*/
DRDYinterupt(){
if(firstRead){
// Clear the ADC's 2-deep FIFO on the first read
for(i=0; i<numFrameWords; i++){
SPI.write(spiDummyWord + i);
}
for(i=0; i<numFrameWords; i++){
SPI.read();
}
firstRead = false;
// Clear the flag
DMA.enable();
// Let the DMA start sending ADC data to memory
}
for (i=0; i<numFrameWords; i++){// Send the dummy data to the ADC to get// the ADC data
SPI.write(spiDummyWord + i);
www.ti.com
ADS131M08
SBAS950B – OCTOBER 2019 – REVISED FEBRUARY 2021
Copyright © 2021 Texas Instruments Incorporated
Submit Document Feedback
93
Product Folder Links: ADS131M08



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100  ...More


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com