During test with rmt_item32_t values greater than 32767 are not handled correct.
Using 50000 for example, in reality 17232 is used.
For me this looks like int16 is used instead of Uint32_t
Is this assumption correct ?
duration in rmt_item32_t Uint32 or int16 ?
Re: duration in rmt_item32_t Uint32 or int16 ?
I think the high level answer is neither 16 or 32 bit ...
With RMT, one defines the signal level (1 or 0) and a duration. This is encoded in a 16 bit value .... so we have 1 bit for the level and 15 bits for the duration. This gives us a maximum duration of 32767.
Each RMT "element" consists of one of these 16 bit values ... however, the ESP32 is a 32 bit device and really wants to move things around in units of 32 bits. As such, the data type known as rmt_item32_t contains TWO 16 bit elements. These are referred to as:
* item.level0
* item.duration0
* item.level1
* item.duration1
As such, you shouldn't treat an rmt_item32_t as a single element ... but rather a unit of 2 elements. And you should think of the maximum duration as being 15 bits and not 16 bits.
With RMT, one defines the signal level (1 or 0) and a duration. This is encoded in a 16 bit value .... so we have 1 bit for the level and 15 bits for the duration. This gives us a maximum duration of 32767.
Each RMT "element" consists of one of these 16 bit values ... however, the ESP32 is a 32 bit device and really wants to move things around in units of 32 bits. As such, the data type known as rmt_item32_t contains TWO 16 bit elements. These are referred to as:
* item.level0
* item.duration0
* item.level1
* item.duration1
As such, you shouldn't treat an rmt_item32_t as a single element ... but rather a unit of 2 elements. And you should think of the maximum duration as being 15 bits and not 16 bits.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
Who is online
Users browsing this forum: No registered users and 84 guests