Remote peripheral ignores rmt_tx_stop command
Posted: Wed Dec 13, 2017 5:22 pm
I am trying to get the remote peripheral to stop sending pulses if I issue a new command to it. The reason I need to do this is because I am need to control a stepper motor based on an unstable signal. The signal may at first cause the stepper to move 100 steps clockwise, then shortly after that it may supersede that instruction with a command to move 10 steps counter-clockwise. This could often occur before the remote peripheral
has finished sending the 100 pulses as ordered by the previous command. So far I have been unable to stop the remote peripheral from sending pulses once it has started.
Today I simply tried to issue a stop command one second after starting a long series of pulses. As far as I can tell, the stop command does not work. In order to demonstrate this, here is a portion of the rmt_example_nec_task from the rmt_nec_tx_rx example project. The code below contains the only modifications to the example project.
The changes to the example are simple:
1. Change the rmt_write_items wait_tx_done flag from true to false
2. Add code after the rmt_write_items command to delay 1 second, stop transmission, delay 1 second, and then restart transmission at the beginning. This step does not work at all.
Am I misusing the stop command? Or have I found something that needs to be fixed?
Can anyone give me any advise how to accommodate my use case?
has finished sending the 100 pulses as ordered by the previous command. So far I have been unable to stop the remote peripheral from sending pulses once it has started.
Today I simply tried to issue a stop command one second after starting a long series of pulses. As far as I can tell, the stop command does not work. In order to demonstrate this, here is a portion of the rmt_example_nec_task from the rmt_nec_tx_rx example project. The code below contains the only modifications to the example project.
Code: Select all
// Portion of rmt_example_nec_task
//To send data according to the waveform items.
ESP_LOGI(NEC_TAG, "Before rmt_write_items");
rmt_write_items(channel, item, item_num, false);
ESP_LOGI(NEC_TAG, "After rmt_write_items");
vTaskDelay(1000 / portTICK_PERIOD_MS);
rmt_tx_stop(channel); // should stop, but it doesn't
vTaskDelay(1000 / portTICK_PERIOD_MS);
rmt_tx_start(channel, true); // if it stopped, should restart
// and send 100 more NEC waveforms
//Wait until sending is done.
rmt_wait_tx_done(channel, portMAX_DELAY);
//before we free the data, make sure sending is already done.
free(item);
vTaskDelay(2000 / portTICK_PERIOD_MS);
}
1. Change the rmt_write_items wait_tx_done flag from true to false
2. Add code after the rmt_write_items command to delay 1 second, stop transmission, delay 1 second, and then restart transmission at the beginning. This step does not work at all.
Am I misusing the stop command? Or have I found something that needs to be fixed?
Can anyone give me any advise how to accommodate my use case?