WS2811 protocol on MCU in C/C++

Job ID: 36413952

Budget: $30 – $250 USD

I'm looking for a freelancer to help me with a project requiring WS2811 protocol implementation on an MCU in C/C++. The MCU platform I'm interested in is either the Nyquest NY8A054E, Padauk PMS171B-S14, or HolyChip HC18P110B0-SOP14-T. I would like for the freelancer to program in C and the data transmission rate should be 800kbps. The objective of this project is to get the WS2811 protocol running on the chosen MCU platform, allowing for reliable data transmission to and from external peripherals. I'm seeking an experienced freelancer who is knowledgeable in C/C++ programming for embedded systems and is familiar with either the WS2811 protocol or timer input capture and output compare hardware.

Datasheets for the WS2811 IC (which describe the protocol in detail) and the three suggested MCUs are attached. Some datasheets are only available in Chinese, I use Google Lens to read those. I would consider a similar low-cost MCU; 500-piece pricing on these 3 is: $0.0648, $0.0705, and $0.0999.

Deliverables: Freely usable (no restrictive license) C/C++ source code, .bin/.hex/etc. binary, logic analyzer or scope trace of successful WS2811 protocol forwarding, debugger or serial monitor output showing decode of input data and substitution of output data. gcc compiler or arduino IDE preferred, but willing to discuss others.

* The input pin must use timer input capture interrupts, and the output must use timer output compare for accurate timing.
* MCU shall use internal clock.
* If a valid WS2811 protocol waveform containing at least 3 bits is detected at the input pin, the frequency shall be compared to what the MCU believes is 800kHz. if the input frequency is more than 600kHz and less than 1000kHz, the MCU shall adjust its output waveform to match the frequency of the input waveform, while maintaining the relative timings of the WS2811 protocol.
* Interrupts shall provide a flag for use in the main loop, indicating the current transmission state (IDLE, FIRST_BITS, LAST_BITS, or ACTIVE). The FIRST_BITS state shall be set when at least one and less than 3 valid WS2811 protocol bits have been detected, and a stub function shall be called. The LAST_BITS state shall be set when a full bit time passes on the input with no transitions.
* An internal shift register of variable length (e.g. #define SHIFT_REGISTER_BITS 24) shall contain bits being received/transmitted. A stub function shall be called at the time that the LAST_BITS condition is detected. Note that the actual data structure must contain 3 extra bits to allow for the delay between data in and data out.
* The output waveform shall begin transmitting when the transmission state changes from FIRST_BITS to ACTIVE, immediately after the transmission speed is adjusted.
* PWM pins and ADC pins should not be selected for data in and data out pins if other options are available.

stub function prototypes:

void first_bits(void *data_shift_register)
{
// Does nothing yet.
}

void last_bits(void *data_shift_register)
{
// Does nothing yet.
}