How to quickly reading GPIO pin LOW/HIGH directly?

Paul H asked Oct 16,2020
0

I'm expecting to see the state of a pin that I'm reading to pull low for maybe 50 us and then back up to high. The original code running on an UNO/Nano code looks about like this:

while (((PIND & 0b00001000) >> 3) == 1) {
  // busy
}
while (((PIND & 0b00001000) >> 3) == 0) {
  // busy
}

I've attempted this with the standard function for reading the pin and it's just too slow I think.

What's the best way to replicate this on an ESP32? Thanks!


  • Your Answer(1)
You can only upload 1 files in total. Each file cannot exceed 2MB. Supports JPG, JPEG, GIF, PNG, BMP

Your professional answers would kindly help others and you will get a reward with PCBWay Beans.

    View More
    Browse other questions tagged or ask your own question.
    Ranking Name Answers
    1 Iridium 7
    2 RAfzal 3
    3 PCBWay Support 2
    4 Joson 2
    5 Paul H 2
    6 Engineer 2
    7 Engineer 2
    8 Kemio 1
    9 Gorge 1
    10 Andrew 1