ESP8266 Developer Zone The Official ESP8266 Forum 2015-07-05T00:27:31+08:00 https://bbs.espressif.com:443/feed.php?f=7&t=662 2015-07-05T00:27:31+08:00 2015-07-05T00:27:31+08:00 https://bbs.espressif.com:443/viewtopic.php?t=662&p=2492#p2492 <![CDATA[Re: GPIO2 doesn't work on my ESP-01 modules]]>
Here is a link to the code

https://github.com/CHERTS/esp8266-devkit/blob/master/Espressif/examples/blinky2/user/user_main.c

Statistics: Posted by kolban — Sun Jul 05, 2015 12:27 am


]]>
2015-06-30T10:51:03+08:00 2015-06-30T10:51:03+08:00 https://bbs.espressif.com:443/viewtopic.php?t=662&p=2441#p2441 <![CDATA[Re: GPIO2 doesn't work on my ESP-01 modules]]>
JohnDoeKyrgyz wrote:
One thing to check is that you are not connecting GPIO 2 to +VCC. Many instructions out there on the internet suggest you do this. I have been able to use GPIO 2 to blink an LED once I disconnected it from VCC.

Thanks John.
There was an external pullup resistor and I removed it from GPIO2.

I found a marco from SDK v1.1.2 doc:

Code:

PIN_PULLUP_DIS(PIN_NAME);

Put it right after GPIO2 selection:

Code:

PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO2_U, FUNC_GPIO2);
PIN_PULLUP_DIS(PERIPHS_IO_MUX_GPIO2_U);

Now the LED blinks!

Statistics: Posted by xiedidan — Tue Jun 30, 2015 10:51 am


]]>
2015-06-30T02:41:11+08:00 2015-06-30T02:41:11+08:00 https://bbs.espressif.com:443/viewtopic.php?t=662&p=2433#p2433 <![CDATA[Re: GPIO2 doesn't work on my ESP-01 modules]]> Statistics: Posted by JohnDoeKyrgyz — Tue Jun 30, 2015 2:41 am


]]>
2015-06-30T09:55:23+08:00 2015-06-29T17:36:35+08:00 https://bbs.espressif.com:443/viewtopic.php?t=662&p=2428#p2428 <![CDATA[GPIO2 doesn't work on my ESP-01 modules]]>
I bought some ESP-01 modules. According to its sch there's a GPIO2 coming directly out from the module:
ESP-01.jpg


I tried to blink a LED with that GPIO2, but it doesn't work.. GPIO2 stuck to high..
Tried with a blue PCB version of ESP-01 and a newer black PCB version saying 'AI-Cloud inside', no luck..
Also tried to remove the external pullup 10k resistor, but still no luck.. :?

I've read there's an internal pullup inside GPIO2 port, should I turn it off? However, I didn't see any interface to do so in SDK doc.
The SDK version is 1.1.2.
Any thoughts?

PS. blink program:

Code:

#include "ets_sys.h"
#include "osapi.h"
#include "gpio.h"
#include "os_type.h"
#include "user_config.h"

#define user_procTaskPrio        0
#define user_procTaskQueueLen    1
os_event_t    user_procTaskQueue[user_procTaskQueueLen];
static void user_procTask(os_event_t *events);

static volatile os_timer_t some_timer;


void some_timerfunc(void *arg)
{
    //Do blinky stuff
    if (GPIO_REG_READ(GPIO_OUT_ADDRESS) & BIT2)
    {
        //Set GPIO2 to LOW - TURN OFF the LED
        gpio_output_set(0, BIT2, BIT2, 0);
    }
    else
    {
        //Set GPIO2 to HIGH - TURN ON the LED
        gpio_output_set(BIT2, 0, BIT2, 0);
    }
}

//Do nothing function
static void ICACHE_FLASH_ATTR  user_procTask(os_event_t *events)
{
    os_delay_us(10);
}

//Init function
void ICACHE_FLASH_ATTR user_init()
{
    // Initialize the GPIO subsystem.
    gpio_init();

    //Set GPIO2 to output mode
    PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO2_U, FUNC_GPIO2);

    //Set GPIO2 low
    gpio_output_set(0, BIT2, BIT2, 0);

    //Disarm timer
    os_timer_disarm(&some_timer);

    //Setup timer
    os_timer_setfn(&some_timer, (os_timer_func_t *)some_timerfunc, NULL);

    //Arm the timer, &some_timer is the pointer 1000 is the fire time in ms
    //0 for once and 1 for repeating timer
    os_timer_arm(&some_timer, 1000, 1);
   
    //Start os task
    system_os_task(user_procTask, user_procTaskPrio,user_procTaskQueue, user_procTaskQueueLen);
}

Statistics: Posted by xiedidan — Mon Jun 29, 2015 5:36 pm


]]>