In the last log, I mentioned that the ESP8266 might be a good competitor to the F030 due to:
- It's dirt cheap price ($1.5 and you can get an ESP-12)
- The Xtensa processor embedded in the ESP8266 is 32-bit and runs at 80/160MHz
tl;dr: The ESP-12 does 8620 SHA256d operations per second (or 116usec per operation). This is 3.36x faster than the F030
At first, I didn't have high hopes for the ESP. While I know that the ESP and the F030 is pretty comparable except for the much higher clock speed, the ESP should be beating the F030 out of the water. Except MerlotMachina had already implemented a Bitcoin miner on the ESP, and he only managed to get it to ~1200 ops/sec. That was quite counter-intuitive, so I decided to try it out by myself to see if it was really that bad, and if I could do anything to improve it.
But first I need a USB-to-UART dongle. The CP2102 is pretty nice by the way.
Then I loaded the same code that MerlotMachine used to my ESP8266. The result came out to be about 800usec per op, or just about 1250 ops/sec. Increasing the clock to 160MHz only made it a little bit more faster, at about 700usec/op or 1428 ops/sec. Basically I was hitting a brick wall here.
Then I decided to look through the SHA256 implementation, and this seem like a pretty bad one. So I replaced it with the one that I used on the F030. Boom, now it took only 116 usec/ops (or 8620ops/sec). I though it would be fast, but not this fast.
I'd account these two reasons for this drastic difference between the ESP and the F030:
- Faster clock (duh) 64MHz to 160MHz = 2.5x increase in clock rate
- More efficient LX106 instruction set. 24960 clock cycle to 18560 clock cycle = ~1.3x decrease in clock cycle
So from that, the ESP looks like a very competitive alternative to the F030. But then here are some more comparisons:
STM32F030F4P6 | ESP8266 | ||
Hashing rate | 2564 | 8620 | 3.36x |
Price | $0.7 | $1.98 | -2.82x |
Power consumption | [TBD] | [TBD] | [TBD] |
PCB efficiency (on a 5x5cm board) | 8 | 6 (ESP-01) 4 (ESP-12) | -2x |
Heat | Can't feel any | Hot | ??? |
Might as well stick with the F030 then.
Disclaimer: I'm biasing towards choosing the F030.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.