m0nk37 0 Posted November 30, 2016 Share Posted November 30, 2016 Hello everyone, I am hoping someone can help point me in the right direction for what i am trying to accomplish. Previously i have used an Arduino Uno to control my WS2811 LED strip using AdaFruit's NeoPixel without much hassle but now i need to setup an MSP432 to do the same and its turning into a headache. Could someone point me in the right direction to take to be able to control a WS2811 LED strip from an MSP432? Whether it be examples, or SPI libraries i should start from, anything will help at this point. Thanks for reading. Quote Link to post Share on other sites
Fmilburn 446 Posted November 30, 2016 Share Posted November 30, 2016 Hi @@m0nk37, I am not aware of a WS2811/12 library for the MSP432. I presume you have already done a search on 43oh and have seen the working code and discussion for the MSP430 and Tiva. The two approaches commonly used to achieve the timing requirements are asm and SPI. SPI was used in the Tiva example and would seem to be the easiest approach for the MSP432. You can find my writeup on using SPI with the MSP430 here: http://forum.43oh.com/topic/10011-using-spi-and-energia-with-ws2812-leds/ I had a quick look at using SPI with the MSP432 at the time I made that post. Energia for the MSP432 uses TI-RTOS and I seemed to be getting interrupts that interfered with the timing. There may be ways around this but I didn't pursue it. I would think this would be straight forward outside of Energia/RTOS but haven't tried that either. bluehash and m0nk37 2 Quote Link to post Share on other sites
m0nk37 0 Posted November 30, 2016 Author Share Posted November 30, 2016 Thanks for the reply @@Fmilburn I have searched everywhere and tried all sorts of things and started to doubt my sanity after everything failed lol. I have found drivers and such for the MSP430 that seem to work (untested by me, others say it works) but its incompatible with the MSP432. Would you be able to recommend a different board for controlling LED Strips (WS2811/12, UCS1903, similar types) since the MSP432 seems so troublesome? I will need WIFI capability with it.. Quote Link to post Share on other sites
m0nk37 0 Posted November 30, 2016 Author Share Posted November 30, 2016 Also, not sure why this happens but i ended up being careless, something odd happened... I have a strip of 20 pixels. They get there power externally from a 5v source. They are wired to have a single line, data in through a resistor. If i build any project from CCS 6, then stick that data line into the TCK (1.1) pin slot, the first half of LEDs light up in random colors full spectrum. The other half are just white. Any idea why? At first they change color rapidly. After a few seconds, they slow down to a 1 second delay and hit up all of the colors randomly. Quote Link to post Share on other sites
Fmilburn 446 Posted December 1, 2016 Share Posted December 1, 2016 Any idea why? At first they change color rapidly. After a few seconds, they slow down to a 1 second delay and hit up all of the colors randomly. I would only be guessing. But if the LEDs get something they don't understand they do strange things. I saw something similar when I was experimenting and adjusting timing to get inside the tolerances. Hopefully you didn't apply 5V to the microcontroller - don't think the MSP432 is 5V tolerant. On my projects I have run the microcontroller and the WS2811s on battery power at 3V without a problem. Would you be able to recommend a different board for controlling LED Strips (WS2811/12, UCS1903, similar types) since the MSP432 seems so troublesome? I will need WIFI capability with it.. Most of the WiFi experimentation I have done was with a MSP430F5529 and CC3100 BoosterPack with Energia. The F5529 is used with WS2811s in the link I gave above, so I would probably start there. I would get the LEDs working the way I wanted with the F5529 and then add the CC3100. As a fallback, most of the projects I've done with the WS2811/12 were on the MSP430G2553 and there is a good library for it here on 43oh. The LEDs could be controlled with a G2553 that was receiving commands from a F5529/CC3100. Or could use a CC3200, Raspberry Pi or other WiFi capable device to control something like a G2553. m0nk37 1 Quote Link to post Share on other sites
m0nk37 0 Posted December 1, 2016 Author Share Posted December 1, 2016 Hopefully you didn't apply 5V to the microcontroller - don't think the MSP432 is 5V tolerant. No worries, the MC is fine . I found it strange that the lights were functioning ... seemingly normal - sobeit in random colors so thought i would ask. The cable i attached to the TCK pin was only the data in line, and it is sent through a resistor. The power is separated completely in my LED strip wiring. I have to thank you for your help @@Fmilburn, you have been most helpful! Ill give what you mentioned a shot and see where it leads me. Thanks again. Quote Link to post Share on other sites
NurseBob 111 Posted December 3, 2016 Share Posted December 3, 2016 The cable i attached to the TCK pin was only the data in line, and it is sent through a resistor. This may be obvious, but just in case, an inline resistor has very little effect on the voltage. So, 5V in = 5V out, with the current throttled... Bob Quote Link to post Share on other sites
m0nk37 0 Posted December 3, 2016 Author Share Posted December 3, 2016 I dont think i fried it, i can run a an example Sketch to make the LED slowly fade just fine as a quick test. How can i tell if i did fry it? Im worried now, lol. Quote Link to post Share on other sites
Fmilburn 446 Posted December 4, 2016 Share Posted December 4, 2016 I don't know if what you described would damage it or not but the safe thing to do would be to run the microcontroller and LEDs at the same safe voltage (I have run them at 3V even though that is below what the WS28xx datasheet shows if I remember right) or to use logic level conversion if you want to supply 5V to the LED. Regarding testing for damage, it would most likely be the pin that receives the high voltage. Keep the incident in the back of your mind though and if you see strange behavior with that LaunchPad in future, especially with that pin, you won't pull your hair out thinking it is software or something else. Quote Link to post Share on other sites
LiviuM 43 Posted December 4, 2016 Share Posted December 4, 2016 Hi Bob, So, 5V in = 5V out, with the current throttled... If there it is a current flowing through the resistor (to be throttled), then Vin != Vout (Vin = Vout + I*R). A resistor (+ the ESD protection diode) can be seen as the simplest "level adapting" structure, if the resistor is large enough to keep the current in the Pin's specification. As for the actual case, with a 3.3V output driving a 5V CMOS input, as the input is practically floating, I don't see any reason for a damage to the output. In the worst case, the 3.3V wouldn't be enough to switch the input, if it is a Schmitt trigger input, for example (the most Schmitt triggers I know have VIH = 0.7*VDD => VIH = 3.5V @VDD = 5V). My 2 (euro) cents, of course. Best regards, Liviu NurseBob and chicken 2 Quote Link to post Share on other sites
NurseBob 111 Posted December 5, 2016 Share Posted December 5, 2016 Liviu, You are absolutely correct, and I was sloppy. My concern was my interpretation that the OP was applying a 5V input to 430, and stating that a resistor (of unknown value) was in place, which implied to me that the OP believed that the resistor would drop the voltage sufficiently to protect the mcu. I've seen others with the misconception that the voltage drop across a resistor would be sufficient to protect the lower voltage device. After looking at the data sheet, it appears that the output voltage is not an issue, and the resistor is to prevent signal reflection. Thanks for the correction to my sloppy comment. Quote Link to post Share on other sites
JoeG 3 Posted January 4, 2018 Share Posted January 4, 2018 On 11/29/2016 at 8:50 PM, m0nk37 said: Could someone point me in the right direction to take to be able to control a WS2811 LED strip from an MSP432? Sorry being a newbie to 430oh.com if this is a no-no posting to old threads. But did get the Neopixel Library working with an MSP432 Launchpad (some tweaking of the Cortex-Mx assembly required. Much thanks to the WS2811 driver mentioned here: Only problem is I am not the greatest C++ programmer and had to hardcode the GPIO somewhat in Adafruit_NeoPixel.cpp : //jg 12/5/17 P1.0 is pin 78. 0x40004C02 YELLOW_LED //jg 12/5/17 P2.0 is pin 75. 0x40004C03 RED_LED //jg 1/3/18 P3.0 is pin 18. 0x40004C03 - Gets Neopixel off LED jumper on MSP432 LP But hooks are in Adafruit_NeoPixel.cpp if someone knows PIN_TO_BASEREG array from \Energia15\packages\energia\hardware\msp432\3.8.0\system\driverlib\MSP432P4xx\gpio.c Please see attached 3 files (hopefully all you need to test. The Adafruit_NeoPixel.h file has a very minimal but key change ) and let me know if it works for you. Adafruit_NeoPixel.cpp Adafruit_NeoPixel.h strandtest_joe.ino bluehash, Shuyang and Fmilburn 2 1 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.