I am trying to send pulses (to generate a square wave with RMT). However, I am having a problem with the rmt_set_tx_thr_intr_en function. It seems like I cannot set the evt_thresh to any uint16_t value.
For example, when I set evt_thresh to 240, thing works fine. Increasing evt_thresh to 260 ( as in code below) gives me this error:
rmt: rmt_set_tx_thr_intr_en(380): RMT EVT THRESH ERR
Any ideas on how I send a larger value to evt_thresh?
Code: Select all
num_items = 2;
items = calloc(num_items, sizeof(*items));
items[0].duration0 = 3;
items[0].level0 = 1;
items[0].duration1 = 3;
items[0].level1 = 0;
// terminate sequence with a zero-duration item
items[1].duration0 = 0;
items[1].level0 = 0;
config.rmt_mode = RMT_MODE_TX;
config.channel = RMT_TX_CHANNEL;
config.gpio_num = RMT_TX_GPIO;
config.mem_block_num = 8;
config.tx_config.loop_en = true;
config.tx_config.carrier_en = false;
config.tx_config.idle_output_en = true;
config.tx_config.idle_level = RMT_IDLE_LEVEL_LOW;
config.tx_config.carrier_level = RMT_CARRIER_LEVEL_HIGH;
config.clk_div = 200;
int pulses = 260;
rmt_fill_tx_items(RMT_TX_CHANNEL, (rmt_item32_t *)items, num_items, 0);
rmt_set_tx_thr_intr_en(RMT_TX_CHANNEL, true, pulses);
Progit.