1choice RTC_CLK_SRC 2 prompt "RTC clock source" 3 default RTC_CLK_SRC_INT_RC 4 help 5 Choose which clock is used as RTC clock source. 6 7 - "Internal 150kHz oscillator" option provides lowest deep sleep current 8 consumption, and does not require extra external components. However 9 frequency stability with respect to temperature is poor, so time may 10 drift in deep/light sleep modes. 11 - "External 32kHz crystal" provides better frequency stability, at the 12 expense of slightly higher (1uA) deep sleep current consumption. 13 - "External 32kHz oscillator" allows using 32kHz clock generated by an 14 external circuit. In this case, external clock signal must be connected 15 to 32K_XN pin. Amplitude should be <1.2V in case of sine wave signal, 16 and <1V in case of square wave signal. Common mode voltage should be 17 0.1 < Vcm < 0.5Vamp, where Vamp is the signal amplitude. 18 Additionally, 1nF capacitor must be connected between 32K_XP pin and 19 ground. 32K_XP pin can not be used as a GPIO in this case. 20 - "Internal 8.5MHz oscillator divided by 256" option results in higher 21 deep sleep current (by 5uA) but has better frequency stability than 22 the internal 150kHz oscillator. It does not require external components. 23 24 config RTC_CLK_SRC_INT_RC 25 bool "Internal 150kHz RC oscillator" 26 config RTC_CLK_SRC_EXT_CRYS 27 bool "External 32kHz crystal" 28 select ESP_SYSTEM_RTC_EXT_XTAL 29 config RTC_CLK_SRC_EXT_OSC 30 bool "External 32kHz oscillator at 32K_XN pin" 31 select ESP_SYSTEM_RTC_EXT_OSC 32 config RTC_CLK_SRC_INT_8MD256 33 bool "Internal 8.5MHz oscillator, divided by 256 (~33kHz)" 34endchoice 35 36choice RTC_EXT_CRYST_ADDIT_CURRENT_METHOD 37 prompt "Additional current for external 32kHz crystal" 38 depends on RTC_CLK_SRC_EXT_CRYS 39 depends on ESP32_REV_MIN_FULL < 200 40 default RTC_EXT_CRYST_ADDIT_CURRENT_NONE 41 help 42 With some 32kHz crystal configurations, the X32N and X32P pins may not have enough 43 drive strength to keep the crystal oscillating. Choose the method to provide 44 additional current from touchpad 9 to the external 32kHz crystal. Note that 45 the deep sleep current is slightly high (4-5uA) and the touchpad and the 46 wakeup sources of both touchpad and ULP are not available in method 1 and method 2. 47 48 This problem is fixed in ESP32 ECO 3, so this workaround is not needed. Setting the 49 project configuration to minimum revision ECO3 will disable this option, , allow 50 all wakeup sources, and save some code size. 51 52 - "None" option will not provide additional current to external crystal 53 - "Method 1" option can't ensure 100% to solve the external 32k crystal start failed 54 issue, but the touchpad can work in this method. 55 - "Method 2" option can solve the external 32k issue, but the touchpad can't work 56 in this method. 57 58 config RTC_EXT_CRYST_ADDIT_CURRENT_NONE 59 bool "None" 60 config RTC_EXT_CRYST_ADDIT_CURRENT 61 bool "Method 1" 62 config RTC_EXT_CRYST_ADDIT_CURRENT_V2 63 bool "Method 2" 64endchoice 65 66config RTC_CLK_CAL_CYCLES 67 int "Number of cycles for RTC_SLOW_CLK calibration" 68 default 3000 if RTC_CLK_SRC_EXT_CRYS || RTC_CLK_SRC_EXT_OSC || RTC_CLK_SRC_INT_8MD256 69 default 1024 if RTC_CLK_SRC_INT_RC 70 range 0 27000 if RTC_CLK_SRC_EXT_CRYS || RTC_CLK_SRC_EXT_OSC || RTC_CLK_SRC_INT_8MD256 71 range 0 32766 if RTC_CLK_SRC_INT_RC 72 help 73 When the startup code initializes RTC_SLOW_CLK, it can perform 74 calibration by comparing the RTC_SLOW_CLK frequency with main XTAL 75 frequency. This option sets the number of RTC_SLOW_CLK cycles measured 76 by the calibration routine. Higher numbers increase calibration 77 precision, which may be important for applications which spend a lot of 78 time in deep sleep. Lower numbers reduce startup time. 79 80 When this option is set to 0, clock calibration will not be performed at 81 startup, and approximate clock frequencies will be assumed: 82 83 - 150000 Hz if internal RC oscillator is used as clock source. For this use value 1024. 84 - 32768 Hz if the 32k crystal oscillator is used. For this use value 3000 or more. 85 In case more value will help improve the definition of the launch of the crystal. 86 If the crystal could not start, it will be switched to internal RC. 87 88config RTC_XTAL_CAL_RETRY 89 int "Number of attempts to repeat 32k XTAL calibration" 90 default 1 91 depends on RTC_CLK_SRC_EXT_CRYS 92 help 93 Number of attempts to repeat 32k XTAL calibration 94 before giving up and switching to the internal RC. 95 Increase this option if the 32k crystal oscillator 96 does not start and switches to internal RC. 97