Hello,
I used RMT to generate the signal and the result is strange:
-Signal frames are generated precisly and correctly -> Good
-Unexplicable 35us delay between frames -> Not good
-Huge delay of 140 ms that seems like a reset or something like that... -> Not good at all
Here is the code (I use arduino IDE):
Code: Select all
void setup() {
config.rmt_mode = RMT_MODE_TX;
config.channel = RMT_CHANNEL_0;
config.gpio_num = (gpio_num_t)0;
config.mem_block_num = 1;
config.tx_config.loop_en = 0;
config.tx_config.carrier_en = 0;
config.tx_config.idle_output_en = 1;
config.tx_config.idle_level = (rmt_idle_level_t)0;
config.tx_config.carrier_duty_percent = 50;
config.tx_config.carrier_freq_hz = 1000000;
config.tx_config.carrier_level = (rmt_carrier_level_t)1;
config.clk_div = 2;
rmt_config(&config);
rmt_driver_install(config.channel, 0, 0);
}
Code: Select all
void loop() {
/* Computing Signal Timing to feed RMT */
rmt_write_items(config.channel, Times_Array,
16, /* Number of items */
1 /* wait till done */);
delayMicroseconds(1);
}
Here is the result with dezooming progressively:
With a 5us division, we see the signal is OK:
![DshotOK.jpg](./download/file.php?id=1236&sid=5a20504ef0f6a80e2446a8d31d3c8740)
- DshotOK.jpg (105.94 KiB) Viewed 18506 times
With 20us division, we see that we have 35us between frames. I expected less than 10 (delay of 1us and the computing takes 7us). It can be reduced to 20 with setting wait_tx_done to 0 for rmt_write_items :
![Dshot_Reset.jpg](./download/file.php?id=1235&sid=5a20504ef0f6a80e2446a8d31d3c8740)
- Dshot_Reset.jpg (88.43 KiB) Viewed 18506 times
With 200ms division, we see a huge delay of 144ms! :
![Dshot_delay_between_frames.jpg](./download/file.php?id=1234&sid=5a20504ef0f6a80e2446a8d31d3c8740)
- Dshot_delay_between_frames.jpg (105.14 KiB) Viewed 18506 times
So the questions I have this time are:
-What is causing that delay between frames and the huge delay of 140ms?
-Is it OK if I put wait_tx_done to 0 for rmt_write_items?
-What is the impact of carrier_freq_hz for RMT? (I tried to change it without visible impact)
Thanks in advance!