The use of the ESP8266 in the world of IoT

User avatar
By dmarkey
#11369 I need 3 GPIO pins to drive a shift register, however I cant seem to get GPIO1/3 (UART) to act as ordinary output pins.

Would this the code i'm using:

Code: Select all    PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDI_U,FUNC_GPIO1);
    PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDI_U,FUNC_GPIO3);
   
    while ( true){
        GPIO_OUTPUT_SET(2, 1);
        GPIO_OUTPUT_SET(1, 1);
        GPIO_OUTPUT_SET(3, 1);
        GPIO_OUTPUT_SET(0, 1);
        os_delay_us(1000000);
        GPIO_OUTPUT_SET(2, 0);
        GPIO_OUTPUT_SET(1, 0);
        GPIO_OUTPUT_SET(3, 0);
        GPIO_OUTPUT_SET(0, 0);
        os_delay_us(1000000);
       
       
    }


this anywhere near the mark?
User avatar
By EadF
#11375 The mux that correlates to FUNC_GPIO3 is called PERIPHS_IO_MUX_U0RXD_U and FUNC_GPIO1 -> PERIPHS_IO_MUX_U0TXD_U. (eagle_soc.h)

And you will have to make sure that you didn't activate UART0.

Here is a small, alternative uart implementation, one that frees up the RX pin for GPIO use, but still allows you to do os_printf() to the console. https://github.com/eadf/esp8266_stdout (made by Jeroen Domburg)