Current Lua downloadable firmware will be posted here

User avatar
By Sille
#63126 Hey Vladimir,

unfortunatelly I wasn´t able to solve this problem with writing to the shown registers because I had no time to figure it out maybe I try this later. Í guess I have to program with the API and I´m not used to it until now but I will have a look to it later.

But as I said I solved the problem with a shift register and improved the setup by using a flip flop. the flip flop I'am using is more appropriate for my build. the flip flop saves the high state and keeps my sensor in the sleep mode during the esp sleeps as well. I work out an schematic and will load it up for you. It will take some time because I´m a bit busy at the moment.

best regards

User avatar
By grhhm
#82916 As stated earlier, IO state is possible to set with IO_MUX.
Code: Select alliomux Pin Registers (60000804h–60000843h)
31    24       16        8        0
-------- -ffff--- -------- ud--UDEe
          `- Function      ||  |||`- Output Enable
                           ||  ||`- Output Enable during sleep
                           ||  |`- Pull-down during sleep
                           ||  `- Pull-up during sleep
                           |`- Pull-down
                           `- Pull-up

Bit[2] definition thus differs between the link above and this one: ... s-register
That means, not sure if it's possible to pull IO down during the deep sleep, worth to try. I didn't tried that, not needed.
The Pin-register map is good to locate the register number for your required GPIO.

To set GPIO in pull up state during deep sleep, bits [0], [1], [3] and [7] should be asserted.
It's recommended by read-modify-write process. Example for GPIO14:
Code: Select alluint32_t val = READ_PERI_REG(PERIPHS_IO_MUX + 12);
uint32_t mask = 0x8b;  /bits[0,1,3,7] asserted. Same as value to be asserted.
WRITE_PERI_REG(PERIPHS_IO_MUX + 12, (!mask & val) | (mask & 0x8b));

The expression (mask & 0x8b) is universal approach to read-mod-write. It's practically needed only in case you want to set some bits to 0. That is not the case, so just 0x8b is enough here.

The GPIO configuration is reset by MCU boot. Run read-mod-write every boot.