Highest clock by GPIO
Posted: Sat Jun 20, 2020 5:16 am
Hello,
Using ESP32, I generate a clock of 9.9MHz by a code as below.
Could anyone please show me if it would be the highest clock?
and, if it would be constantly.
I afraid there would be jitter or deficiency, but I could not check it because I have not logger for so that long period.
Thank you.
// ESP32
//
#define PORT (*((volatile uint32_t*)GPIO_OUT_REG))
#define PIN_OUT 23
//#define PIN_H PORT |= (1 << PIN_OUT)
//#define PIN_L PORT &= ~(1 << PIN_OUT)
#define PIN_H PORT = (1 << PIN_OUT)
#define PIN_L PORT = 0
void setup()
{
pinMode(PIN_OUT, OUTPUT);
noInterrupts();
tag_loop:
PIN_H;
PIN_L;
goto tag_loop;
}
void loop()
{
}
Using ESP32, I generate a clock of 9.9MHz by a code as below.
Could anyone please show me if it would be the highest clock?
and, if it would be constantly.
I afraid there would be jitter or deficiency, but I could not check it because I have not logger for so that long period.
Thank you.
// ESP32
//
#define PORT (*((volatile uint32_t*)GPIO_OUT_REG))
#define PIN_OUT 23
//#define PIN_H PORT |= (1 << PIN_OUT)
//#define PIN_L PORT &= ~(1 << PIN_OUT)
#define PIN_H PORT = (1 << PIN_OUT)
#define PIN_L PORT = 0
void setup()
{
pinMode(PIN_OUT, OUTPUT);
noInterrupts();
tag_loop:
PIN_H;
PIN_L;
goto tag_loop;
}
void loop()
{
}