Tag Archives: ESP8266 PORTS problem

The Problem with Ports ESP8266

 

I was about to write about my stunning success with the ESP8266 and WS2812b chips when I’ve hit a snag.

I have a working example of high speed port bashing to control the serial LEDS on GPIO-0.. but I want to use GPIO12. Assuming all of the ports are setup properly..

WRITE_PERI_REG( PERIPHS_GPIO_BASEADDR + GPIO_ID_PIN(0), 1 );

WRITE_PERI_REG( PERIPHS_GPIO_BASEADDR + GPIO_ID_PIN(0), 0 );

The above toggles GPIO-0 up and down at high speed.

WRITE_PERI_REG( PERIPHS_GPIO_BASEADDR + GPIO_ID_PIN(12), 1 );

WRITE_PERI_REG( PERIPHS_GPIO_BASEADDR + GPIO_ID_PIN(12), 0 );

The above does not work on GPIO-12

WRITE_PERI_REG( PERIPHS_GPIO_BASEADDR + GPIO_ID_PIN(12), 0x1000 );

WRITE_PERI_REG( PERIPHS_GPIO_BASEADDR + GPIO_ID_PIN(12), 0 );

The above does not work on GPIO-12 either

WRITE_PERI_REG( PERIPHS_GPIO_BASEADDR,0x1000 );

WRITE_PERI_REG( PERIPHS_GPIO_BASEADDR,0 );

The above works a TREAT on GPIO-12 – but sadly it also messes up the OTHER port bits!!!!

What is the correct code for GPIO-12 ???

Facebooktwittergoogle_pluspinterestlinkedin