I was running the following PWM code snippet from the documentation and at first it did not seem to work. I set a breakpoint and stepped through the code and sure enough as the pwm.on() lines were executed my scope showed that the expected output was there. However as I stepped to the last line of code the PWM stopped. I had expected the PWM to keep running.
// Create the PWM instance
local pwm = PWM(1);
// Set the frequency to 2kHz
// Set the duty cycles
// Turn on channels 0-2
In order to keep the PWM running I added a while(true) line to the end of the code so I could look at the timing relationships between the 3 outputs on the scope.
As soon as I saved and ran the code, the browser informed me that I had lost contact with the Esquilo. The IDE was dead and there was nothing I could do to contact the Esquilo. Hitting reset or powering it up and down does not help.
To me it seems that the Esquilo is stuck in the while (true) statement and the RTOS is not servicing the IDE so I can't kill the nut. It seems to be running the boot.nut on reset as expected since the 3 PWM signals come up after reset and power up.
The attached scope trace shows the reset sequence. The blue line is the network LED voltage. It goes low about 1 second after reset when the network LED illuminates, and then about 500 msec later the 3 PWM lines start. I cannot ping or get any response from the Esquilo over the network. I have tried to communicate over the USB. It is recognized as a com port but it is not responsive to logins. I have a second Esquilo to test and I am sure that the USB and network are working properly.
So the question is: Is there some way to get the Esquilo out of this infinite loop or is there something else wrong here that I am missing?