logo elektroda
logo elektroda
X
logo elektroda

ESP32-PICO-D4 - how to assign I2C, UART, I2S, SPI to pins?

padre_joseph 1179 6
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 18468508
    padre_joseph
    Level 9  
    Hi,
    I would like to connect several interfaces directly to the ESP32-Pico-D4 chip (I2C, UART, I2S, SPI). The documentation in one place indicates that the chip lead can be connected to any peripheral:
    ESP32-PICO-D4 - how to assign I2C, UART, I2S, SPI to pins? .
    and in another it shows what peripherals are available at a given pinout:
    ESP32-PICO-D4 - how to assign I2C, UART, I2S, SPI to pins? .
    Could someone more experienced share their experience and tell me how it is with this in the end? Can I connect any interface to any lead?
  • ADVERTISEMENT
  • #2 18468552
    khoam
    Level 42  
    padre_joseph wrote:
    Documentation in one place indicates that the chip lead can be connected to any peripheral
    .
    This is almost the case :) It is important to note that some of these have limited use e.g. they can only operate in INPUT mode.
    https://randomnerdtutorials.com/esp32-pinout-reference-gpios/

    padre_joseph wrote:
    Can I connect any interface to any lead-in?
    .
    It is always better to check for a specific interface how it should be configured. For an example of I2C:
    https://docs.espressif.com/projects/esp-idf/e...peripherals/i2c.html#i2c-api-configure-driver

    padre_joseph wrote:
    and in another it shows what peripherals are available under a given pinout:
    .
    This is about the default pins for a given interface.
  • ADVERTISEMENT
  • ADVERTISEMENT
  • #4 18480853
    khoam
    Level 42  
    padre_joseph wrote:
    Section 4.2 clearly defines which peripheral can be connected to which chip pin.
    .
    The problem is that the terms "Any GPIO Pins" used there are a kind of mental shortcut and are not true for e.g. UART, SPI or I2C. Better verify this with the information I provided in the previous post though.

    In the document referred to by a colleague in the last post, it is worth reading the appendix "A.1. Notes on ESP32 Pin Lists".
  • #5 18482230
    padre_joseph
    Level 9  
    Thank you for your help. Let me pull the topic further to understand the manufacturer's documentation.
    Assuming I want to configure the UART interface, I check the Manual attached by a colleague.

    ESP32-PICO-D4 - how to assign I2C, UART, I2S, SPI to pins? .

    It is stated that I can designate any GPIO pins to the interface, provided (according to the documentation) that I do not attach the TX (output) line to "Input Only". If I stay with the default settings, the interface will be attached to the default leads according to the table in appendix A.4 IO_MUX.
  • #6 18482268
    khoam
    Level 42  
    padre_joseph wrote:
    It is stated that I can indicate any GPIO pins to the interface, provided (according to the documentation) that I do not include the TX (output) line as "Input Only".
    .
    If the "Input Only" pin is specified as TX, the uart_set_pin() function will return the value ESP_FAIL.

    padre_joseph wrote:
    If I stay with the default settings, the interface will be attached to the default pins as shown in the table in Appendix A.4. IO_MUX.
    .
    Yes, for the given UART interface and according to the defaults in the uart_channel.h file:
    https://github.com/espressif/esp-idf/blob/rel...mponents/soc/esp32/include/soc/uart_channel.h
  • ADVERTISEMENT
  • #7 18496649
    JanuszKornas
    Level 11  
    khoam wrote:
    Right this is :) It is important to note that some of these have limited use e.g. they can only operate in INPUT mode.
    https://randomnerdtutorials.com/esp32-pinout-reference-gpios/


    Gentlemen the link given above - LINE OF THE MONTH for me. Google-translator-pages and sensational to read. Super descriptions for anyone starting with ESP32/ESP8266!!!

Topic summary

The discussion revolves around the configuration of I2C, UART, I2S, and SPI interfaces on the ESP32-PICO-D4 chip. Users clarify that while the chip allows for flexible pin assignments, certain limitations exist, particularly with "Input Only" pins that cannot be used for output functions like TX in UART. Documentation from Espressif provides detailed guidance on which GPIO pins can be assigned to specific peripherals, emphasizing the importance of adhering to default settings unless explicitly configured otherwise. Users share links to relevant resources, including the ESP32 datasheet and API documentation, to aid in understanding the pin configuration process.
Summary generated by the language model.
ADVERTISEMENT