ESP8266 Sans RF

Anything not related to STM32
User avatar
mrburnette
Posts: 1785
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: ESP8622 Sans RF

Post by mrburnette » Wed Apr 20, 2016 10:44 pm

I do believe that the 1st board I received a couple of weeks back is defective. It will program, it will run, but only if I use board type "generic". The new board received yesterday programs perfectly every time as a "NodeMCU 1.0".

More here: viewtopic.php?f=45&t=996&start=40#p12370

Summary...

The NodeMCU board is a good buy at $3.11 USD (a check today shows it at $3.22. At 160MHz with the RF section disabled, the board takes less than 40mA (that is, my meter shows it greater than 30mA but never 40mA.) OTOH, a Maple Mini is in the 40 - 49mA range (never lower than 40 but never showing 50mA on the display).

But... and this is a BIG BUT... the Maple Mini is significantly faster than the ESP8266 based NodeMCU. The small price difference of $4.00 - $3.22 (both free ship) is not enough in my opinion to select a NodeMCU as a replacement for the STM32F103 unless:
  • More than 20K RAM is required
  • More than 128K of flash is required
  • A flash-based internal filesystem is required, SPIFFS
  • CPU sheer speed is not a critical factor
Maybe a few of our members can add to the list. As a caveat, remember that during 1st power-up, the RF will energize and the power consumption will be a minimum of 0.1A and likely a bit higher as I'm using a USB meter and the display is not instantaneous.

Ray

User avatar
RogerClark
Posts: 6095
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: ESP8622 Sans RF

Post by RogerClark » Wed Apr 20, 2016 11:26 pm

Hi Ray

I hadn't realized that the ESP8266 @ 80Mhz (or even 160Mhz) would be significantly slower.

I presume this is because of the instruction fetch time from the SPI Flash.

User avatar
mrburnette
Posts: 1785
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: ESP8622 Sans RF

Post by mrburnette » Thu Apr 21, 2016 12:38 am

RogerClark wrote:Hi Ray

I hadn't realized that the ESP8266 @ 80Mhz (or even 160Mhz) would be significantly slower.

I presume this is because of the instruction fetch time from the SPI Flash.
I am uncertain as the numbers contradict some previous testing, see Martin's link earlier in thread. So, it may be a "workload" issue with the prime number algorithm.

Hopefully, we're get some insight on what is happening, whether it is my port or just a weak spot in the ESP 32-bit uC.

Ray

User avatar
WereCatf
Posts: 167
Joined: Sat Apr 16, 2016 5:30 pm

Re: ESP8622 Sans RF

Post by WereCatf » Thu Apr 21, 2016 1:01 am

mrburnette wrote:I am uncertain as the numbers contradict some previous testing, see Martin's link earlier in thread. So, it may be a "workload" issue with the prime number algorithm.
Your test is measuring Arduino-implementation speed, not just CPU-speed, because your code is calling delay() and digitalWrite() -- digitalWrite() on one platform may be relatively a lot slower on another, and delay() on ESP is definitely much slower than it is on the STM32. If you wanted to measure just the CPU-speed you'd either have to ditch those calls to external functions, or you could measure the average time both functions take before doing the benchmark and then use that average to adjust the time spent executing the benchmark itself -- doing it like that would be the more portable way of getting comparisons of CPU-speeds between the different platforms.

User avatar
mrburnette
Posts: 1785
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: ESP8622 Sans RF

Post by mrburnette » Thu Apr 21, 2016 1:49 am

WereCatf wrote: <...>
Your test is measuring Arduino-implementation speed, not just CPU-speed, because <...>
Yes.

I do not want a cpu benchmark. With RISC hardware, the system clock determines the MIPS (excepting cores with look-ahead and branch determination and cpu pre-cache.) But for most ARM inexpensive uC's, the max clock is the determining factor; THEREFORE, 80MHz is faster than 72MHz... faster by 80/72 = 11.11%

But, as I stated, I wanted a more realistic number, and I picked at random the Prime Number sketch by Nick Gammon which I ported to the Maple Mini and later to the ESP8266. In porting the sketch, the ESP8266 required the inclusion of yield() in the inner calculation loop to avoid a WDT interrupt. The petting of the dog is not optional: it is required. If you say if could be done more efficiently, I believe you but I do not intend on qualifying that number: please feel free to do so yourself and give the forum the results.

For most programmers using ESP8266 with the ArduinoIDE, the yield() command is the "go to" command; therefore, it's use in the sketch is valid, IMO.

The question I was attempting to answer (for myself) is:
  • Can the RF can be easily disabled: YES
  • Is the mAh power profile similar at 80MHz compared to 72MHz STM32F103: Yes
  • Can a sketch be easily modified to run on a non-RF ESP8266: Yes
  • Is the performance of the ESP8266 and STM32F103 similar: No
For the small price difference from ESP8266 to STM32F103 (less than $1 USD) the STM32F103 is the better (and more sophisticated) chip.

However, if one has a demanding RAM or flash requirement where performance is not the primary concern, an ESP8266 may cost-efficiently be utilized. Also SPIFFS may be a decision maker in some designs.

The remainder of your argument is too convoluted for me to respond.

Ray

User avatar
RogerClark
Posts: 6095
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: ESP8622 Sans RF

Post by RogerClark » Thu Apr 21, 2016 3:45 am

I think people would need to compare the speed when doing the actual task that is required.

I'd be surprised if the SPI flash has the same performance as internal flash, for a start it has to come in via single bit, so even if the SPI clock was 80Mhz, it would only come in at 10 Meg bytes per second.

We know from the GD32 that instruction load time makes a big difference, as the 72Mhz GD32 is definitely faster than a 72Mhz STM32 even on the simple benchmarks.

Additionally, the ESP8266 only has one ADC and it is 0 to 1V not 0 to 3.3V. I don't know if the ADC has the same precision as the STM32 (seems unlikely), but I don't know.

User avatar
WereCatf
Posts: 167
Joined: Sat Apr 16, 2016 5:30 pm

Re: ESP8622 Sans RF

Post by WereCatf » Thu Apr 21, 2016 8:10 am

RogerClark wrote:I'd be surprised if the SPI flash has the same performance as internal flash, for a start it has to come in via single bit, so even if the SPI clock was 80Mhz, it would only come in at 10 Meg bytes per second.
The SPI-flash on the ESP8266 uses multiple datalines. Depending on the module you have it's either DIO or QIO, you are thinking of SIO -- my LoLin, for example, has all the datalines connected and thus I can use QIO just fine. https://en.wikipedia.org/wiki/Serial_Pe ... _I.2FO_SPI

That said, I have not measured how fast it actually is in practice. Might be able to find some examples using Google.

User avatar
WereCatf
Posts: 167
Joined: Sat Apr 16, 2016 5:30 pm

Re: ESP8622 Sans RF

Post by WereCatf » Thu Apr 21, 2016 8:54 am

Now that I think about it, how would one even go about testing internal flash-speed? You'd need some routing cached in IRAM, not calling any external functions so as not to trigger instruction-fetch during the testing..

User avatar
Slammer
Posts: 241
Joined: Tue Mar 01, 2016 10:35 pm
Location: Athens, Greece

Re: ESP8622 Sans RF

Post by Slammer » Thu Apr 21, 2016 9:18 am

WereCatf wrote:....not calling any external functions so as not to trigger instruction-fetch during the testing..
Correct, additionally this routine must not access static data located in SPI. My feeling is that in the example of mrburnette there are calls to spi located functions and access to external static data (the array on numbers) possibly located also in SPI. We need a stand alone routine located in IRAM to check if there is real difference in execution speed, actually this is an "academic" conversation as the available memory of IRAM is very limited and can not be used for something more than an interrupt or a very tiny function.
Anyway the performance and the value of this tiny 2$ device is remarkable, for my point of view, the only real limitation is the number of IO/peripheral.

User avatar
mrburnette
Posts: 1785
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: ESP8622 Sans RF

Post by mrburnette » Thu Apr 21, 2016 1:02 pm

Slammer wrote: <...>
Anyway the performance and the value of this tiny 2$ device is remarkable, for my point of view, the only real limitation is the number of IO/peripheral.
Thank you. My point. At the price point, with RF/WiFi the price is remarkable! Without WiFi, the price is still very good since around $2 will buy an Arduino Mini clone.

I went into the experiment thinking the ESP8266 even with the external flash slow-down would be compensated more by the CPU system clock. It is not, at least when programmed at the Arduino level. While I can turn RF off, I have not found an API to disable the task-switching but leave the Arduino code active. Such a thing is probably unlikely because of the way the underlying ESP8266 firmware is loaded with each Arduino reinstall.

There are lots of possibilities here for further experimentation, API hunting, and just creative coding. Porting from Arduino to ESP8266 is very easy when one discounts the WiFi commands and just uses the module as a dumb Nano. I encourage others to take on the experiment for continuation. I find it interesting,

... and understand, I was not trying in anyway to write a benchmark or profile system performance. I just wanted to compare two boards with a very similar sketch.


Ray

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest