-->
Page 2 of 4

Re: Direct GPIO port register manipulation

PostPosted: Fri Apr 08, 2016 7:23 am
by martinayotte
No idea ...

Re: Direct GPIO port register manipulation

PostPosted: Fri Apr 08, 2016 10:07 am
by 123francoz
This is the sketch i made in Arduino 1.6.8 IDE with ESP8266 ver 2.1.0 package installed and everything left default:
Code: Select all#define led 2

void setup() {
  noInterrupts();
  pinMode(led, OUTPUT);
}

void loop() {
  while (true) {
    digitalWrite(led, LOW);
    digitalWrite(led, HIGH);
  }
}

It gives me a 1.1MHz squre wave at GPIO2 with a frequency drop at about half the frequency every almost 3 seconds

Re: Direct GPIO port register manipulation

PostPosted: Fri Apr 08, 2016 10:30 am
by martinayotte
Of course, the WiFi background tasks are still partially running, even if you call noInterrupt(), simply because the NMI interrupt is still active (this one cannot be blocked).

But why are you trying to block interrupts ? Because in this case, even if WiFi tasks partially running, you won't get a working WiFi.

If it is simply to have a stable waveform, maybe you should attach a separate MCU to do that, such AVR, or even STM32.

Re: Direct GPIO port register manipulation

PostPosted: Fri Apr 08, 2016 2:11 pm
by 123francoz
There is not a specific reason because i'm doing that.
I only wanted to see how the firmware has been implemented
and do a hardware benchmark, as well as seeing how good it is in real time tasks.
Knowing that there is a sort of wifi interrupt is enough,
but as i don't need it, is there a way to deactivate it?