Chat freely about anything...

User avatar
By ZorroII
#54303 esp-12 comes with a on-board flash chip enabling an 4MB space, but 6 gpio pins are occupied. i want to build a system with many devices(especially with a ov7670 camera which takes a lot of IO pins) based on esp-12, and every gpio pin counts. which comes to my mind is, the flash chip is not used very often, maybe only when booting, operating EEPROM or file system, so can for example disable the SDCLK to make other gpios available temporarily? or is there any other ways?
User avatar
By picstart
#54323 Well the flash contains your software plus the system software your software invokes. Now the flash as two modes DIO and QIO so you can release two pins by using DIO. The downside is that you have to remove the metal can and lift some pins on the flash chip just to get two additional pins. The better method for a lot more pins is to add a port expander either using SPI or I2C. I2C is easier but SPI is faster.
The SPI expander can have issues with many arduino libraries since coders prefer to bury the hardware calls in particular with SPI.
With SPI the CS call it is very very often buried effectively marrying the SPI bus exclusively to a vendors hardware and making it unpleasant to share the SPI bus with other devices via an expander since at anytime the vendor's library can lower CS to take control of the bus ( a single digital write to a pin).
In the case of SPI expanders more than just lowering the CS pin is needed since several instructions need to go to the expander to lower a specific CS. This implies that every call involving CS in the vendors library code has to be wrapped with several instructions that are needed to instruct the expander to do the same thing.