I am wondering if there is some sort of conflict possible with ledcWrite and the use of the serial ports?
In the code below, it seems that if I comment out ledcWrite from the setup, Serial.println("beep") works fine indefinitely.
Code: Select all
void setup()
{
Serial.begin(9600);
Serial.println("setup begin");
ledcSetup(1, 25000, 8);
ledcAttachPin(10, 1);
ledcWrite(1, 20);
}
void loop()
{
delay(5000);//limit click speed
Serial.println("beep");
}
But, with BOTH Serial.println("beep") and ledcWrite(1, 20) in effect, it will generate a Guru meditation error and reboot after about a minute. I am using the D2WD version of the processor. This behavior was not noticed on the D0WD version.
Code: Select all
Guru Meditation Error: Core 0 panic'ed (IllegalInstruction). Exception was unhandled.
Core 0 register dump:
PC : 0x400d5f70 PS : 0x00060730 A0 : 0x00000000 A1 : 0x3ffc4e50
A2 : 0x00000000 A3 : 0x00000000 A4 : 0x00000000 A5 : 0x00000000
A6 : 0x00000000 A7 : 0x00000000 A8 : 0x800d6042 A9 : 0x3ffc4e10
A10 : 0x00000000 A11 : 0x00000000 A12 : 0x3ffc3cc8 A13 : 0x00000000
A14 : 0x3ffc3c80 A15 : 0x00000000 SAR : 0x00000000 EXCCAUSE: 0x00000000
EXCVADDR: 0x00000000 LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000
Backtrace: 0x400d5f70:0x3ffc4e50 0x7ffffffd:0x3ffc4e70