ESP32 GPIO速率慢

xiaohuihui
Posts: 4
Joined: Tue Apr 20, 2021 9:52 am

ESP32 GPIO速率慢

Postby xiaohuihui » Tue Apr 20, 2021 9:57 am

使用的是 demo代码,稍微修改下,使io口一直翻转,示波器查看io口电平变化间隔。
230ns 也就是 5m 以下的速率
这个速率是不是有点慢呀
还是需要设置什么吗

ESP_Gargamel
Posts: 786
Joined: Wed Nov 14, 2018 8:45 am

Re: ESP32 GPIO速率慢

Postby ESP_Gargamel » Wed Apr 21, 2021 2:30 am

用的什么 demo?用 gpio_set_level 改变电平状态?

xiaohuihui
Posts: 4
Joined: Tue Apr 20, 2021 9:52 am

Re: ESP32 GPIO速率慢

Postby xiaohuihui » Wed Apr 21, 2021 6:22 am

是的 就是使用 gpio_set_level

xiaohuihui
Posts: 4
Joined: Tue Apr 20, 2021 9:52 am

Re: ESP32 GPIO速率慢

Postby xiaohuihui » Wed Apr 21, 2021 6:30 am

我是使用 io口模拟spi驱动ili9341
发现刷屏速度有点慢

```c
gpio_pad_select_gpio(SPI_MOSI_PIN);
gpio_set_direction(SPI_MOSI_PIN, GPIO_MODE_OUTPUT);

#define SPI_MOSI_H gpio_set_level(SPI_MOSI_PIN,1)
#define SPI_MOSI_L gpio_set_level(SPI_MOSI_PIN,0)
```

ESP_Gargamel
Posts: 786
Joined: Wed Nov 14, 2018 8:45 am

Re: ESP32 GPIO速率慢

Postby ESP_Gargamel » Wed Apr 21, 2021 8:12 am

这个函数转成汇编有一定的执行周期,比较慢。为何不直接使用 SPI?

xiaohuihui
Posts: 4
Joined: Tue Apr 20, 2021 9:52 am

Re: ESP32 GPIO速率慢

Postby xiaohuihui » Wed Apr 21, 2021 8:40 am

硬件 spi有跑过 可达80m
所以测试下 模拟的
速度太慢了

Who is online

Users browsing this forum: No registered users and 53 guests