User Tools

Site Tools


esp8266:how-to-use-all-esp01-gpio-pins

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
esp8266:how-to-use-all-esp01-gpio-pins [2019/10/06 15:19]
Ilias Iliopoulos [Conclusion]
esp8266:how-to-use-all-esp01-gpio-pins [2019/10/23 15:24]
Ilias Iliopoulos [Introduction] WeeMos D1 to WeMos D1
Line 9: Line 9:
   - RXD and TXD are used for interfacing purposes, ​   - RXD and TXD are used for interfacing purposes, ​
   - the Reset (RST) and Enable (CH_PD) pins cannot be used for any other purpose, ​   - the Reset (RST) and Enable (CH_PD) pins cannot be used for any other purpose, ​
-  - GPIO0 is used during flashing the operating software, ​+  - GPIO0 and GPIO2 are used during flashing the operating software, ​
  
-Finally, only GPIO2 pin seem to remain ​as a pin to be used for general purpose input/​output. In practice, even GPIO2 has some peculiarities that make it hard to use.+Finally, only GPIO2 pin remains ​as a pin to be used for general purpose input/​output, ​and even this under specific conditions.
  
-There are of course several ways to bypass the problem. The easiest by far is to dump ESP-01 and use one of the several modules, such as the ESP-07 or ESP-12, or one of the development platforms such as NodeMCU, ​WeeMos ​D1 etc. But, engineers are notorious for trying to squeeze every drop of juice, especially when our project requires only minimal resources.+There are of course several ways to bypass the problem. The easiest by far is to dump ESP-01 and use one of the several modules, such as the ESP-07 or ESP-12, or one of the development platforms such as NodeMCU, ​WeMos D1 etc. which provide a larger number of GPIO pins. But, engineers are notorious for trying to squeeze every drop of juice, especially when our project requires only minimal resources, or when we have several spare ESP-01 modules in our lab bins.
  
-In this article, I will show you how to use all the available pins of ESP-01, in a couple of use cases. The article ​is intentionally small, because its purpose is only to present ​"​how"​ it is done and not the details of "​why"​ it is done like this. Please consult the official documentation. Unfortunately,​ the popularity of the ESP8266 has made most of us learn the system ​mostly through articles and experimentation,​ rather than studying the lengthy documentation,​ and therefore, it is not my intention to present information that is not 100% correct.+In this article, I will show you how to use all the available pins of ESP-01, in a couple of use cases. The article ​present ​only "​how"​ it is done and not the details of "​why"​ it is done like this. Please consult the official documentation ​to find additional information. Unfortunately,​ the popularity of the ESP8266 has made most of us learn the ESP-8266 platform ​mostly through articles and experimentation,​ rather than studying the lengthy documentation,​ and therefore, it is not my intention to present information that is not 100% correct.
  
 In addition, bear in mind that __there is no such thing as a free lunch__. There are dangers in the process. Make sure that you have read and fully understand the [[esp8266:​how-to-use-all-esp01-gpio-pins#​WARNING|WARNING]] section below. **You have been warned!!!** In addition, bear in mind that __there is no such thing as a free lunch__. There are dangers in the process. Make sure that you have read and fully understand the [[esp8266:​how-to-use-all-esp01-gpio-pins#​WARNING|WARNING]] section below. **You have been warned!!!**
Line 113: Line 113:
  
 See the circuit below. The series resistors provide some safety from short-circuiting a pin in case both sides operate as outputs, before our code takes over. See the circuit below. The series resistors provide some safety from short-circuiting a pin in case both sides operate as outputs, before our code takes over.
 +
 +{{ :​esp8266:​esp01_txrx.png |}}
  
 In terms of software, in order to force pins TXD/GPIO1 and RXD/GPIO3 to operate as I2C pins functioning as SDA and SCL respectively,​ we must set in our code: In terms of software, in order to force pins TXD/GPIO1 and RXD/GPIO3 to operate as I2C pins functioning as SDA and SCL respectively,​ we must set in our code:
esp8266/how-to-use-all-esp01-gpio-pins.txt ยท Last modified: 2024/02/02 21:49 by Ilias Iliopoulos