Linked Questions

Popular Questions

I'm troubling with the background/internal task of ESP8266 which affect the main functions.

More specific, I'm controlling the digital LEDs by controlling the logic of GPIO (D7 - GPIO13). When I apply the digital LED protocol to ESP8266 (just change the logic of D7 following the protocol), the LEDs work fine. However, sometimes LEDs flashing with the wrong colour. So I analyzed the signal by using the digital oscilloscope, I realized there are many short stop-time between the data chain, which should not happen. It makes the data is errored. Then I just wrote the simple toggle GPIO code below then analyze the signal, and the result like the pictures below:

// This is ESP8266 - Arduino

void setup() {
  pinMode(D7, OUTPUT);                         // switch the D7 to output
}

void loop() {
  digitalWrite(D7, !digitalRead(LED_BUILTIN)); // toggle D7 by reverse the the current state
  delayMicroseconds(22);                       // delay 30 microsecond (compensated 8us for loop() ) 
}

And this is the results (I've just created this account and don't have enough reputation to post the pictures, so just able to post the image links): Two first errors slot at ms1243 and ms226 https://imgur.com/tWaLRxq

Zoom in at ms124, the normal pulse length is exactly 30us https://imgur.com/jJwtcKU

At ms124, a strange long pulse appears??? https://imgur.com/XhsCW3d

At ms129.25, another strange wrong pulse also appears??? https://imgur.com/09kLOAk

At ms154.25, another strange wrong pulse also appears??? https://imgur.com/EuGZXgG

At ms226.60, another strange long pulse also appears??? https://imgur.com/baRMmI1

At ms318.20, another strange long pulse also appears??? https://imgur.com/JLxI1Hi

At ms432.40, another strange long pulse also appears??? https://imgur.com/3MXE44L

It seems the wrong pulses appear randomly, and the long pulses appear every ~100ms. So those pulses make the data become wrong. I guess that there is the affection of background tasks or the internal interrupts of ESP8266. I don't know what are those background tasks and how to stop it.

So is there someone has the solution to stop/prevent/remove this issue?

Related Questions