Is there any noticeable difference between Hardware or Software SPI?How hard is it to

Is there any noticeable difference between Hardware or Software SPI?How hard is it to add hardware SPI for specific boards? Reason I ask is that it seems that the Adafruit Huzzah has hardware SPI (https://github.com/adafruit/Adafruit_DotStar/pull/4) but when I use the pins I get a message saying “No hardware SPI pins defined…” I know the library I linked to is for the Adafruit library but I was hoping it could be implemented in a future release of FastLED.

Just my guess: Huzzah is based on the ESP8266; the esp8266 arduino core developers haven’t unlocked how to access the hardware spi module. FWIW the ESP 12E and above have a hardware i2c module on pins 2 and 12, which hasn’t been enabled yet either to my knowledge.

FastLED has some of the fastest software SPI that exists anywhere; the previous name of the library was, in fact, “FastSPI”!

When we write and develop support for a new microcontroller, we like to get it ‘out there and usable’ ASAP. That usually means software-only SPI at first until we learn all the crazy ins and outs and quirks of each individual chip set.

The ESP8266 is not at all like the AVR (old school Arduino) or ARM (Teensy 3 & others) chips. We implemented our traditional very-fast software-only SPI first, and presto! it works … and is fast.

Over time we’ll probably add support for hardware SPI where it make sense, but it’s more of a “nice-to-have” feature than a must-have one.

Maybe @Daniel_Garcia will chime in with sharing some performance numbers, but the short version is that on ‘fast’ chips like ARM and ESP8266, the FastLED software SPI is so fast that there’s not a giant advantage to using hardware SPI.

@Mark_Kriegsman Thanks for the reply. Whenever you have some spare time could you look through my comments on a post I made yesterday regarding an issue I was seeing with your disco strobe code on the newest version of the library from github. I’m really hoping to use the Huzzah with the project but it isn’t supported on the version of the library that seems to run the disco code efficiently.

Implementing hardware SPI support is “on the list” for the ESP8266, I just haven’t had a chance to dive into it yet. (Unfortunately, I’m slammed to the wall with work, about to leave for a week on vacation, so my time here is limited right now)

@Brian_Lewis one quick idea, though, as a stop gap - can you try running your ESP8266 at 160Mhz? Also - have you tried other test/animation code to see where your frame rate limit is?

@Daniel_Garcia I haven’t run into any frame rate issues it was more of a curiosity as to any differences between software and hardware SPI. There definitely seems to be some sort of issue with the newest commits to the library though. Not sure if it’s math related or not. You can see more details with that on my other post if you’d like. I have tried using a teensy and huzzah and the disco strobe code does not run right unless I use the original 3.1 release of the library, which unfortunately doesn’t have support for ESP8266. My issues can wait though. Enjoy your vacation, I’m sure it’s well deserved.

@Brian_Lewis I know its not FastLED specific but I use the ESP8266s hardware SPI on all my projects https://github.com/leonyuhanov/esp8266apa102driver

@Leon_Yuhanov How do you know the SPI library is using the spi hardware, vs bitbanging the same pins?

@Gordon_McLellan Im using the esp Arduino library. I don’t really. I do know that the esp8266 does have SPI as the diagram shows MISO, MOSI, CLK and DATA pins on the header