RobG 1,892 Posted July 19, 2013 Share Posted July 19, 2013 WS2811 has 2 speeds of operation, 400kHz and 800kHz. However, 5050/WS2811 or WS2812, is set to work at high speed only. Also, WS2811 does not use SPI protocol. SPI hardware is used to output 1 wire protocol required by WS2811. Quote Link to post Share on other sites
oPossum 1,083 Posted July 20, 2013 Author Share Posted July 20, 2013 To use the high speed protocol just change write_ws2811() to write_ws2811_hs(). That will give you the most precise timing possible and allow use of any pin on port 1. SPI/IIC remains free for other uses. Here is some code for RTC: http://forum.43oh.com/topic/1957-software-real-time-clock-rtc-two-methods/ The 32 kHz crystal is used just for the RTC - the MSP430 can still run at 16 MHz. GeekDoc 1 Quote Link to post Share on other sites
Adi 0 Posted March 4, 2014 Share Posted March 4, 2014 This library is awesome. I'm trying to integrate it into my existing firmware. My MSP430G2553 is running at DCO 1MHz.. How can I adjust the timings, or any other trick to make this code calculated for 16MHz cycle run on my existing firmware (@1MHz) ? Quote Link to post Share on other sites
RobG 1,892 Posted March 4, 2014 Share Posted March 4, 2014 You cannot, 1MHz is too slow for WS2811. Adi 1 Quote Link to post Share on other sites
Adi 0 Posted March 9, 2014 Share Posted March 9, 2014 Thank you for responding RobG. I'm still trying to avoid bit banging assembly and use timer interrupts to generate PWM with 20% & 50% duty cycle for 0 & 1 respectively. If you have tried already, can you suggest if it's possible with WS2811 ? I read your very first question in this forum and OPossum thinks it's duty cycle that chip looks for. I wonder if you did any further discovery into it ? Yes, I changed my MCLK to run at 8MHz now (& may further update it to 16 MHz). With that, I can have width of 0 bit pulse to like 25 uS. Roughly running at 20 kHz frequency. Datasheet mentioned only about 400 & 800kHz, but can it run at 10 ~ 20 kHz as well ? Eagerly looking forward for your answer. Thanks, Quote Link to post Share on other sites
RobG 1,892 Posted March 10, 2014 Share Posted March 10, 2014 In my code, I don't use assembly, C only. I use bit banging or hardware SPI module. WS2811 requires very precise timing and using interrupts is not an option (11 clock cycles just to get in and out of the interrupt.) Your MCU has to run @16MHz to meet WS2811's timing requirements, especially WS2812's, which is hardwired for 800kHz clock. Adi 1 Quote Link to post Share on other sites
Adi 0 Posted March 10, 2014 Share Posted March 10, 2014 Also, your shared code would greatly help. I see you have used pin 1.2 on msp430g2553, set as SPI master. Can I use any other pin on the board ? like 1.7 ? I already have another board communicating over UART using pin 1.2. I wonder, how well can I sync both UART & SPI on same controller, especially with tight timing for WS2811. I imagine, I will have to go really low on FPS, about 20 fps with limited number of LEDs, like a strip of 30 and manage my UART activities only during reset pulse time on LED chip. Correct me if I'm wrong. Quote Link to post Share on other sites
RobG 1,892 Posted March 10, 2014 Share Posted March 10, 2014 You can use P1.7 by simply changing all UCAxxx configurations to UCBxxx, see here or here Adi 1 Quote Link to post Share on other sites
vinoth 0 Posted May 20, 2014 Share Posted May 20, 2014 how to program ws2811 using msp4302253 to passage of Red and while and how to set timing to change Quote Link to post Share on other sites
Lode 2 Posted February 4, 2016 Share Posted February 4, 2016 Just what I was looking for nice and simple ws281x call. Anyway to pass the &PxOUT as variable to assembly? Adding it to the prototype is easy enough, but I can figure out the asm. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.