Post topics, source code that relate to the Arduino Platform

User avatar
By torntrousers
#49057 Have you ever wondered what sort of difference the flash modes DIO or QIO make?

There's an issue opened about using the extra GPIO9/10 pins by using the DIO flash mode and I wondered if that might make the ESP much slower, so gave it a try with a little test sketch.

The options are using a flash mode of DIO or QIO, a flash speed of 40MHz or 80MHz, and a CPU speed of 80MHz or 160MHz. The results of those reading 160K from flash give:

Time ....Mode ..Flash ......CPU
(ms) ..................Speed .Speed
100 dio 40MHz 80MHz
86 qio 40MHz 80MHz
84 dio 80MHz 80MHz
78 qio 80MHz 80MHz
68 dio 40MHz 160MHz
55 qio 40MHz 160MHz
53 dio 80MHz 160MHz
46 qio 80MHz 160MHz

What does that show? Probably that most of the time with most use cases the flash mode doesn't really matter if you need an extra GPIO. But if you're running something like a webserver with pages in flash it might be worth using QIO mode and 80MHz flash speed and 160MHz CPU speed.

Any other comments?
User avatar
By picstart
#49088 Yes half speed on DIO versus QIO is expected.Anything beter is good news If you need the extra pins there is no other way to go. An example ...suppose you have an ILI9341 LCD with SPI touch and SPI LCD plus a SPI SD card. AFAIK a good way to get the extra pins is to open the can and lift pins to get to DIO mode so as to free 2 pins. You quickly run out of CS pins for the SPI. You could add an extra IC and effectively multiplex the CS pins but lifting the pins on NodeMCU 12E is easier if you only need an extras two pins.