Thank you, it is better now, I tested 15 minutes without any error on real device.ok-home wrote: ↑Mon Dec 02, 2024 12:50 pmtry
https://github.com/ok-home/hbs_rmt_ser ... al.c#L121
and
#define RMT_RX_IDLE_THRES (5000) // from 2400 to 10000
(Solved) RMT driver for software UART with 22 bit data possible?
Re: RMT driver for software UART with 22 bit data possible?
Re: RMT driver for software UART with 22 bit data possible?
I have other problem, I have 2 test device with ESP32 1 with ESP32C3, 1. ESP32 work, but 1 esp32 crash all the time with:ok-home wrote: ↑Mon Dec 02, 2024 12:50 pmtry
https://github.com/ok-home/hbs_rmt_ser ... al.c#L121
and
#define RMT_RX_IDLE_THRES (5000) // from 2400 to 10000
Code: Select all
assert failed: prvReturnItemDefault ringbuf.c:623
And ESP32C3 crash when flash, it show error:
Code: Select all
CONFLICT! driver_ng is not allowed to be used with the legacy driver
I try to migrate to new RMT driver base from your code, but it could not send the data.
The code send the data like this:
Code: Select all
rmt_transmit_config_t tx_config = {
.loop_count = 0,
};
// Use null encode to send raw symbols
rmt_copy_encoder_config_t config = {};
rmt_encoder_handle_t encoder = NULL;
rmt_new_copy_encoder(&config, &encoder);
// symbols generate like your code replace rmt_item16_t *rmt_data with native rmt_symbol_word_t* items
rmt_transmit(tx_channel, encoder, items, item_count, &tx_config);
Re: RMT driver for software UART with 22 bit data possible?
Code: Select all
rmt_transmit(tx_channel, encoder, items, item_count, &tx_config);
Code: Select all
rmt_transmit(tx_channel, encoder, items, item_count * sizeof(rmt_symbol_word_t), &tx_config);
--esp32c3 - total 4 channels (192*2) 48*2 = 96 bits - for tx/rx - 0 channel tx = 96 bits, 1 channel rx = 3*96 = 284 bits ( uses memory from 1 to 3 channels )
Re: RMT driver for software UART with 22 bit data possible?
Yes, it work, also I must set invert_out flag for TX config and invert the encode data like mention in: https://esp32.com/viewtopic.php?t=32727#p111412.ok-home wrote: ↑Tue Dec 03, 2024 1:06 amitem_count must be in bytesCode: Select all
rmt_transmit(tx_channel, encoder, items, item_count, &tx_config);
The transmitter on c3 will work, but the receiver is not sure. I'm not sure if ping/pong will work in the right time.Code: Select all
rmt_transmit(tx_channel, encoder, items, item_count * sizeof(rmt_symbol_word_t), &tx_config);
--esp32c3 - total 4 channels (192*2) 48*2 = 96 bits - for tx/rx - 0 channel tx = 96 bits, 1 channel rx = 3*96 = 284 bits ( uses memory from 1 to 3 channels )
But the data error much with setting in new driver like this:
Code: Select all
rmt_receive_config_t receive_config = {
.signal_range_min_ns = 1250, // the shortest duration for Homebus signal is 104us(1 bit), 1250ns < 104us, valid signal won't be treated as noise
.signal_range_max_ns = 27456000, // the longest duration for Homebus signal is 2288us (22 bits), 27456000ns > 2288us, the receive won't stop early
};
Code: Select all
// Define RX channel-specific configuration
rmt_rx_channel_config_t rmt_rx_config = {
.clk_src = RMT_CLK_SRC_APB, // Clock source (APB)
.resolution_hz = 80000000 / RMT_RX_DIV, // Resolution in Hz , RMT_RX_DIV = 40
.mem_block_symbols = rx_mem_block, // memory block size base on CPU
.gpio_num = rx_pin, // GPIO pin for RX
.flags = {
// .io_loop_back = false, // Disable loopback
.invert_in = false, // Don't invert the input signal
.with_dma = false, // do not need DMA backend
}};
Re: RMT driver for software UART with 22 bit data possible?
Never mind. I change the signal_range_max_ns = 22000000 and it working now.ok-home wrote: ↑Tue Dec 03, 2024 1:06 amitem_count must be in bytesCode: Select all
rmt_transmit(tx_channel, encoder, items, item_count, &tx_config);
The transmitter on c3 will work, but the receiver is not sure. I'm not sure if ping/pong will work in the right time.Code: Select all
rmt_transmit(tx_channel, encoder, items, item_count * sizeof(rmt_symbol_word_t), &tx_config);
--esp32c3 - total 4 channels (192*2) 48*2 = 96 bits - for tx/rx - 0 channel tx = 96 bits, 1 channel rx = 3*96 = 284 bits ( uses memory from 1 to 3 channels )
On the ESP32C3 I can only set maximum 64 symbols for 1 TX channel and 64 symbols for 1 RX channel but it still work fine with 528 bit signal. Thank you again for your help.
Who is online
Users browsing this forum: Majestic-12 [Bot] and 73 guests