Using GPIO pins on a Lyra-T board

PeterB
Posts: 4
Joined: Sun Feb 26, 2023 10:39 pm

Using GPIO pins on a Lyra-T board

Postby PeterB » Sun Feb 26, 2023 11:19 pm

Hello, I am trying to use the JTAG header pins as GPIO pins on a Lyra-T board.

I have switched the DIP switches as per the Hardware Ref to enable JTAG (DIP switches 3 to 7 ON).

I want to run two rotary encoders using the four available pins (earth being provided on a power rail). I am using the ESP-IDF, my code works fine on an ESP32 board. Obviously I have changed the pin numbers to suit the Lyra-T.

The encoder connected to JTAG pins 3 and 4 (WTDI, GPIO 12 and WTMS, GPIO14) works, the encoder connected to JTAG pins 1 and 2 (WTDO, GPIO 15 and WTCK, GPIO15) doesn't. Swapping them over gives the same result so it is not a faulty encoder.

Any ideas why this would be, and how to fix it?

(I'm assuming that the JTAG header is the best option to use - I will have a display connected to the I2C header, and the other headers seem to have multiple uses).

Thanks!

ESP_LJH
Posts: 387
Joined: Tue May 18, 2021 9:21 am

Re: Using GPIO pins on a Lyra-T board

Postby ESP_LJH » Mon Feb 27, 2023 7:05 am

I check the schemaitc, IO13 is also used in Touch, IO15 is also used in SD card, are you sure in your code these two peripherals not work simultaneously?

PeterB
Posts: 4
Joined: Sun Feb 26, 2023 10:39 pm

Re: Using GPIO pins on a Lyra-T board

Postby PeterB » Mon Feb 27, 2023 9:17 am

Thanks for the reply.

I think the SD card is disabled with the DIP switches in that configuration, so Pin 15 should be okay?

Yes, the 'Allocation of ESP32 pins' section of the Hardware Reference doc says that Pin 13 is also used for the Vol- touch pad. Presumably this is the issue.

Is there any way around this? Another way to get the other two pins?

I am basically looking to use two rotary encoders - one to change the radio station, the other to change the volume. I have to use physical parts rather than a web interface.

Thanks!

(Typo/correction - in my original post that should have been '...the encoder connected to JTAG pins 1 and 2 (WTDO, GPIO 15 and WTCK, GPIO13) doesn't...'. The pins are correct in my code!)

PeterB
Posts: 4
Joined: Sun Feb 26, 2023 10:39 pm

Re: Using GPIO pins on a Lyra-T board

Postby PeterB » Wed Mar 01, 2023 6:28 pm

I don't understand this, as the hardware reference says that (after JTAG is enabled)
Vol- touch button is not available for use with the API
So surely Pin 13 should be available for me to use too?

Is anyone here from Espressif who could explain this?

Thanks, Peter

ESP_LJH
Posts: 387
Joined: Tue May 18, 2021 9:21 am

Re: Using GPIO pins on a Lyra-T board

Postby ESP_LJH » Fri Mar 03, 2023 2:38 am

I am not good at software, so it is just an idea, could you make sure if JTAG function is disabled in code? Another is maybe a pull-down at GPIO13 will affect I2C signals?

PeterB
Posts: 4
Joined: Sun Feb 26, 2023 10:39 pm

Re: Using GPIO pins on a Lyra-T board

Postby PeterB » Fri Mar 03, 2023 5:37 pm

Thanks for the reply. I'm not much good with software either (or hardware! :roll: )

I think I'm going to try I2C rotary encoder boards. They should only need one (interrupt) pin each, which hopefully will work with the JTAG pins that are functioning.

I've had an OLED display running on the I2C header so I know that it works okay.

I'll report back (for anyone finding this is the future).

Cheers,
Peter

Who is online

Users browsing this forum: No registered users and 74 guests