Page 1 of 1

How to undo gpio_matrix_out?

Posted: Fri Sep 21, 2018 5:17 pm
by cspwcspw
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

Re: How to undo gpio_matrix_out?

Posted: Sat Sep 22, 2018 9:09 pm
by WiFive
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