Bit-bang XIAO-ESP32C6 GPIO registers; processor rebooting

GPIO_OUT_REG = 2097152 → Binary: 0b0010 0000 0000 0000 0000 0000
= Bit 21 is HIGH (2²¹ = 2097152) :white_check_mark:

GPIO_OUT_REG = 0 → All bits LOW → pin is LOW :white_check_mark:

This confirms:

  • You’re setting bit 21 (GPIO21 → D3) → HIGH

  • You’re clearing itLOW

  • This is exactly what you’d expect from correctly toggling GPIO21 using W1TS/W1TC (write-one-to-set / write-one-to-clear) registers on the ESP32-C6.

  • The printed values directly match the bitmask of 1 << 21.

EDIT:

Mark this as the Solution so others can FInd it. :+1:

1 Like