ESP32-C3 Drive GPIOs with AT commands

Andrea
Posts: 3
Joined: Wed Feb 02, 2022 5:20 pm

ESP32-C3 Drive GPIOs with AT commands

Postby Andrea » Wed Feb 02, 2022 5:59 pm

Hi Team,
I would need to driver 3 GPIO how digital inputs / outputs using the AT commands on ESP32-C3-WROOM-02 with AT_Bin_V2.3.0.0
I think the command to use is AT + SYSREG.
To set GPIO0 to 1 I did:
AT + SYSREG = 1.0x0024.0x1
and then
AT + SYSREG = 1.0x0008.0x1
but to no avail.
I have also thought about using the AT + DRVPWMINIT command with 0 or 255 but I have seen that it is not implemented.
What mistake am I making?
Thank you

ESP_Sun
Posts: 326
Joined: Thu Dec 30, 2021 9:52 am

Re: ESP32-C3 Drive GPIOs with AT commands

Postby ESP_Sun » Mon Feb 07, 2022 11:32 am

To achieve simple GPIO control, it can be achieved by operating the register through the AT+SYSREG command. Taking the GPIO3 of the ESP32-C3 module as an example, a simple GPIO output high/low level can be realized by writing a register. For the register address, please refer to Chapter 5 of the ESP32-C3 Technical Reference Manual (https://www.espressif.com /en/support/documents/technical-documents?keys=&field_type_tid%5B%5D=785).

Code: Select all

[18:12:38:509] AT+RESTORE

[18:12:39:037] OK

[18:12:40:435] ready

[18:12:55:651] AT+SYSREG=1,0x60009010,0x00001800  //Configure IO_MUX, drive strength, pull-up and pull-down mode of GPIO3

[18:12:55:667] OK

[18:13:38:386] AT+SYSREG=1,0x60004024,0x00000008  //Configure GPIO3 output mode 


[18:13:38:386] OK

[18:13:51:474] AT+SYSREG=1,0x6000400C,0x00000008  //output low level

[18:13:51:474] 

[18:13:51:474] OK

[18:14:04:755] AT+SYSREG=1,0x60004008,0x00000008  //output high level 

[18:14:04:755] 

[18:14:04:755] OK

Andrea
Posts: 3
Joined: Wed Feb 02, 2022 5:20 pm

Re: ESP32-C3 Drive GPIOs with AT commands

Postby Andrea » Mon Feb 07, 2022 6:08 pm

Hi Team,
thank you for the reply.

Following the directions I was able to use the GPIO0 and GPIo1, but not the GPIO4.
These are the commands I set:

AT + SYSREG = 1,0x60009014,0x00001800 // Configure IO_MUX, drive strength, pull-up and pull-down mode of GPIO4
AT + SYSREG = 1,0x60004024,0x00000010 // Configure GPIO4 output mode
AT + SYSREG = 1.0x6000400C, 0x00000010 // output low level
AT + SYSREG = 1,0x60004008,0x00000010 // output high level

but the exit is not set at any level.

Thank you

ESP_Sun
Posts: 326
Joined: Thu Dec 30, 2021 9:52 am

Re: ESP32-C3 Drive GPIOs with AT commands

Postby ESP_Sun » Tue Feb 08, 2022 2:14 am

Since the default firmware of ESP32C3 AT uses GPIO4 pin for flow control, please refer to: https://docs.espressif.com/projects/esp ... -c3-series or https://github.com/espressif/esp-at/blo ... m_data.csv, if other functions need to use GPIO4, you can modify the CTS and RTS pins to -1, please Reference: https://docs.espressif.com/projects/esp ... n.html#id2

Who is online

Users browsing this forum: No registered users and 25 guests