SoC products with 32-bit MCU and high-precision ADC-SD93F series development guide (9)
INDUSTRIAL LCD DISPLAYS / IGBT MODULES DISTRIBUTOR

Infineon / Mitsubishi / Fuji / Semikron / Eupec / IXYS

SoC products with 32-bit MCU and high-precision ADC-SD93F series development guide (9)

Posted Date: 2024-01-14

01

Preface

In Development Guide (8), we explained to you the 24-bit high-precision ADC—SD ADC. In this chapter, we will explain to you the basic usage of the 12-bit high-speed ADC—SAR ADC. Please refer to Chapter 28 of the application manual.

02

SAR ADC structure

Let’s first take a look at the functional block diagram of the SAR ADC as shown in Figure 1. The SAR MUX is a multi-channel gate, and multiple signals can be selected to enter the SAR ADC for testing. SAR Buf is a rail to rail input/output buffer. The input range is close to 0~AVDDR. To ensure BUFF performance, the input range is 0.1V~AVDDR-0.1V.

Using SAR Buf can increase the input impedance of the chip, but the bandwidth of the input signal is required to be less than 10kHz (when SAR Buf is in high-speed mode).

Figure 1. SD ADC functional block diagram

03

Software and hardware configuration

The configuration of the SAR ADC software is as shown in Figure 2:

Figure 2. SAR ADC configuration

First, we need to enable the SAR ADC clock source, and then call the library function to initialize the SAR ADC. We open the SAR ADC BUF, select the high-speed mode, select the input channel as A3, continue mode, work in the high current mode, and select 64 SAR for the sampling period. ADC clock, sampling clock select 3MHz, then enable SAR ADC, the reference voltage of SAR ADC is fixed to AVDDR.

After the initial configuration is completed, calibration is required. Here we choose the calibration period to be 16 SAR ADC clocks, calibrate 16 times, then enable the calibration, wait for the automatic calibration to end, clear the calibration end flag, and then start the SAR ADC conversion after the calibration is completed. able.

For detailed calibration process, please refer to the Application Manual 28.4.2 SAR ADC Calibration Chapter, as shown in Figure 3:

Figure 3. SAR ADC calibration

Then we write the SAR ADC test program, as shown in Figure 4 below:

Figure 4. SAR ADC test program

The entire test process is consistent with the SD ADC. Wait for the SAR ADC conversion completion flag bit to be set to 1, then clear the flag bit to 0, then obtain the ADC conversion result and cache the ADC code value, and finally send the data in hexadecimal through the serial port, and at the same time pass The LCD driver displays the ADC code value on the LCD screen.

In the software configuration, we selected A3 as the input channel, the reference voltage is AVDDR=2.4V, and the SAR ADC has no amplification factor, so we use two resistors to divide the voltage to get an AVDDR/2 voltage of about 1.2V, connect to A3 as the input signal of the SAR ADC. The test results are as shown in Figure 5:

Figure 5. SAR ADC conversion result display

We follow the formula: Vin= DEC*AVDDR/2^12. The picture shows that 07ff is hexadecimal and needs to be converted to decimal 2047. The result is Vin=2047*2.4/4096=1.199V. The calculation result is correct and you can also replace it with others. The magnitude of the signal is verified according to the above calculation process for accuracy.

04

Brief analysis of development issues

To understand the functions of the three enable bits CALEN, SAREN and SAR_ADC_EN, you must first enable SAR_ADC_EN and then enable CALEN/SAREN.

When SAR_ADC_EN=1 and CALEN/SAREN=0, do not clear SAR_ADC_EN and set CALEN/SAREN at the same time. Otherwise, the clearing of SAR_ADC_EN is successful, and the setting of CALEN/SAREN is failed.

If the SAR ADC configuration is changed during use, recalibration is required.

The calculation of the sampling rate requires adding the number of sampling cycles and the number of conversion cycles as a complete cycle, and the number of conversion cycles is fixed at 12.

05

Summarize

This chapter briefly introduces the use of the SAR ADC module function. In the application, the input channel can be flexibly selected to monitor different signals.






Review Editor: Liu Qing


#SoC #products #32bit #MCU #highprecision #ADCSD93F #series #development #guide