Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By keen4
#16831
eriksl wrote:On the esp8266 or on the break-out-board?


LED_PIN = 4 -- GPIO2
TIME_ALARM = 500 -- 0.5 second
gpio.mode(LED_PIN, gpio.OUTPUT)

As you can see: insert from the program: GPIO2 has position 4, but on chip GPIO2 has pin 15 & on board ESP-xy pin is different.
From where number 4 comes? where is the table ?
User avatar
By trackerj
#16833
keen4 wrote:
eriksl wrote:On the esp8266 or on the break-out-board?


LED_PIN = 4 -- GPIO2
TIME_ALARM = 500 -- 0.5 second
gpio.mode(LED_PIN, gpio.OUTPUT)

As you can see: insert from the program: GPIO2 has position 4, but on chip GPIO2 has pin 15 & on board ESP-xy pin is different.
From where number 4 comes? where is the table ?


ESP8266 Chip datasheet and informations are still ... let's say ... quite fragile, if you compate it with ATMega datasheets :)

It's just a PIN allocation, might look confusing but looks like that for example:

0 - GPIO16
1 - GPIO5
2 - GPIO4
3 - GPIO0
4 - GPIO2
5 - GPIO14
6 - GPIO12
7 - GPIO13
8 - GPIO15
9 - GPIO3
10 - GPIO1
11 - GPIO9
12 - GPIO10

https://github.com/nodemcu/nodemcu-firmware

PS: if any typo error above, please correct.
User avatar
By eriksl
#16863
keen4 wrote:
eriksl wrote:On the esp8266 or on the break-out-board?


LED_PIN = 4 -- GPIO2
TIME_ALARM = 500 -- 0.5 second
gpio.mode(LED_PIN, gpio.OUTPUT)

As you can see: insert from the program: GPIO2 has position 4, but on chip GPIO2 has pin 15 & on board ESP-xy pin is different.
From where number 4 comes? where is the table ?


The numbers in the above table are pin numbers on the package ("ic", "chip"). I don't think it's very constructive to make such a list for every break-out-board available, there are a LOT now. So for each user the only thing left to do is map the package pin number to the pin number on their break-out-board. I've left out the pin numbers on my esp201 out exactly for that purpose. There are quite enough diagrams google'ble that show mappings between package and esp201 (etc.).