If we use ledc like this:
- void setup() {
- Serial.begin(115200);
- Serial.println(F("Start setup"));
- pinMode(GPIO_NUM_32, OUTPUT);
- pinMode(GPIO_NUM_32, LOW);
- ledcSetup(LEDC_CHANNEL_0, 10000000, 2 );
- ledcAttachPin(GPIO_NUM_32, LEDC_CHANNEL_0);
- ledcWrite(LEDC_CHANNEL_0, 2 );
- int time = 0;
- while(1) { Serial.println(time); delay(time++); }
- }
Output example:
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- �Start setup
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- Start setup
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- ets Jun 8 2016 00:22:57
- rst:0x10 (RTCWDT_RTC_RESET),boot:0x33 (SPI_FAST_FLASH_BOOT)
- configsip: 0, SPIWP:0xee
- clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
- mode:DIO, clock div:2
- load:0x3fff0018,len:4
- load:0xffffffff,len:-1
- ets Jun 8 2016 00:22:57
But if we remove this code and it would be like this:
- void setup() {
- Serial.begin(115200);
- Serial.println(F("Start setup"));
- int sec = 0;
- while(1) {
- Serial.println(sec);
- delay(sec++);
- }
- }
Counter newer stop. And any WDT errors never happens
- Start setup
- 0
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- .
- .
- .
- 187
- .
- .
- .
- 1000
- .
- .
- .