I've been working with the Adafruit Feather Huzzah ESP8266 lately, using Micropython 1.8.5. Recently I was testing how fast the GPIO could toggle without anything else running on the board, and I was quite surprised at how slow the GPIO seemed to be toggling.
My code looked like this, and I ran it from the REPL:
import machine
a = machine.Pin(0, machine.Pin.OUT)
while True:
a.low()
a.high()
I hooked up my scope to pin 0 to find the approximate frequency that the GPIO was toggling at, and to my surprise it was at around 1MHz; this is much slower than what I would expect from the 80MHz EPS8266.
I'm not sure if this slow GPIO speed is just inherit with using all the overhead involved in Micropython, or if there's something I'm doing wrong in testing this GPIO toggle speed, but I would appreciate if someone could verify that this is normal behaviour for a Feather Huzzah ESP8266. I'm puzzled as to why such simple GPIO commands could behave so slowly.
Problems With Slow GPIO Toggling Test
Re: Problems With Slow GPIO Toggling Test
You may want to look at this thread: http://forum.micropython.org/viewtopic.php?f=16&t=2766
Re: Problems With Slow GPIO Toggling Test
[quote="dhylands"]You may want to look at this thread: http://forum.micropython.org/viewtopic.php?f=16&t=2766[/quote]
That clears things up - thank you!
That clears things up - thank you!