Добавил:
ИВТ (советую зайти в "Несортированное")rnПИН МАГА Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
interfeysy_1 / ИДЗ_машинка / даташиты / esp32_technical_reference_manual_en.pdf
Скачиваний:
19
Добавлен:
26.01.2024
Размер:
9.62 Mб
Скачать

29 On-Chip Sensors and Analog Signal Processing

For each scanning mode there is a corresponding data format, called Type I and Type II. Both data formats are described in Tables 29-5 and 29-6.

Table 29­5. Fields of Type I DMA Data Format

Type I DMA Data Format [15:0]

ch_sel[3:0]

 

 

data[11:0]

 

 

 

 

 

 

 

 

channel

 

 

SAR ADC data

 

 

 

 

 

 

 

 

 

Table 29­6. Fields of Type II DMA Data Format

 

 

 

 

 

 

 

Type II DMA Data Format [15:0]

 

 

sar_sel

 

ch_sel[3:0]

SAR ADC data[10:0]

 

 

 

 

SAR ADCn

 

channel

SAR ADC data

 

 

 

 

 

 

For Type I the resolution of SAR ADC is up to 12 bits, while for Type II the resolution is 11 bits at most.

DIG SAR ADC Controllers allow the use of I2S for direct memory access. The WS signal of I2S acts as a measurement-trigger signal. The DATA signal provides the information that the measurement result is ready. Software can configure APB_SARADC_DATA_TO_I2S, in order to connect ADC to I2S.

29.4DAC

29.4.1 Introduction

Two 8-bit DAC channels can be used to convert digital values into analog output signals (up to two of them). The design structure is composed of integrated resistor strings and a buffer. This dual DAC supports power supply and uses it as input voltage reference. The dual DAC also supports independent or simultaneous signal conversions inside of its channels.

29.4.2 Features

The features of DAC are as follows:

Two 8-bit DAC channels

Independent or simultaneous conversion in channels

Voltage reference from the VDD3P3_RTC pin

Cosine waveform (CW) generator

DMA capability

Start of conversion can be triggered by software or SAR ADC FSM (please refer to the SAR ADC chapter for more details)

Can be fully controlled by the ULP coprocessor

A diagram showing the DAC channel’s function is presented in Figure 29-9. For a detailed description, see the sections below.

Espressif Systems

637

ESP32 TRM (Version 5.0)

Submit Documentation Feedback

29 On-Chip Sensors and Analog Signal Processing

Figure 29­9. Diagram of DAC Function

29.4.3 Structure

The two 8-bit DAC channels can be configured independently. For each DAC channel, the output analog voltage can be calculated as follows:

DACn_OUT = VDD3P3_RTC · PDACn_DAC/255

VDD3P3_RTC is the voltage on pin VDD3P3_RTC (typically 3.3V).

PDACn_DAC has multiple sources: CW generator, register RTCIO_PAD_DACn_REG, and DMA.

The start of conversion is determined by register RTCIO_PAD_PDACn_XPD_DAC. The conversion process itself is controlled by software or SAR ADC FSM; see Figure 29-9.

29.4.4 Cosine Waveform Generator

The cosine waveform (CW) generator can be used to generate a cosine / sine tone. A diagram showing cosine waveform generator’s function is presented in Figure 29-10.

The CW generator has the following features:

Adjustable frequency

The frequency of CW can be adjusted by register SENS_SAR_SW_FSTEP[15:0]:

freq = dig_clk_rtc_freq · SENS_SAR_SW_FSTEP/65536

The frequency of dig_clk_rtc is typically 8 MHz.

Scaling

Configuring register SENS_SAR_DAC_SCALEn[1:0]; the amplitude of a CW can be multiplied by 1, 1/2, 1/4 or 1/8.

DC offset

The offset may be introduced by register SENS_SAR_DAC_DCn[7:0]. The result will be saturated.

Phase shift

A phase-shift of 0 / 90 / 180 / 270 degrees can be added by setting register SENS_SAR_DAC_INVn[1:0].

Espressif Systems

638

ESP32 TRM (Version 5.0)

Submit Documentation Feedback

29 On-Chip Sensors and Analog Signal Processing

Figure 29­10. Cosine Waveform (CW) Generator

29.4.5 DMA support

A DMA controller with dual DMA channels can be used to set the output of two DAC channels. By configuring SENS_SAR_DAC_DIG_FORCE, I2S_clk can be connected to DAC clk, and I2S_DATA_OUT can be connected to DAC_DATA for direct memory access.

For details, please refer to chapter DMA.

Espressif Systems

639

ESP32 TRM (Version 5.0)

Submit Documentation Feedback

Соседние файлы в папке даташиты