Replies: 2 comments
-
machine.PWM is driven by LEDC. But LEDC is driven by a 80MHz clock, and this the period is a multiple of 12.5 ns for a regular clock. Since the ESP32 use a fractional divider, setting it to 25MHz will deliver an average of 25Mhz, but with varying period. See the attached screen shot. It shows 24.9757Mhz, but has shorter and longer periods. |
Beta Was this translation helpful? Give feedback.
-
Thank you @robert-hh for taking the time to explain and demonstrate! I was just reading W5500's spec sheet. It requires 30ppm accuracy so we can't use this then. Back to picking several crystals and experimenting with them. The spec sheet doesn't specify ESR value range of whether the drive level is minimal or max. I bet it's minimal drive level of 59uW/MHz. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I remember doing something similar within ESP-IDF with the LEDC module that generates high-freq pulses for LED control. I was able to generate tens of MHz square waves to drive another processor's clock via an XI pin on that processor. I'm looking for the same thing on micropython to drive a W5500 Ethernet controller to save a crystal (and the work to pick the right crystal) but only found this pulse generator that seems to generate only a short train of pulses instead of a constant square wave.
https://docs.micropython.org/en/latest/esp32/quickref.html#rmt
So I wonder if LEDC is exposed in micropython or not. Chances I can't use this feature because of the accuracy. I need 25MHz and the LEDC may only be accurate with 12.5ns increments.
Beta Was this translation helpful? Give feedback.
All reactions