SLAAE81 February   2023 MSPM0G1106 , MSPM0G1107 , MSPM0G1505 , MSPM0G1506 , MSPM0G1507 , MSPM0G3105 , MSPM0G3106 , MSPM0G3107 , MSPM0G3505 , MSPM0G3506 , MSPM0G3507 , MSPM0L1105 , MSPM0L1106 , MSPM0L1303 , MSPM0L1304 , MSPM0L1305 , MSPM0L1305-Q1 , MSPM0L1306 , MSPM0L1306-Q1


  1.   1
  2.   Revision History

Design description

This subsystem demonstrates how to setup MSPM0 internal op-amps to a transimpedance amplifier (TIA) configuration and read the output with the internal ADC. The transimpedance op amp circuit configuration converts an input current source into an output voltage. The current to voltage gain is based on the feedback resistance. Download the code for this example.

#GUID-5A7BCA8B-81FA-4048-BAB9-FE949BE83F3B shows a functional diagram of this subsystem.

Figure 1-1 Subsystem Functional Block Diagram

Required peripherals

This application requires an integrated OPA and ADC.

Table 1-1 Required Peripherals
Sub-block Functionality Peripheral Use Notes

TIA (current to voltage translation)

(1x) OPA

Called “TIA_INST” in code

Analog signal capture

(1x) ADC12

Called “ADC12_0_INST” in code

Compatible devices

Based on the requirements in Table 1-1, this example is compatible with the devices in Table 1-2. The corresponding EVM can be used for prototyping.

Table 1-2 Compatible Devices
Compatible Devices EVM
MSPM0L13xx LP-MSPM0L1306
MSPM0G35xx, MSPM0G15xx LP-MSPM0G3507

Design steps

  1. Calculate the gain resister, RF
    Equation 1. R F =   V R e f _ A D C   -   V M i n I 1 M a x


    • VRef_ADC is the selected reference for the ADC peripheral

    • VMin is the minimum op amp output voltage

    • I1Max is the max current of the input current source

  2. Calculate the feedback capacitor to meet the circuit bandwidth.
    Equation 2. C F     1 2   ×   π   ×   R F   ×   f p

    where fp is the maximum frequency of the input current source.

  3. Calculate the necessary op amp gain bandwidth (GBW) for the circuit to be stable.
    Equation 3. G B W   >   C i   +   C F 2   ×   π   ×   R F   ×   C F 2

    where C i   =   C s   +   C d   +   C c m given:

    • CS: Input source capacitance
    • Cd : Differential input capacitance of the amplifier. This can generally be estimated at 3 pF for MSPM0 devices.
    • Ccm: Common-mode input capacitance of the inverting input

  4. Determine OPA GBW settings that can be utilized by comparing lower limit to calculated value in step 3.
  5. Setup OPA in SysConfig for external connections for circuit.
  6. Setup ADC in SysConfig for internal connection to chosen OPA output.
  7. Set ADC sample time in SysConfig to a minimum of tSample_PGA as given in the device data sheet.

Design considerations

  1. OPA supply is the VCC of the MSPM0.
  2. OPA GBW setting: A lower GBW setting for the OPA consumes less current but responds more slowly. conversely, a higher GBW consumes more current, but has a larger slew rate and faster enable and settling times. See the device-specific data sheet for specification differences between the modes.
  3. OPA noninverting input: Instead of GND potential, the OPA noninverting input can be given a small bias voltage to keep the output from saturating to GND if a current source is not active ( such as when a photodiode is in a no-light condition). This can be accomplished through external voltage input, or through internal peripherals such as the DAC12 or DAC8 inside the COMP peripheral. In the latter case, the pin associated with the OPA noninverting input can be used for other purposes.
  4. ADC sampling: This example continuously samples the OPA output. If this is not desired, a timer can be used to set a fixed interval of sampling.
  5. ADC results: This example only stores the most current result captured in the global variable gADCResult . Full applications can store several readings in an array before performing actions on the data.
  6. ADC reference selection: MSPM0 devices can provide a reference voltage to the ADC from the internal reference generator (VREF), external source, or MCU VCC. See the device-specific data sheet for options available for your chosen device. The reference voltage chosen sets the full scale range the ADC can sample and must accommodate the maximum OPA output voltage.
  7. Race conditions on gCheckADC: This application clears gCheckADC as soon as possible. If the application waits too long to clear gCheckADC it can inadvertently miss new data.

Software flowchart

#GUID-262577D2-4487-421D-849D-47C4ECD4950E shows the code flow diagram for this example and explains how the ADC samples the OPA output.

Figure 1-2 Application Software Flowchart

Device configuration

This application makes use of TI System Configuration Tool (SysConfig) graphical interface to generate the configuration code for the OPA and ADC. Using a graphical interface to configure the device peripherals streamlines the application prototyping process.

Application code

The code for what is described in #GUID-262577D2-4487-421D-849D-47C4ECD4950E can be found in the beginning of main() in the TIA_Example.c file. The following code snippet shows where to add custom code to perform useful actions after obtaining the ADC results of the measured current source. It is up to the user to determine what actions to take and to correlate ADC results with current source activity. For example, if connected to a photodiode, a design might average the ADC results to ignore small fluctuations of light and perform a delta calculation to detect large changes of light.

while (1) {
    while (false == gCheckADC) {
    /* * This is where the ADC result is grabbed from ADC memory. 
    * A user may want to modify this to place multiple results into an array, 
    * or add code to perform additional calculations or filters to data obtained. 
    gADCResult = DL_ADC12_getMemResult(ADC12_0_INST, DL_ADC12_MEM_IDX_0);
    gCheckADC = false;