← index #16588PR #12784
Related · high · value 1.229
QUERY · ISSUE

RMT frequency other than 80 MHz?

openby 0wwafaopened 2025-01-15updated 2025-03-03
enhancementport-esp32

Description

In the documentation I read that the frequency for the RMT function is fixed at 80 Mhz.
Any chance you could add also the other frequencies available?

Code Size

The additional code size should be very tiny.

Implementation

I hope the MicroPython maintainers or community will implement this feature

Code of Conduct

Yes, I agree

CANDIDATE · PULL REQUEST

Change esp32.RMT.source_freq() to class method

mergedby bulletmarkopened 2023-10-24updated 2023-11-09
port-esp32

To create a esp32.RMT() instance with an optimum (i.e. highest resolution) clock_div is currently awkward because you need to know the source clock frequency to calculate the best clock_div but unfortunately that is only currently available as an source_freq() method on the instance after you have already created it, i.e. we have a chicken and egg problem. So RMT.source_freq() should really be a class method, not an instance method and this PR changes that in the code and documentation. Of course this change is backwards compatible for existing code because you can still reference that function from an instance, or now also, from the class, i.e.

from esp32 import RMT
rmt = RMT(0, pin)

assert rmt.source_freq() == RMT.source_freq()

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied