Wireless WS2811 Pix...
 
Notifications
Clear all

Wireless WS2811 Pixel Controller Project

16 Posts
8 Users
0 Reactions
8,467 Views
Posts: 130
(@charleskerr)
Estimable Member
Joined: 16 years ago

is there any chance the source for this might get posted? The approach sounds intriguing, and I would love to understand how it all works and get insight into different approaches of solving problems.


Reply
Posts: 6728
Topic starter
(@p-short)
Illustrious Member
Joined: 20 years ago

I'm not really willing to post source, but I am willing to discuss the approaches that I've taken.

Which aspects are you interested in?


Reply
Posts: 130
(@charleskerr)
Estimable Member
Joined: 16 years ago

How you gated the PWM to make the bit string. It would seem that one would need to adjust it for each bit (for a high/low) so not sure how it is gated to the other PWM. And was curious about the timing gap between each bit.


Reply
Posts: 6728
Topic starter
(@p-short)
Illustrious Member
Joined: 20 years ago

It's a bit complicated to explain.

First, there are two synchronized 800 Khz clocks generated from two of the CCP modules (both CCP modules are controlled by Timer2). One of these clocks has a 2:10 duty cycle, and the other has an 8:10 duty cycle.

Second, the USART in the PIC16F1704 is configured in synchronous, slave mode. The output, though, does not go directly to an output pin on the PIC (except maybe for debug purposes). Instead, it goes into one of the Configurable Logic Cell (CLC) modules inside the PIC, and the output of that CLC is what drives the output pin. That CLC is where the waveform for the WS2811 is generated, basically the USART TxD signal is used to select between the 2:10 and a 8:10 duty-cycle signals (for the '0' and '1' waveforms, respectively).

Another CLC is used to generate the transmit clock of the USART (as well as a clock-gate for Timer1). The inputs to this CLC are the 8:10 duty cycle clock, was well as the overflow output from timer2. This output is gated off when Timer1 overflows, and is used to ensure a clean turn-off for the output waveform to the WS2811. In order for this to work, Timer1 has to be programmed for 64*byte_count (8 clocks per bit, 8 bits per byte) (actually, the negation of this value, as the timer can only count up).

Since the pixel waveforms and timing are all controlled by hardware (the CCP (PWM) modules, the Configurable Logic Cells (CLC), TImer1 and the USART), the transmissions can be handled by simple, short interrupt routines. Microchip has an appnote showing another method of using the CLC modules to generate WS2811 waveforms using the SPI (or MSSP) module instead of the USART for transmission. That wouldn't work for me, though, because the SPI module in my application was used for accessing the nRF24L01 module.

The third CLC is used to generate an intermediate output, which I needed to do because there can only be four inputs to each of the CLCs.


Reply
Posts: 130
(@charleskerr)
Estimable Member
Joined: 16 years ago

Thanks for the explanation! That gives me a lot to think about and new ideas!


Reply
Page 3 / 4
Share: