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

30 ULP Coprocessor (ULP)

30.4.14 REG_WR – Write to Peripheral Register

31

28

27

23

22

18

17

10

9

0

 

 

4’d1

 

High

 

Low

 

Data

 

Addr

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure 30­18. Instruction Type — REG_WR

 

Operand

Description - see Figure 30-18

 

 

 

 

Addr

Register address, expressed in 32-bit words

 

 

 

High

Register end bit number

 

 

 

 

 

Low

Register start bit number

 

 

 

 

 

Data

Value to write, 8 bits

 

 

 

 

 

 

Description

The instruction prompts the writing of up to 8 bits from an immediate data value into a peripheral register.

REG[Addr][High:Low] = Data

If more than 8 bits are requested, i.e. High - Low + 1 > 8, then the instruction will pad with zeros the bits above the eighth bit.

Note:

See notes regarding addr_ulp in section 30.4.13 above.

30.5ULP Program Execution

The ULP coprocessor is designed to operate independently of the main CPUs, while they are either in deep sleep or running.

In a typical power-saving scenario, the ULP coprocessor operates while the main CPUs are in deep sleep. To save power even further, the ULP coprocessor can get into sleep mode, as well. In such a scenario, there is a specific hardware timer in place to wake up the ULP coprocessor, since there is no software program running at the same time. This timer should be configured in advance by setting and then selecting one of the SENS_ULP_CP_SLEEP_CYCn_REG registers that contain the expiration period. This can be done either by the main program, or the ULP program with the REG_WR and SLEEP instructions. Then, the ULP timer should be enabled by setting bit RTC_CNTL_ULP_CP_SLP_TIMER_EN in the RTC_CNTL_STATE0_REG register.

Espressif Systems

666

ESP32 TRM (Version 5.0)

Submit Documentation Feedback

30 ULP Coprocessor (ULP)

Figure 30­19. Control of ULP Program Execution

The ULP coprocessor puts itself into sleep mode by executing the HALT instruction. This also triggers the ULP timer to start counting RTC_SLOW_CLK ticks which, by default, originate from an internal 150 kHz RC oscillator. Once the timer expires, the ULP coprocessor is powered up and runs a program with the program counter (PC) which is stored in register SENS_PC_INIT. The relationship between the described signals and registers is shown in Figure 30-19.

On reset or power-up the above-mentioned ULP program may start up only after the expiration of SENS_ULP_CP_SLEEP_CYC0_REG, which is the default selection period of the ULP timer.

A sample operation sequence of the ULP program is shown in Figure 30-20, where the following steps are executed:

1.Software enables the ULP timer by using bit RTC_CNTL_ULP_CP_SLP_TIMER_EN.

2.The ULP timer expires and the ULP coprocessor starts running the program at PC = SENS_PC_INIT.

3.The ULP program executes the HALT instruction; the ULP coprocessor is halted and the timer gets restarted.

4.The ULP program executes the SLEEP instruction to change the sleep timer period register.

5.The ULP program, or software, disables the ULP timer by using bit RTC_CNTL_ULP_CP_SLP_TIMER_EN.

Espressif Systems

667

ESP32 TRM (Version 5.0)

Submit Documentation Feedback

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