NeoPixel Library and the chipKIT Pi

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
hopworks
 
Posts: 32
Joined: Fri Jul 06, 2012 5:50 pm

NeoPixel Library and the chipKIT Pi

Post by hopworks »

Has anyone used the NeoPixel Library with the chipKIT Pi? I have a strip of 60 WS2812's and I want to use the chipKIT Pi programmed with the custom MPIDE written for Linux that runs on my Raspberry Pi. If I can get that working, I want to use a lot of the NeoPixels for various projects using the chipKIT Pi where needed, as a stand alone.

If someone has controlled the WS2812 with a chipKIT Pi, and didn't use this library, I would love to know what you used.

Thank you so much for your time! It's cool that these WS2812's can be bought separately! They would make great status indicators!

Hop

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: NeoPixel Library and the chipKIT Pi

Post by adafruit_support_bill »

Getting them to work from a Linux machine is going to be a challenge. You will probably need to do some kernel level work to achieve the timing precision needed to drive these chips.

User avatar
pburgess
 
Posts: 4161
Joined: Sun Oct 26, 2008 2:29 am

Re: NeoPixel Library and the chipKIT Pi

Post by pburgess »

I wasn't familiar with the chipKIT Pi, had to go look it up. That's an interesting beast.

The good news is that this could work; the PIC32 should be capable of driving the deterministic timing required for NeoPixels, whereas the Pi alone can't.

Bad news is that the NeoPixel library for Arduino has no PIC32 support. This is an unfamiliar chip with all different funky registers and would be a pretty major porting effort. For me, anyway.

So...I haven't gone looking, but given the popularity of these LEDs and Microchip's MCUs, I'd be very surprised if someone hasn't written some sort of PIC32 library. Searching the chipKIT and Microchip forums might be a good start. Try looking for "WS2811", "WS2812" or "WS2812B" in addition to "NeoPixel" -- those are the generic names for different versions of the LED drivers used in various generations of NeoPixel products.

Or if you're pretty knowledgable about PIC32 internals, you could try adapting the Arduino code yourself. We accept pull requests on GitHub!

User avatar
hopworks
 
Posts: 32
Joined: Fri Jul 06, 2012 5:50 pm

Re: NeoPixel Library and the chipKIT Pi

Post by hopworks »

adafruit_support_bill wrote:Getting them to work from a Linux machine is going to be a challenge. You will probably need to do some kernel level work to achieve the timing precision needed to drive these chips.
The chipKIT Pi has a Arduino form factor. The RPi is used to program it, that's all. They can talk to each other if I were to want to make shield accessories for my RPi, but I don't. At least not now. MPIDE MultiPlatform Arduino compatible IDE, Arduino 0023 Compatibility comes with a customized Rasbian Debian distro for the Raspberry Pi.

I was asking if the NeoPixel library will work with arduino uno compatible chipKIT Pi. Every sketch I have tried so far works just fine. Only difference I see thus far is the 3.3v versus 5v. I'll use a mc74act125n to level shift the SPI data signal so the ws2811 can understand it. That's neither here nor there though if the aforementioned library does some hardware things unique to an original Arduino, which is why I posted the question.

User avatar
hopworks
 
Posts: 32
Joined: Fri Jul 06, 2012 5:50 pm

Re: NeoPixel Library and the chipKIT Pi

Post by hopworks »

pburgess wrote:I wasn't familiar with the chipKIT Pi, had to go look it up. That's an interesting beast.

The good news is that this could work; the PIC32 should be capable of driving the deterministic timing required for NeoPixels, whereas the Pi alone can't.

Bad news is that the NeoPixel library for Arduino has no PIC32 support. This is an unfamiliar chip with all different funky registers and would be a pretty major porting effort. For me, anyway.

So...I haven't gone looking, but given the popularity of these LEDs and Microchip's MCUs, I'd be very surprised if someone hasn't written some sort of PIC32 library. Searching the chipKIT and Microchip forums might be a good start. Try looking for "WS2811", "WS2812" or "WS2812B" in addition to "NeoPixel" -- those are the generic names for different versions of the LED drivers used in various generations of NeoPixel products.

Or if you're pretty knowledgable about PIC32 internals, you could try adapting the Arduino code yourself. We accept pull requests on GitHub!
Thank you sir! I may just do that, or have to do that. :shock: I haven't been able to find anything yet for my hardware, but I will keep looking. What I really need is a scope, like the Rigol ds1052e I have been looking at. Right now, I'll just have to make sure I am correct with the math and the settings. So many things can go wrong though, without proven working code, I'll have to guess at what is wrong.

Thanks for taking the time to read my post and reply! I appreciate it!

User avatar
dar kale
 
Posts: 44
Joined: Thu Feb 13, 2014 10:23 pm

Re: NeoPixel Library and the chipKIT Pi

Post by dar kale »

This thread is a bit old now but I just saw it for the first time.

I had code running for the WS2811/2812 device on a PIC16F1783 @ 20MHz. The pertinent driving routine looks like this:

Code: Select all

        
if led_data.7 then
            lata.1 = 1
            nop
            nop            ' two nops = 620ns
            lata.1 = 0
            nop
            nop
        else
            lata.1 = 1
            nop
            lata.1 = 0
            nop
            nop
            nop
        end if
This was repeated in-line for all 8 bits of the byte to send. It's written in mikroBasic and the code translates pretty much line for line into assembly so you get what you see. The timing seemed to work ok.

The rest of the code modulates pwm values for red, green and blue in slowly changing sine waves, each at some different frequency so the effect is slowly shifting colors.

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”