Here is the sample sketch -
#define _delta 500*80 // 500us
void inline isr(void)
{
timer0_write(ESP.getCycleCount() + _delta);
}
void setup()
{
noInterrupts();
timer0_isr_init();
timer0_attachInterrupt(isr);
timer0_write(ESP.getCycleCount() + _delta);
interrupts();
}
void loop()
{
// delay(10); // will cause RESET if commented out
delayMicroseconds(10000); // will NOT RESET if commented out
}