• Menu
  • Product
  • Email
  • PDF
  • Order now
  • ADC to I2C

    • SLAAEB0 December   2023 MSPM0C1106 , MSPM0G1105 , MSPM0G1106 , MSPM0G1107 , MSPM0G1505 , MSPM0G1506 , MSPM0G1507 , MSPM0G1518 , MSPM0G1519 , MSPM0G3105 , MSPM0G3105-Q1 , MSPM0G3106 , MSPM0G3106-Q1 , MSPM0G3107 , MSPM0G3107-Q1 , MSPM0G3505 , MSPM0G3505-Q1 , MSPM0G3506 , MSPM0G3506-Q1 , MSPM0G3507 , MSPM0G3507-Q1 , MSPM0G3518 , MSPM0G3519 , MSPM0G3519-Q1 , MSPM0L1105 , MSPM0L1106 , MSPM0L1303 , MSPM0L1304 , MSPM0L1305 , MSPM0L1306 , MSPM0L1343 , MSPM0L1344 , MSPM0L1345 , MSPM0L1346

       

  • CONTENTS
  • SEARCH
  • ADC to I2C
  1.   1
  2.   2
  3.   Revision History
  4. IMPORTANT NOTICE
search No matches found.
  • Full reading width
    • Full reading width
    • Comfortable reading width
    • Expanded reading width
  • Card for each section
  • Card with all content

 

Subsystem Design

ADC to I2C

Description

The ADC to I2C subsystem example demonstrates how to use the internal ADC to convert an analog signal into a digital representation and transfer the result through I2C. The example configures the MCU to act as an external ADC, receive I2C commands from an I2C controller, and execute the received command accordingly. With simple example commands provided, users can utilize the framework to implement their own commands. Optionally, the MCU can also process the ADC data before transmitting the data via I2C, which is especially useful in applications that need to process the raw data into meaningful values. Download the code for the ADC to I2C Subsystem here.

The following figure shows a block diagram of the system.

GUID-20230217-SS0I-XR5W-2T5L-3RRJCXD0VGKZ-low.jpg Figure 1-1 Subsystem Functional Block Diagram

Required Peripherals

The application requires the internal ADC and 1 instance of the I2C.

Sub-block Functionality Peripheral Used Notes
Analog signal capture ADC Called ADC12_0_INST in code
Sending ADC data I2C Device is the target for this example

Compatible Devices

Based on the requirements in the Required Peripherals table some compatible devices and corresponding EVMs are listed below. Other MSPM0 devices can be used with this subsystem as long as they have the required peripherals.

Compatible Devices EVM
MSPM0Lxxx LP-MSPM0L1306
MSPM0Gxxx LP-MSPM0G3507

Design Steps

  1. Determine the configuration for the ADC including reference source, reference value, and sampling rate based on the expected analog input and design requirements.
  2. Configure the ADC in SysConfig based on requirements in the previous step.
  3. Configure the I2C peripheral in SysConfig, setting the I2C in target mode.
  4. Write Application Code to transfer the ADC data from the memory registers to the I2C TX FIFO. See the Software Flowchart for an overview or view the code directly.

Design Considerations

  1. Max Sampling Speed: The sampling speed of the ADC is based on input signal frequency, analog front end, filters or any other design parameters that affect sampling.
  2. ADC Reference: Choose the reference to align with the expected max input to utilize the full scale range of the ADC.
  3. Clock Settings: The clock source determined the total time for sample and conversion time. The clock divider in tandem with the SCOMP setting determines the total sampling time. SysConfig sets the appropriate SCOMP depending on the sampling time setting.
  4. I2C configurations can be adjusted depending on your controller needs, such as the I2C address, addressing mode, glitch filters, clock stretching, and more.

Software Flow Chart

GUID-20230217-SS0I-CVPQ-4GJP-ZBMK1XRK8NPX-low.png

Additional Resources

  • Download the MSPM0 SDK
  • Learn more about SysConfig
  • MSPM0L1306
  • MSPM0G3507
  • MSPM0 ADC Academy
  • MSPM0 I2C Academy

Revision History

DATE REVISION NOTES
December 2023 * Initial Release

IMPORTANT NOTICE AND DISCLAIMER

TI PROVIDES TECHNICAL AND RELIABILITY DATA (INCLUDING DATASHEETS), DESIGN RESOURCES (INCLUDING REFERENCE DESIGNS), APPLICATION OR OTHER DESIGN ADVICE, WEB TOOLS, SAFETY INFORMATION, AND OTHER RESOURCES “AS IS” AND WITH ALL FAULTS, AND DISCLAIMS ALL WARRANTIES, EXPRESS AND IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY RIGHTS.

These resources are intended for skilled developers designing with TI products. You are solely responsible for (1) selecting the appropriate TI products for your application, (2) designing, validating and testing your application, and (3) ensuring your application meets applicable standards, and any other safety, security, or other requirements. These resources are subject to change without notice. TI grants you permission to use these resources only for development of an application that uses the TI products described in the resource. Other reproduction and display of these resources is prohibited. No license is granted to any other TI intellectual property right or to any third party intellectual property right. TI disclaims responsibility for, and you will fully indemnify TI and its representatives against, any claims, damages, costs, losses, and liabilities arising out of your use of these resources.

TI’s products are provided subject to TI’s Terms of Sale (www.ti.com/legal/termsofsale.html) or other applicable terms available either on ti.com or provided in conjunction with such TI products. TI’s provision of these resources does not expand or otherwise alter TI’s applicable warranties or warranty disclaimers for TI products.

Mailing Address: Texas Instruments, Post Office Box 655303, Dallas, Texas 75265 

Copyright © 2023, Texas Instruments Incorporated

 

Texas Instruments

© Copyright 1995-2025 Texas Instruments Incorporated. All rights reserved.
Submit documentation feedback | IMPORTANT NOTICE | Trademarks | Privacy policy | Cookie policy | Terms of use | Terms of sale