-->
Page 1 of 2

SPI bit bang or hardware?

PostPosted: Mon Mar 16, 2015 11:43 am
by picstart
If I understand the esp8266 the hardware spi is exclusively for the 512k flash interface.
I'm unsure but I believe there is just one spi hardware port...evidence is the that others Ex the PCD8544 graphic LCD driver bit bangs the SPI interface.

Now on a small LCD this works reasonably well bit banged but on other TFT LCD's with color it is slow.
A fast TFT LCD doesn't need the high time delay the PCD8544 may need.
After eliminating all delays in the bit banging the esp8266 is still slow in comparison to a PIC chip driving the same LCD via hardware SPI.

I have bit banged a ST7735S 128x160 TFT LCD it works but is 5 times slower on a complete screen refresh than a PIC at 10 mips.

An 8 bit or 16bit parallel TFT LCD interface is a non starter since the esp8266 lacks enough I/O pins.

A microchip PIC and its hardware (pins /interfaces) are just a couple of CPU cycles away from receiving or sinking electrons. With the esp8266 the non electrical engineer coders seem to have put the hardware within wrappers that are within wrappers and appear to be holding the electrons back from getting to the pins efficiently.
I see others trying to unwind the esp8266 coders nirvana by setting and clearing pins more efficiently so there is hope for pleasant outcomes.

I have the obvious option to continue using a PIC to interface the LCD and relegate the esp8266 to a UART command line type interface to the PIC but I am attempting to explore what can or can't be done with the esp8266 standalone.

Is there is a way to have the esp8266 use hardware SPI so it might be more pleasant to view the LCD?

Re: SPI bit bang or hardware?

PostPosted: Tue Mar 17, 2015 11:19 am
by Ribeiro Santos
Hi,

I found this information https://github.com/Sermus/ESP8266_Adafruit_ILI9341. Hope it helps.

I'm waiting my ESP8266 esp-12 arrive :)

Thanks,
Ribeiro Santos

Re: SPI bit bang or hardware?

PostPosted: Tue Mar 17, 2015 9:56 pm
by picstart
Well I looked at the code but it unfortunately has been written with coder job security in mind...It has minimal documentation.
Anyway I care little about the coding style.
Coming from a world in which electrons matter I'd like to see them in and out of the esp8266 efficiently.
I know SPI pins are assigned to flash but I don't know if the SPI function can be mapped to any set of pins. Many CPU chips can be remapped. With some PIC chips that have two SPI engines the physical pins for the SPI interface can be assigned ( mapped). The electrical definition of SPI has 4 modes I'm interested in what the hardware can do or can't do. Maybe there is some documentation similar to Microchip documentation that gives the electrical specifications..something with a little more than the esp8266 is a 3.3v device. How much ma can the pins sink or source....etc?
Anyway the ESP8266 and bit banged SPI I have for the ST7735S controller works well ....it is just a wee bit slow on a full screen paint and a wee bit slow to boot up.
The esp8266 is good value at under $5.

Re: SPI bit bang or hardware?

PostPosted: Wed Mar 18, 2015 7:51 am
by Fr4gg0r
There are 2 hardware spis available, also spi is a bus, so can hook up your device to the flash memory.