SBAA288A July   2018  – January 2019 ADS7142

 

  1.   TM4C1294 interface to ADS7142 software library
    1.     Trademarks
    2. 1 Introduction
    3. 2 Hardware
    4. 3 Software
      1. 3.1 Header Files
      2. 3.2 ADS7142 Device Functional Modes Overview
      3. 3.3 Software Functions
    5. 4 Using the Software
      1. 4.1 Prerequisites
      2. 4.2 Getting Started
      3. 4.3 Using the Library
    6. 5 Main Routines and Test Data
      1. 5.1 Manual Mode
      2. 5.2 Autonomous Mode With Pre-Alert
      3. 5.3 Autonomous Mode With Post-Alert
      4. 5.4 Autonomous Mode With Start Burst Data
      5. 5.5 Autonomous Mode With Stop Burst Data
      6. 5.6 High Precision Mode
    7. 6 References
  2.   Revision History

Autonomous Mode With Stop Burst Data

In autonomous mode with stop burst, the user is able to configure the ADS7142 to stop filling the data buffer with conversion results by aborting the conversion sequence. If more than 16 conversions occur between the start of the sequence and when the sequence is aborted, the entries first written in to the data buffer are overwritten. Figure 29 shows the filling of the data buffer in autonomous mode with stop burst data.

stop_burst_two_ch_sbas773.gifFigure 29. Stop Burst With Dual-Channel Configuration

The main routine is the following:

#include "ADS7142RegisterMap.h" /* ADS7142_AutonomousMode_StopBurst_AutoSequencing_CH0_CH1_Scan.c */ int main(void) { //Initialize the master MCU (0 = 100 kHz SCL, 1 = 400 kHz SCL) TM4C1294Init(0); //Calibrate out the offset from the ADS7142 ADS7142Calibrate(); //Let's put the ADS7142 into Autonomous Mode with both Channels enabled in Single-Ended Configuration //Select the channel input configuration ADS7142SingleRegisterWrite(ADS7142_REG_CHANNEL_INPUT_CFG, ADS7142_VAL_CHANNEL_INPUT_CFG_2_CHANNEL_SINGLE_ENDED); //Confirm the input channel configuration uint32_t channelconfig; ADS7142SingleRegisterRead(ADS7142_REG_CHANNEL_INPUT_CFG, &channelconfig); //Select the operation mode of the device ADS7142SingleRegisterWrite(ADS7142_REG_OPMODE_SEL, ADS7142_VAL_OPMODE_SEL_AUTONOMOUS_MONITORING_MODE); //Confirm the operation mode selection uint32_t opmodeselconfig; ADS7142SingleRegisterRead(ADS7142_REG_OPMODE_SEL, &opmodeselconfig); //Set the I2C Mode to High Speed (optional) //ADS7142HighSpeedEnable(ADS7142_VAL_OPMODE_I2CMODE_HS_1); //Check the I2C Mode Status uint32_t opmodei2cconfig; ADS7142SingleRegisterRead(ADS7142_REG_OPMODE_I2CMODE_STATUS, &opmodei2cconfig); //Select both channels for AUTO Sequencing ADS7142SingleRegisterWrite(ADS7142_REG_AUTO_SEQ_CHEN, ADS7142_VAL_AUTO_SEQ_CHENAUTO_SEQ_CH0_CH1); //Confirm Auto Sequencing is enabled uint32_t autoseqchenconfig; ADS7142SingleRegisterRead(ADS7142_REG_AUTO_SEQ_CHEN, &autoseqchenconfig); //Select the Low Power or High Speed Oscillator ADS7142SingleRegisterWrite(ADS7142_REG_OSC_SEL, ADS7142_VAL_OSC_SEL_HSZ_HSO); //Confirm the oscillator selection uint32_t oscconfig; ADS7142SingleRegisterRead(ADS7142_REG_OSC_SEL, &oscconfig); //Set the minimum nCLK value for one conversion to maximize sampling speed ADS7142SingleRegisterWrite(ADS7142_REG_nCLK_SEL, 21); //Confirm the nCLK selection uint32_t nCLKconfig; ADS7142SingleRegisterRead(ADS7142_REG_nCLK_SEL, &nCLKconfig); //Select the Data Buffer output data Configuration ADS7142SingleRegisterWrite(ADS7142_REG_DOUT_FORMAT_CFG, ADS7142_VAL_DOUT_FORMAT_CFG_DOUT_FORMAT2); //Select the Data Buffer opmode for Stop Burst mode ADS7142SingleRegisterWrite(ADS7142_REG_DATA_BUFFER_OPMODE, ADS7142_VAL_DATA_BUFFER_STARTSTOP_CNTRL_STOPBURST); //Set the SEQ_START Bit to begin the sampling sequence ADS7142SingleRegisterWrite(ADS7142_REG_START_SEQUENCE, ADS7142_VAL_START_SEQUENCE); //Begin Autonomous Mode StopBurst operation and scan channels 0 and 1 while (1) { //Abort the sequence ADS7142SingleRegisterWrite(ADS7142_REG_ABORT_SEQUENCE, ADS7142_VAL_ABORT_SEQUENCE); //Read the databuffer status uint32_t databufferstatus; ADS7142SingleRegisterRead(ADS7142_REG_DATA_BUFFER_STATUS, &databufferstatus); //Read the databuffer while(ADS7142DataRead_count(16) < 0); //Restart the sequence ADS7142SingleRegisterWrite(ADS7142_REG_START_SEQUENCE, ADS7142_VAL_START_SEQUENCE); } //Return no errors return 0; }

Figure 30 shows the channel configuration, selection of the opmode, and selection of the oscillator for this ADS7142 functional mode.

ADS7142AutonomousModeStopBurstDualChannelSamplingData1.gifFigure 30. Autonomous Mode Stop Burst Dual-Channel Sampling Test Data 1

Figure 31 shows the setting of the number of clock cycles required to perform a conversion, the data output format, and the contents of the data buffer after the conversion sequence is aborted.

ADS7142AutonomousModeStopBurstDualChannelSamplingData2.gifFigure 31. Autonomous Mode Stop Burst Dual-Channel Sampling Test Data 2

Figure 32 shows the continued data buffer results and the conversion sequence restart.

ADS7142AutonomousModeStopBurstDualChannelSamplingData3.gifFigure 32. Autonomous Mode Stop Burst Dual-Channel Sampling Test Data 3