SLAAE81 February 2023 MSPM0G1105 , MSPM0G1106 , MSPM0G1107 , MSPM0G1505 , MSPM0G1506 , MSPM0G1507 , MSPM0G3105 , MSPM0G3106 , MSPM0G3107 , MSPM0G3505 , MSPM0G3506 , MSPM0G3507 , MSPM0L1105 , MSPM0L1106 , MSPM0L1303 , MSPM0L1304 , MSPM0L1304-Q1 , MSPM0L1305 , MSPM0L1305-Q1 , MSPM0L1306 , MSPM0L1306-Q1 , MSPM0L1343 , MSPM0L1344 , MSPM0L1345 , MSPM0L1346
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.
Figure 1-1 shows a functional diagram of this subsystem.
This application requires an integrated OPA and ADC.
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 |
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.
Compatible Devices | EVM |
---|---|
MSPM0L13xx | LP-MSPM0L1306 |
MSPM0G35xx, MSPM0G15xx | LP-MSPM0G3507 |
where
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
where fp is the maximum frequency of the input current source.
where given:
Figure 1-2 shows the code flow diagram for this example and explains how the ADC samples the OPA output.
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.
The code for what is described in Figure 1-2 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) {
DL_ADC12_startConversion(ADC12_0_INST);
while (false == gCheckADC) {
__WFE();
}
/* * 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;
DL_ADC12_enableConversions(ADC12_0_INST);
}