Skip to content

Is there any way to use GPIO06 to GPIO11 on NodeMCU 1.0(ESP8266-12e) module #2124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Naveed-Akhtar opened this issue Jun 9, 2016 · 13 comments

Comments

@Naveed-Akhtar
Copy link

Naveed-Akhtar commented Jun 9, 2016

Basic Infos

Hardware

Hardware: ESP8266-12e
Core Version: 2.2.0

Description

I am trying to use the GPIO06 to GPIO11 for simple blink example. The pins are mentioned as in figure: http://learn.acrobotic.com/uploads/esp8266_esp12e_pinout.png.

Can any body help me using these pins for simple blink example? or Is it possible to use these pins as GPIO?

Thanks for your precious time in advance.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@WereCatf
Copy link
Contributor

They are in use by the internal Flash, so no.

@igrr
Copy link
Member

igrr commented Jun 10, 2016

I think in DIO mode you should be able to use two of them.

On Fri, Jun 10, 2016, 15:07 WereCatf [email protected] wrote:

They are in use by the internal Flash, so no.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#2124 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AEJcevTu1Z6NseGMiAxQ_YdydL9VeDdqks5qKQ1AgaJpZM4IyJbD
.

@torntrousers
Copy link
Contributor

I've wondered about this too and would like to have a go. Any help or guidance?

I thought go add a new definition in boards.txt to have an ESP using DIO, was going to copy the NodeMCU 1.0 definition but looking there that already has DIO (nodemcuv2.build.flash_mode=dio), the NodeMCU 0.9 definition has nodemcuv2.build.flash_mode=qio.

Does that mean it should work already when using NodeMCU 1.0? How can I find which are the two GPIO pins freed up when using DIO mode?

@igrr
Copy link
Member

igrr commented Jun 10, 2016

GPIO9 and GPIO10 are shared with SD_DATA2 and SD_DATA3, which are unused in DIO mode. You can find this information in ESP8266 pin map: http://www.esp8266.com/wiki/lib/exe/detail.php?id=esp8266_gpio_pin_allocations&media=pin_functions.png

@torntrousers
Copy link
Contributor

I just tried a quick hack of soldering an LED between GND and GPIO 9 / 10 on a NodeMCU 1.0 board and running the blink sketch using that. GPIO-10 seems to work fine and blinks the LED, but with GPIO-9 it gives a WDT reset when doing the pinMode(9, OUTPUT).

@WereCatf
Copy link
Contributor

@igrr @torntrousers GPIO9 and GPIO10 are still physically connected to the SPI-flash. You'd have to remove the RF-shield, physically cut the connection to those pins from the SPI-flash, solder a jumper-wire there to force the chip to DIO-mode permanently and then put the RF-shield back.

@igrr
Copy link
Member

igrr commented Jun 10, 2016

In that case, maybe we need to check the data sheet of the flash chip used in Nodemcu.
I have tested ESP8285 a few days ago (it has built-in flash connected in DOUT mode) and was able to use both 9 and 10.

@torntrousers
Copy link
Contributor

Interesting that GPIO10 seems to work ok though, even just having the one extra GPIO could be handy sometimes. From the wiring here and a flash chip datasheet here it seems like GPIO10 is connected to the flash Write Protect which might only be enabled when certain status bits are also set so maybe that isn't done and so GPIO10 is safe to be used as it is without any hardware mods?

@torntrousers
Copy link
Contributor

And just in case anyone is wondering does using DIO make things really slow, here's a test to find out.

@WereCatf
Copy link
Contributor

@torntrousers A rather flawed test, considering that your sketch is also run from the Flash: the slower the access to the Flash the slower the code will also run if it doesn't all fit in the cache.

@torntrousers
Copy link
Contributor

Hi @WereCatf, does that really matter? Its not trying to come up with anything like a figure on bits per millisecond just to give an idea of the relative difference between DIO and QIO. And thats the point of showing the code - how would you rewrite the sketch?

@WereCatf
Copy link
Contributor

@torntrousers No, for most needs and purposes I doubt it matters. It was just an observation and may be worth keeping in mind if one does something that is very performance-sensitive.

@devyte
Copy link
Collaborator

devyte commented Oct 17, 2017

Closing this as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants