Page 2 of 3

Re: IO14 on ESP32 TTGO display not available to read voltage

Posted: Tue Dec 21, 2021 8:13 am
by Xbiotec
prog
Input and int test.fcfx
(18.77 KiB) Downloaded 262 times
Seb

Re: IO14 on ESP32 TTGO display not available to read voltage

Posted: Tue Dec 21, 2021 10:40 am
by LeighM
Do you have any attached circuitry?
GPIO35 has an on-board pull-up resistor, GPIO0 does not.
Also, please try with debounce set to 0

Re: IO14 on ESP32 TTGO display not available to read voltage

Posted: Tue Dec 21, 2021 11:10 am
by Xbiotec
hi Ben,
yes there is 100K resistor, this is the reason why input is always to 1 when button is not pushed but didn't explain why input still at 1 when button pushed. (set to active low polarity even with debouce set to 0)
circuitry.jpg
circuitry.jpg (15.25 KiB) Viewed 5426 times
Do you explanation why both are working well with interrupt ?

Re: IO14 on ESP32 TTGO display not available to read voltage

Posted: Tue Dec 21, 2021 12:10 pm
by LeighM
Could you try reading the switch input with an Input icon, rather than the Switch component?
Just to eliminate that as a possible issue.
Sorry, I don't have a TTGO to test.

Re: IO14 on ESP32 TTGO display not available to read voltage

Posted: Tue Dec 21, 2021 1:35 pm
by Xbiotec
same problem
Input and int test INPUT ICON.fcfx
(17.42 KiB) Downloaded 251 times
Video
With Input Icon.7z
(1.54 MiB) Downloaded 250 times
I have also upload the original firmware to check if button is working well.
Video with original firmware
video original firmware.7z
(1.74 MiB) Downloaded 251 times

Re: IO14 on ESP32 TTGO display not available to read voltage

Posted: Tue Dec 21, 2021 1:55 pm
by Xbiotec
For your information
I have just added these lines to ESP32.FCDX to be able to use the INT0 too, if you want to release the new version.
Tested : Working well

Code: Select all

	<interrupt ident='GPIO0' type='pin' name='GPIO0' 
			global='\nvoid MX_ISR_GPIO0(void*);\n'
			handler='\n#ifndef MX_ISR_GPIO0_DEF\n#define MX_ISR_GPIO0_DEF\nvoid MX_ISR_GPIO0(void* arg){FCM_%n();}\n#else\n#warning &quot;This interrupt has previously been enabled, so the macro &lt;%n&gt; may never get called.&quot;\n#endif\n' 
			enable='\ngpio_pad_select_gpio(GPIO_NUM_0);\ngpio_set_direction(GPIO_NUM_0, GPIO_MODE_INPUT);\ngpio_install_isr_service(ESP_INTR_FLAG_LOWMED);\ngpio_isr_handler_add(GPIO_NUM_0, MX_ISR_GPIO0, (void*) GPIO_NUM_0);\ngpio_intr_enable(GPIO_NUM_0);\n'
			disable='\ngpio_intr_disable(GPIO_NUM_0);\n' >
			<options >
                <edge name='Interrupt Edge Select' >
                    <entry name='Rising edge' value='\ngpio_set_intr_type(GPIO_NUM_0, GPIO_INTR_POSEDGE);' />
                    <entry name='Falling edge' value='\ngpio_set_intr_type(GPIO_NUM_0, GPIO_INTR_NEGEDGE);' />
                    <entry name='Rising and Falling edge' value='\ngpio_set_intr_type(GPIO_NUM_0, GPIO_INTR_ANYEDGE);' />
                </edge>
            </options>
        </interrupt>
ESP32 INT GPOI0.jpg
ESP32 INT GPOI0.jpg (52.64 KiB) Viewed 5409 times

Re: IO14 on ESP32 TTGO display not available to read voltage

Posted: Fri Dec 24, 2021 2:36 pm
by LeighM
Hi Seb,

Add this code in a C icon at the start of your program ...

Code: Select all

gpio_set_direction(GPIO_NUM_35, GPIO_MODE_INPUT);

Re: IO14 on ESP32 TTGO display not available to read voltage

Posted: Sun Dec 26, 2021 3:01 pm
by Xbiotec
hi LeighM,
I added this at the start of the program on working well.
Why need to add this ?
why can not be set on the the Fcdx ?

thx

Re: IO14 on ESP32 TTGO display not available to read voltage

Posted: Mon Dec 27, 2021 9:31 am
by LeighM
It's a temporary fix.
An update to the CAL will be done when the office reopens in the new year.

Re: IO14 on ESP32 TTGO display not available to read voltage

Posted: Mon Feb 07, 2022 10:30 am
by BenR
Hello,

Sorry this has taken a while but I have now added the missing GPIO0 and GPIO1 interrupts to all ESP devices and also hopefully solved the IO problem you were having without needing the C icon.