ESP32-S3 GPIO翻转速度怎么这么慢呢?

pyg111
Posts: 1
Joined: Sat May 21, 2022 3:01 am

ESP32-S3 GPIO翻转速度怎么这么慢呢?

Postby pyg111 » Sat May 21, 2022 3:27 am

示例代码改了改,基本上直接操作寄存器了,60ns翻转,请教各位高工正常么?是否还能提高?实际项目中要模拟一个通信协议,至少要20到30ns翻转才行。
Attachments
逻辑分析仪测量esp32-s3翻转.png
逻辑分析仪测量翻转
逻辑分析仪测量esp32-s3翻转.png (13.25 KiB) Viewed 3529 times
esp32-s3翻转代码.png
测量翻转的代码
esp32-s3翻转代码.png (27.79 KiB) Viewed 3529 times

ESP_morris
Posts: 290
Joined: Wed Sep 05, 2018 6:23 am

Re: ESP32-S3 GPIO翻转速度怎么这么慢呢?

Postby ESP_morris » Sat May 21, 2022 4:07 am

可以试试用CPU指令去翻转GPIO:https://docs.espressif.com/projects/esp ... _gpio.html

想要活的最高的翻转速率,记住直接写内联汇编

ESP_morris
Posts: 290
Joined: Wed Sep 05, 2018 6:23 am

Re: ESP32-S3 GPIO翻转速度怎么这么慢呢?

Postby ESP_morris » Sat May 21, 2022 4:09 am

另外,真不建议使用gpio去模拟任何协议,尤其是在一个RTOS环境下。你可以看看能否用RMT硬件构造出你要的时序:https://docs.espressif.com/projects/esp ... s/rmt.html

ESP_Yake
Posts: 109
Joined: Mon Mar 06, 2017 12:23 pm

Re: ESP32-S3 GPIO翻转速度怎么这么慢呢?

Postby ESP_Yake » Wed May 25, 2022 1:52 am

同意,RMT 硬件非常灵活,协议一般的格式 RMT 都可以搞的定,GPIO模拟翻转的太频繁容易导致系统不稳定

Who is online

Users browsing this forum: No registered users and 47 guests