I am currently working on project that uses RMT. It is just sending impulses of variable duration and pauses in time.
However I have troubles with properly setting time duration of RMT items. Looks like it is related to clock divider.
I followed esp example but still it does not work and time durations come out too short
Some questions - what is the proper way to set precise time in microseconds for RMT items?
Also what are the recommended values for clk_div, what exactly is idle_level, idle_output_en and mem_block_num...
How all that works? I read documentation saying that there are some limits for number of items - so do I need to set something in config?
For now I need items basically with 500us impulses or multiplication of 500us
Thanks
RMT - problem with setting precise item duration
-
- Posts: 9709
- Joined: Thu Nov 26, 2015 4:08 am
Re: RMT - problem with setting precise item duration
What specific problems are you getting?
Re: RMT - problem with setting precise item duration
The time duration in us is different from what I set up.
I use calculations from the esp examples - RMT_TICK_10_US = (80000000/RMT_CLK_DIV/100000), RMT_CLK_DIV = 100
So 500us as a result on scope gives me strange result and less than 500 - between 100-300 -I must check.
Microsecond values look ok so I don't understand what could decrease the signal.
I also must use 40-70milisec pauses and it all is supposed to go to RF transmitter.
How multiplying clock counter is done by RMT? Is it float calculations or integer division.
And what are the best divider values for specific durations and scale?
I use calculations from the esp examples - RMT_TICK_10_US = (80000000/RMT_CLK_DIV/100000), RMT_CLK_DIV = 100
So 500us as a result on scope gives me strange result and less than 500 - between 100-300 -I must check.
Microsecond values look ok so I don't understand what could decrease the signal.
I also must use 40-70milisec pauses and it all is supposed to go to RF transmitter.
How multiplying clock counter is done by RMT? Is it float calculations or integer division.
And what are the best divider values for specific durations and scale?
-
- Posts: 9709
- Joined: Thu Nov 26, 2015 4:08 am
Re: RMT - problem with setting precise item duration
Hmm, to my knowledge that should work. Do you happen to enable sleep modes or something somewhere?
Re: RMT - problem with setting precise item duration
Calculate RMT frequencies:
- 80 MHz: ESP32 Source Clock frequency
- RMT_DIV_CNT_CHn: RMT Channel Clock Divisor
- RMT Channel Clock frequency = ESP32 Source Clock frequency / RMT_DIV_CNT_CHn
- RMT_CARRIER_HIGH_CHn: RMT Carrier Clock high duration, in ESP32 Source Clock periods
- RMT_CARRIER_LOW_CHn: RMT Carrier Clock low duration, in ESP32 Source Clock periods
- RMT Carrier Clock frequency = ESP32 Source Clock frequency / (RMT_CARRIER_HIGH_CHn + RMT_CARRIER_LOW_CHn)
- RMT Carrier Clock duty cycle = RMT_CARRIER_HIGH_CHn / (RMT_CARRIER_HIGH_CHn + RMT_CARRIER_LOW_CHn)
- RMT Pulse Duration Resolution = One RMT Channel Clock period
- RMT Pulse Maximum Duration = (2^15) * RMT Channel Clock period
Who is online
Users browsing this forum: MicroController and 132 guests