IO14 on ESP32 TTGO display not available to read voltage

Post and discuss new components that you have created.
Xbiotec
Posts: 200
http://meble-kuchenne.info.pl
Joined: Thu Sep 23, 2021 3:44 pm
Location: France
Has thanked: 32 times
Been thanked: 24 times

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

Post by Xbiotec »

prog
Input and int test.fcfx
(18.77 KiB) Downloaded 262 times
Seb
Seb

LeighM
Valued Contributor
Posts: 411
Joined: Mon Dec 07, 2020 1:00 pm
Has thanked: 76 times
Been thanked: 226 times

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

Post 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

Xbiotec
Posts: 200
Joined: Thu Sep 23, 2021 3:44 pm
Location: France
Has thanked: 32 times
Been thanked: 24 times

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

Post 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 5422 times
Do you explanation why both are working well with interrupt ?
Seb

LeighM
Valued Contributor
Posts: 411
Joined: Mon Dec 07, 2020 1:00 pm
Has thanked: 76 times
Been thanked: 226 times

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

Post 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.

Xbiotec
Posts: 200
Joined: Thu Sep 23, 2021 3:44 pm
Location: France
Has thanked: 32 times
Been thanked: 24 times

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

Post by Xbiotec »

same problem
Input and int test INPUT ICON.fcfx
(17.42 KiB) Downloaded 250 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
Seb

Xbiotec
Posts: 200
Joined: Thu Sep 23, 2021 3:44 pm
Location: France
Has thanked: 32 times
Been thanked: 24 times

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

Post 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 5405 times
Attachments
ESP32.fcdx
(41.12 KiB) Downloaded 228 times
Seb

LeighM
Valued Contributor
Posts: 411
Joined: Mon Dec 07, 2020 1:00 pm
Has thanked: 76 times
Been thanked: 226 times

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

Post 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);

Xbiotec
Posts: 200
Joined: Thu Sep 23, 2021 3:44 pm
Location: France
Has thanked: 32 times
Been thanked: 24 times

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

Post 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
Seb

LeighM
Valued Contributor
Posts: 411
Joined: Mon Dec 07, 2020 1:00 pm
Has thanked: 76 times
Been thanked: 226 times

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

Post by LeighM »

It's a temporary fix.
An update to the CAL will be done when the office reopens in the new year.

BenR
Matrix Staff
Posts: 1895
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 491 times
Been thanked: 664 times

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

Post 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.

Post Reply