LEDC (LED Controller) is a highly efficient embedded solution that supports the control of smart LED lights (such as WS2812B) and is compatible with the DSHOT protocol to drive brushless motors.
By adjusting the TxH_CNT and TxL_CNT parameters in the register, you can flexibly set the clock cycle number for the high and low levels of Code 0 and Code 1.
Taking WS2812B LED as an example, it uses the single-wire non-return-to-zero (NRZ) communication protocol and adopts a cascade method for data transmission:
Power-on reset: After power-on, the LED receives data from the controller through the DI port. The first LED will capture and latch the first 24-bit data.
Data passing: The remaining data is transmitted to the next LED through the internal reshaping circuit from the DO port.
Signal decrement: With each LED, the signal will be reduced by 24 bits of data.
LEDC Transmission Timing
The data timing sent by LEDC to the first LED is as follows: