GPIO_OUT_REG not updating
Posted: Fri Oct 23, 2020 2:26 pm
Hi, I just started figuring out the esp32, and by the technical docs, GPIO_OUT_REG should be a R/W register indicating current pin status. However after a simple test:
This is the serial monitor result for one loop:
Even though I changed the register, and the test LED does blink, when I read it back the register doesn't change, as if I never even set BIT4.
I know that it's a better alternative to use the W1TS/C registers, but I wanted to check the functionality of this register as well.
Code: Select all
void setup() {
Serial.begin(115200);
REG_WRITE(GPIO_ENABLE_REG, BIT4);
}
void loop() {
REG_WRITE(GPIO_OUT_REG,BIT4);
delay(500);
Serial.println(GPIO_OUT_REG, BIN);
REG_WRITE(GPIO_OUT_REG,0x00000000);
delay(500);
Serial.println(GPIO_OUT_REG, BIN);
}
Code: Select all
111111111101000100000000000100
111111111101000100000000000100
I know that it's a better alternative to use the W1TS/C registers, but I wanted to check the functionality of this register as well.