Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial version of rmt driver (#1525)
* rmt driver initial version * supporting conti mode plus interrupts * using conitnous mode for sending more data * working continous mode * rmt driver cleanup after conti mode * initial version of rmt driver * adding a simple example * adding channel and block locks * modified of rmt interface for simpler/easier usage * adding header sentinels, split interface to common and additional settings * Fixes per code review + support for rx callback mode * renamed internal structures and enums, fixed formatting * cmake support for rmt * refactored tx-conti interrupts to function to make it more readable * added Tx and Rx examples * added license headers * minor updates per review * used struct access, renamed defines, corrected diagram
- Loading branch information
4e96bff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello - I must be lucky because I just started a project where this example would come in very handy. Only thing, I see that it is quite new. When I updated to version rc4, none of the rmt files were copied over. The "esp32-hal.h" file is missing the line #include "esp32-hal-rmt.h" and the "esp32-hal-rmt.h" file did not get copied. So, I assume I'm probably chiming in a bit early on this.
Anyway, I tried in vain to copy the files, but I only seemed to break things. I could use some help. I'm a 55 year old noob with lots of embedded experience, but not this level with the Arduino IDE where I need to try something this new. I can see that rc4 is active in my hardware\esp32 directory. Can you point me to the process for working with this pre-release code?
Thanks,
Mike.
4e96bff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay. I went through the process for setting up the development repository for the Arduino IDE. I realized I needed to delete the board using board manager to get it to use the board from the Arduino Sketch folder. It works great!
I was able to easily modify the project to use the RGBW 32-bit data format.
The first bit sent is always a zero sequence. I changed line 65 from:
if ( (color[col] & (1<<(8-bit))) && (led == led_index) ) {
to
if ( (color[col] & (1<<(7-bit))) && (led == led_index) ) {
to fix this.
Using my scope I can count the positive pulse edges and there are 1024 of them. This is correct for 32-bits to 32 LEDs.
The timing is amazingly steady and correct 1.2uS periods.
The BEST news is that I put a set output and clear output before and after the rmtWrite() instruction and it takes only 15.5uS to set things in motion. Then the CPU can be fully utilized for other tasks while the hardware sends the pixel data. This is why I was looking into using the remote peripheral to drive Neopixels.
4e96bff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess I need to learn how to contribute to this project now.
I added one more bit to NR_OF_ALL_BITS to add the 80uS reset pulse.
#define NR_OF_ALL_BITS 24*NR_OF_LEDS + 1
I inserted this code at line 80 to tack on the reset bit and not rely on the delay alone to cause a minimum reset time.
Who do I need to thank for all this great effort?
4e96bff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did something similar for the reset but I put it at the front of the bits to sent out to the pixels.
4e96bff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tedhenry100 - that is smart to put it at the beginning. Thanks for the tip.