How to Output the ESP32's "Raw" Clock

jfhoff
Posts: 1
Joined: Tue Feb 27, 2024 1:42 am

How to Output the ESP32's "Raw" Clock

Postby jfhoff » Tue Feb 27, 2024 1:57 am

Hi, I have a question regarding the 30-pin DIP Arduino-like ESP32 device. I want it to operate together with another high-speed device, and I would like the two devices to operate synchronously, so I can keep them generally in step with one another. The other device (a "UPduino" from TinyVision.ai) runs at 12-48 MHz, and can accept an external clock. I also can manipulate the clock with an internal phase-locked loop (PLL). However, the fastest "clock" I can find a way to extract from the ESP32 in C is through the "tone" command, and it can only output up to 32767 KHz (because the frequency is specified via a signed int); 30 KHz would multiply up to 12 MHz with a factor of 400, which is too high to be stable. Is there any way to output a higher frequency -- something at or close to the ESP32's raw clock frequency?

ESP_Sprite
Posts: 9708
Joined: Thu Nov 26, 2015 4:08 am

Re: How to Output the ESP32's "Raw" Clock

Postby ESP_Sprite » Tue Feb 27, 2024 2:10 am

You would use the ledc peripheral for that - it can output a frequency of up to 40MHz.

Who is online

Users browsing this forum: No registered users and 60 guests