Can the ESP32 read the databus in less than a nanosecond after a external interrupt is triggered?
I have an Apple II that operates at 1 MHz. When the DEVSEL line on the Apple II goes low, I want to read the databus. I have tried this with the arduino ide, but it doesn't work and I believe this is because the read happens too late (even when using REG_READ(GPIO_IN1_REG))
I would like to know: if I use the ESP IDF to write the code, should it be possible for the ESP32 to respond to a pin interrupt and read the data bus within a 1us clock cycle, or is this task not realistic for an ESP32?
Thanks,
Nathan
Can the ESP32 interupt and read port within 1us?
-
- Posts: 25
- Joined: Mon Jun 28, 2021 4:55 am
Re: Can the ESP32 interupt and read port within 1us?
In my experience this is not realistic. The response time (time from interrupt source changing to user ISR execution) is around 2 us.
That time is not exactly the same either, it seems to change every time with some variance.
For your application, it would be best to hook up an STM32 or something (cheapest one you can find) and have it capture the data to send over to ESP32. That's what I have done for similar applications before (data acquisition, logic state capture of large parallel buses, etc).
That time is not exactly the same either, it seems to change every time with some variance.
For your application, it would be best to hook up an STM32 or something (cheapest one you can find) and have it capture the data to send over to ESP32. That's what I have done for similar applications before (data acquisition, logic state capture of large parallel buses, etc).
Hobbyist and electronic design consultant! (https://PCBArtists.com/)
Re: Can the ESP32 interupt and read port within 1us?
I think you can use PULSE_CNT to try
Re: Can the ESP32 interupt and read port within 1us?
You might not find the timing to be fast enough nor precise enough.
Consider 74ls373 to latch the value to be processed by software.
You may not want to use he but the timing it offers may be what is necessary.
I used that device to connect my coverage analysis hardware to an address bus.
Tom
Consider 74ls373 to latch the value to be processed by software.
You may not want to use he but the timing it offers may be what is necessary.
I used that device to connect my coverage analysis hardware to an address bus.
Tom
IT Professional, Maker
Santiago, Dominican Republic
Santiago, Dominican Republic
Re: Can the ESP32 interupt and read port within 1us?
Thanks everyone for the feedback. I appreciate it, and the suggestions for alternate methods of doing what I need. Cheers!
-
- Posts: 8
- Joined: Wed Jun 30, 2021 6:16 pm
Re: Can the ESP32 interupt and read port within 1us?
It might also be worth trying ESP32's assembly high-level interrupts. I've never used them personally, but they can allegedly give interrupt latencies that are significantly lower than the ~2us for regular ESP32 C interrupts.
See: viewtopic.php?t=422
See: https://docs.espressif.com/projects/esp ... rupts.html
See: viewtopic.php?t=422
See: https://docs.espressif.com/projects/esp ... rupts.html
Re: Can the ESP32 interupt and read port within 1us?
This is what I was sort of wondering about. It seems like a big leap from using the arduino ide (what I've used) to assembly language with the esp-idf, and I didn't want to go down that route if it wasn't going to be possible to reduce the interrupt latency down to what I needed. I think ultimately it's probably easier to use an STM32 to do the data bus stuff, with an ESP32 attached as suggested, but I'm interested in learning and attempting the low level approach entirely on the ESP32. I've installed the ESP-IDF, and now I supposed I'll have to do a bit of reading. Thanks for the links.therealergo wrote: ↑Mon Jul 12, 2021 4:35 pmIt might also be worth trying ESP32's assembly high-level interrupts. I've never used them personally, but they can allegedly give interrupt latencies that are significantly lower than the ~2us for regular ESP32 C interrupts.
See: viewtopic.php?t=422
See: https://docs.espressif.com/projects/esp ... rupts.html
PS - Another approach I've considered is having the Apple II and the ESP32 swap bytes using dual-port ram.
Who is online
Users browsing this forum: JK Sleepling and 59 guests