How to undo gpio_matrix_out?

cspwcspw
Posts: 18
Joined: Mon Apr 16, 2018 5:08 pm

How to undo gpio_matrix_out?

Postby cspwcspw » Fri Sep 21, 2018 5:17 pm

There is a nice example at https://github.com/espressif/esp-idf/bl ... ram.c#L540 that shows how an input GPIO pin can be routed through a pad (with optional inverting of the signal) to another I/O pin.

This code sets up such a routing from one pin, sending it inverted to another pin:

Code: Select all

#define sigA 224
  gpio_matrix_in(14, sigA, 0);            // the "input" of signal 224 comes from D14 
  gpio_matrix_out(22, sigA, 1, 0);      // and appears, inverted, out on pin 22.
To build a feedback clock, we jumper pin 22 back to input pin 14. I see 20MHz on a scope, so it seems like a pulse needs 4 clock cycles to hop through the gpio matrix. If I make two hops, e.g. GPIO14->sig224 -> GPIO22 -- sig225 --> GPIO28 and then link the output to the input, my clock slows to 10 MHz.

Two questions:

1) there are very few "free-to-use" signal pads - 224-228 - to explore this feature. i.e.not even enough to route an 8-bit bus through the matrix. Why are there no signals 229-255? No underlying silicon, or what gives? Am I missing some way to take back signals from peripherals that are not in use?

2) What is the correct way to disconnect / undo my GPIOs 14 and 22, if I want to return them to "normal use".

Thanks
Peter

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: How to undo gpio_matrix_out?

Postby WiFive » Sat Sep 22, 2018 9:09 pm

cspwcspw wrote:No underlying silicon, or what gives?

2) What is the correct way to disconnect / undo my GPIOs 14 and 22, if I want to return them to "normal use".
Probably

Just select a different signal or different mux function

Who is online

Users browsing this forum: No registered users and 103 guests