RobG 1,892 Posted July 30, 2014 Share Posted July 30, 2014 WS2812 driver for Tiva (and Stellaris.) It uses hardware SPI and is non-blocking (you can run your code while updating WS2812.) 7/31 - updated demo code and fixed comments about timing main.cstartup_ccs.c spirilis 1 Quote Link to post Share on other sites
L.R.A 78 Posted August 7, 2014 Share Posted August 7, 2014 Hi Rob! Could you please explain what is the "SSI2_DR_R" in your code? can't find it anywhere in source files or the datasheet Quote Link to post Share on other sites
RobG 1,892 Posted August 7, 2014 Author Share Posted August 7, 2014 It's SSI Data register (SSIDR.) See the header file. Quote Link to post Share on other sites
L.R.A 78 Posted August 8, 2014 Share Posted August 8, 2014 thanks, found it. Your coding is too advanced for me . I made a code, that can't have code runing while updating, so i decided to check if there was anytigh in here. Now the seniors decided that i have to use addresseble led strips only so TLC5940 work down the drain for my project :/ I find the WS2812 slow compared to the WS2801 but i'm going to implement the quad-SSI with the 4 modules at the same time if needed. Alredy have it "working", only need to organize the data so it works with the quad-ssi (simple enough). Right now i got 34uS update time per LED vs the 30uS theorical, seems pretty good. Look, pretty lights: teste_ws2812v1_1_clean.zip Quote Link to post Share on other sites
Remixed123 13 Posted August 13, 2014 Share Posted August 13, 2014 Hi L.R.A It looks like the zip file you uploaded is damaged and will not unzip Remixed. Quote Link to post Share on other sites
L.R.A 78 Posted August 14, 2014 Share Posted August 14, 2014 Are you glen from E2E? I am Luis Afonso sorry is it? it's actualy a rar file but i simply changed the extension to zip (the forum doesn't alow rar) try chaging it back to rar, but here is another one, remember it's for tm4c1294 teste_ws2812v1_1_clean.zip Also, i've been sucesseful on using the DMA to control up to 16 paralel outputs. It's possible to expand to 32 ports. It uses 3 bytes per 8 paralel bits. I think i have a solution for the smal DMA counter of 10bits, and i hope i will find a solution to use less RAM. Also this uses Basic transfer istead of ping pong like Amit sugested Quote Link to post Share on other sites
MaxBlitz 0 Posted January 28, 2015 Share Posted January 28, 2015 Hi! Great coding, sir! Any chance this can run on cc3200? With the current program it doesnt work, cause it cant find "inc/hw_ssi.h". Can you just say if its possible to use it with some alterations on the cc3200, or do i need to make something like this from scratch? Quote Link to post Share on other sites
RobG 1,892 Posted February 1, 2015 Author Share Posted February 1, 2015 I don't have time to port it to CC3200 right now, but it should be fairly easy. Quote Link to post Share on other sites
MaxBlitz 0 Posted February 5, 2015 Share Posted February 5, 2015 I made a running program / library on CC3200 for WS 2812b now. Still optimizing but it runs well already with 1280 pixels. RobG 1 Quote Link to post Share on other sites
futuretec 0 Posted February 9, 2015 Share Posted February 9, 2015 I made a running program / library on CC3200 for WS 2812b now. Still optimizing but it runs well already with 1280 pixels. Hey MaxBlitz, are you willing to share your library for the CC3200? Would love to try this on this device. Unfortunately I didn't succeed to get the libraries for the TM4C1294NCPDT to run. Thanks for your information and maybe an upload of the project files ;-) Quote Link to post Share on other sites
Cyberian 0 Posted July 10, 2016 Share Posted July 10, 2016 Hi, excellent, the code work for my. I configure the spi frequenci to 6.4 Mhz, then 0=11100000 and 1=11111000. A question, can you explain to me this code fragment?, Thanks!!! rgbDataCounter--; uint8_t byte = *rgbDataPointer++; txData_0 = lookupTable[byte & 0x03]; byte >>= 2; txData_1 = lookupTable[byte & 0x03]; byte >>= 2; txData_2 = lookupTable[byte & 0x03]; byte >>= 2; ROM_SSIDataPut(SSI2_BASE, lookupTable[byte]); while(ROM_SSIBusy(SSI2_BASE)){}; ROM_SSIDataPut(SSI2_BASE, txData_2); while(ROM_SSIBusy(SSI2_BASE)){}; ROM_SSIDataPut(SSI2_BASE, txData_1); while(ROM_SSIBusy(SSI2_BASE)){}; ROM_SSIDataPut(SSI2_BASE, txData_0); while(ROM_SSIBusy(SSI2_BASE)){}; WS2812B.pdf Quote Link to post Share on other sites
binbsoffn 0 Posted May 8, 2018 Share Posted May 8, 2018 Hi, can i revive this thread after such a long time? I'm wondering why you are using the SPI Module and not a timer module? Is there any advantage using SPI to using a Timer with something like PWM? Quote Link to post Share on other sites
Fmilburn 446 Posted May 8, 2018 Share Posted May 8, 2018 @binbsoffn have a close look at how the SPI approach works: It is simple, elegant, and quite precise with minimal processor cycles It even wotks with Energia. Now try it with timers... You will need to switch back and forth on timer settings during output. Can you make it work? 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.