Jump to content
43oh

MSP430 how to make WS2811Driver reduce from 800 kHz to 400 kHz link inside


Recommended Posts

personally I use the SPI method exclusively for the smart LEDs  (WS2812B, and sk6812 recently)  one trick for getting the timing to cooperate is to set the SPI divider to get you close then you can change the rate of the MCLK registers to fine tune the timing.  it only has to be changed while the SPI is transmitting so you can change the clock back to normal "speed" after your done with the transmission.

Link to post
Share on other sites

So I liked your idea JWoodrell, I made a little class to let me tweak on the fly without much effort:
 

class tweak_clk {
  int plus_;
public:
  tweak_clk(int plus) : plus_(plus) {
    DCOCTL += plus_;
  }

  ~tweak_clk(void) {
    DCOCTL -= plus_;
  }
};


... to use it ..

void foo(void) {
 ... code running at normal speed
 {
 tweak_clk turbo_20(0x20); // constructor called here
 ... run some more code at faster speed
 }
 .. // destructor called when we left that code block
 .. all code here is normal speed again

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...