ADS1282 Example C Code  1.0.0
ADS1282 Example C Code

Table of Contents

chip.jpg

The ADS1282 precision delta-sigma (ΔΣ) analog-to-digital converter (ADC) communicates using a serial peripheral interface (SPI) to allow for device configuration, control, and data retrieval. To interface the ADC with a microcontroller (MCU), the firmware or software engineer needs to know how to correctly configure their MCU's serial peripheral, sequence serial commands, and control the SPI timing of command bytes to the ADC. To assist in this process, this example code is intended to show how to initialize communication with the ADS1282 at a high-level.

Modules

  1. ADS1282 Files: ads1282.h, ads1282.c
    Description: Contains header and source files with register map definitions and high-level functions for interfacing with this ADC.
  2. Hardware Abstraction Layer (HAL) Files: hal.h, hal.c
    Description: The HAL provides processor specific functions called by the ADS1282 module.

    IMPORTANT: The HAL module MUST be modified to work with your hardware!

How to use this code

Reference the ads1282.c file while writing your own code for examples of how to perform typical ADC operations, such as register read/writes and reading data...

OR

Copy and paste the example code into your project, and update the files as needed to get access to the provided APIs...

  1. Copy the ADS1282 and HAL module files into your firmware project.
  2. Add library references in hal.h to your processor-specific library file(s).
  3. Edit ALL of the function implementations inside of hal.c to provide the specified functionality with your processor and processor-specific library APIs.
  4. Include a reference to hal.h somewhere in your program and call the initADCperhiperhals() function to initialize the MCU peripherals connected to the ADS1282.
  5. Include a reference to ads1282.h in your application (from main.c or wherever ADC communication is handled) to call the ADS1282 module functions.


IMPORTANT: This code was tested on an MSP432E401Y 32-bit ARM® Cortex®-M4F based MCU using TI Code Composer Studio's 20.2.1.LTS ARM compiler. Example code is provided to aid in the creation of your own software implementation and should not be considered as fully verified and end-equipment ready. Example code is written for readability and therefore is typically not optimized for performance.


Support

For questions or issues, visit the TI E2E Forums.

e2e.jpg


Release History

v1.0.0 - Initial release (1-27-2020)


License

BSD-3-Clause
Refer to the ADS1282 Example C Code_1.0.0_manifest.html file for license text...