EasyManuals Logo

Espressif ESP32-S2 User Manual

Espressif ESP32-S2
1695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #1501 background imageLoading...
Page #1501 background image
Chapter 4. API Guides
Mux - selected PAD, SARADC Pad[Mux-1] is enabled. If the user passes Mux value 1, then ADC pad
0 gets used.
Cycles 23 + max(1, SAR_AMP_WAIT1) + max(1, SAR_AMP_WAIT2) + max(1,
SAR_AMP_WAIT3) + SARx_SAMPLE_CYCLE + SARx_SAMPLE_BIT cycles to execute, 4 cycles
to fetch next instruction
Description The instruction makes measurements from ADC.
Examples:
1: ADC R1, 0, 1 // Measure value using ADC1 pad 2 and store
,result into R1
REG_RD read from peripheral register
Syntax REG_RD Addr, High, Low
Operands
Addr Register address, in 32-bit words
High Register end bit number
Low Register start bit number
Cycles 4 cycles to execute, 4 cycles to fetch next instruction
Description The instruction reads up to 16 bits from a peripheral register into a general purpose register: R0 =
REG[Addr][High:Low].
This instruction can access registers in RTC_CNTL, RTC_IO, SENS, and RTC_I2C peripherals. Address of
the the register, as seen from the ULP, can be calculated from the address of the same register on the PeriBUS1
as follows:
addr_ulp = (addr_peribus1 - DR_REG_RTCCNTL_BASE) / 4
Examples:
1: REG_RD 0x120, 7, 4 // load 4 bits: R0 = {12'b0, REG[0x120][7:4]}
REG_WR write to peripheral register
Syntax REG_WR Addr, High, Low, Data
Operands
Addr Register address, in 32-bit words.
High Register end bit number
Low Register start bit number
Data Value to write, 8 bits
Cycles 8 cycles to execute, 4 cycles to fetch next instruction
Description The instruction writes up to 8 bits from an immediate data value into a peripheral register:
REG[Addr][High:Low] = data.
This instruction can access registers in RTC_CNTL, RTC_IO, SENS, and RTC_I2C peripherals. Address of
the the register, as seen from the ULP, can be calculated from the address of the same register on the PeriBUS1
as follows:
addr_ulp = (addr_peribus1 - DR_REG_RTCCNTL_BASE) / 4
Examples:
1: REG_WR 0x120, 7, 0, 0x10 // set 8 bits: REG[0x120][7:0] = 0x10
Convenience macros for peripheral registers access
ULP source files are passed through C preprocessor before the assembler. This allows certain macros to be used to
facilitate access to peripheral registers.
Espressif Systems 1490
Submit Document Feedback
Release v4.4

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Espressif ESP32-S2 and is the answer not in the manual?

Espressif ESP32-S2 Specifications

General IconGeneral
BrandEspressif
ModelESP32-S2
CategorySingle board computers
LanguageEnglish