ESP External Clock
Posted: Wed Jul 05, 2017 3:00 am
by FroggestSpirit
Hi, I'm brand new here. I have been using arduino for projects, and recently invested in an ESP32 Wroom, for the extra power. Right now, I want to interface the ESP32 with a gameboy, I made a cartridge with all 32 pins hooked up to a breadboard. From what I read, the CLK pin runs at 1MHZ, which is what I want to sync the ESP32 to. I also want to disable all un-needed processes, like wifi, bluetooth, etc. I am using the arduino library for this, and I tried using attachInterrupt() with it only triggering on the rising signal, while this did work for slower signals, plugging it into the CLK pin seemed to crash it (possibly from watchdog, which I was hoping to disable too).
Re: ESP External Clock
Posted: Wed Jul 05, 2017 3:10 am
by ESP_Sprite
Unfortunately, interrupts on the ESP32 are a bit more complex than on an AVR (mostly because we need to do a bunch more context switching things, as well as the need to figure out what interrupt is triggered.) This means interrupt latency is about 2uS, which means that at 1MHz, the first interrupt isn't finished yet before the 2nd triggers, and the ESP32 continuously stays in the interrupt handler.
A way around this is to write your own high-level interrupt handler in assembly, but this is not a quick and easy thing...
Re: ESP External Clock
Posted: Wed Jul 05, 2017 2:08 pm
by FroggestSpirit
Is there a good place to start with this? I've worked with ASM in the past, mostly for gameboy and ARM