Hi all,
I have been playing around with an on-screen simulation using the WS2812 component, but now want to move on to actual 'real-life' testing.
However, how can I tell which PIC device(s) will support the component (due to the extreme timing restrictions imposed by the WS2812 RGB leds)?
The simulation runs quite happily when I specify a PIC 16F877A clocked at 19,660,800 Hz, with the data line connected to PORT C.5 - but, does this mean that it will run equally as well on a 'real device' set up for the same speed?
Thanks in advance,
Bill
Which PIC devices support the WS2812 component?
Moderator: Benj
-
- Posts: 31
- Joined: Tue May 04, 2010 8:05 pm
- Has thanked: 5 times
- Been thanked: 10 times
- Contact:
Which PIC devices support the WS2812 component?
- Attachments
-
- Basic Line Single LED chase.fcfx
- (8.32 KiB) Downloaded 342 times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Which PIC devices support the WS2812 component?
Hi Bill,
I also changed the LED type from WS2811 to WS2812B (the LEDs I have here) in the LED_WS2811 component properties.
Testing on hardware using a 19.6608MHz crystal the 16F877A device does not seem fast enough to drive the LED timings. Only the first LED is switching on which is a common sign that the timings are not quite right. One way around this might be to try the 60 free days for the Pro version of the XC8 compiler and seeing if this makes a difference.
I would recommend at least a 16-bit PIC or an AVR device to reliably drive these LEDs, the ECIO40P16 or EB091 might be a good options for you and are known to work well. These should also give you more memory to be able to drive the 50 or more LEDs.
The 16F877A device doesn't have enough memory to allow you to compile the program for 50 LEDs. I have reduced the LED count from 50 to 4 and this is now compiling correctly. I only have 4 LEDs on my test board.The simulation runs quite happily when I specify a PIC 16F877A clocked at 19,660,800 Hz, with the data line connected to PORT C.5 - but, does this mean that it will run equally as well on a 'real device' set up for the same speed?
I also changed the LED type from WS2811 to WS2812B (the LEDs I have here) in the LED_WS2811 component properties.
Testing on hardware using a 19.6608MHz crystal the 16F877A device does not seem fast enough to drive the LED timings. Only the first LED is switching on which is a common sign that the timings are not quite right. One way around this might be to try the 60 free days for the Pro version of the XC8 compiler and seeing if this makes a difference.
I would recommend at least a 16-bit PIC or an AVR device to reliably drive these LEDs, the ECIO40P16 or EB091 might be a good options for you and are known to work well. These should also give you more memory to be able to drive the 50 or more LEDs.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Which PIC devices support the WS2812 component?
I did think 8-bit PICs were working but looking at the post here it seems not.
viewtopic.php?f=63&t=18033&hilit=WS2812#p76655
Pro compiler 60 day trial is worth a go but if you want a long term solution then I would suggest a faster device family e.g. the 16-bit PICs or an AVR/Arduino.
viewtopic.php?f=63&t=18033&hilit=WS2812#p76655
Pro compiler 60 day trial is worth a go but if you want a long term solution then I would suggest a faster device family e.g. the 16-bit PICs or an AVR/Arduino.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Which PIC devices support the WS2812 component?
I've been having another look at this and it seems the problem is not the bit timings to control the LEDs, these are ok. The problem is the space between the data bytes is too long.
Just looking now to see if I can find a way to optimise this on the PIC8 devices.
Just looking now to see if I can find a way to optimise this on the PIC8 devices.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Which PIC devices support the WS2812 component?
With a bit of tweaking I have a 48MHz PIC 8 working reliably.
Now to see if this can also work for a 16F1937 @ 32MHz and a 16F877A @ 20MHz.
Now to see if this can also work for a 16F1937 @ 32MHz and a 16F877A @ 20MHz.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Which PIC devices support the WS2812 component?
Right for an 8-bit PIC @ 48MHz to function first you need to use the updated component here which allows the inter byte timings to be reduced.
Simply copy the updated v7 component into your "Flowcode 7/Components" folder and restart Flowcode to load the changes.
For slower than 48MHz despite multiple attempts I haven't been able to get the code working using the Free XC8 compiler provided with Flowcode. The Pro version may work to allow slower devices but I haven't tried it so can't say for sure.
Simply copy the updated v7 component into your "Flowcode 7/Components" folder and restart Flowcode to load the changes.
For slower than 48MHz despite multiple attempts I haven't been able to get the code working using the Free XC8 compiler provided with Flowcode. The Pro version may work to allow slower devices but I haven't tried it so can't say for sure.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 31
- Joined: Tue May 04, 2010 8:05 pm
- Has thanked: 5 times
- Been thanked: 10 times
- Contact:
Re: Which PIC devices support the WS2812 component?
Hi Benj,
Thanks for your efforts.
However, I don't know if you have come across this information (and, if not, it would seem to be well worth the read, especially Part II):-
Courtesy of "Tim's Blog"
https://cpldcpu.com/2014/01/14/light_ws ... he-ws2812/
https://cpldcpu.com/2014/01/19/light_ws ... rary-v2-0/
EDIT:
This is another useful link
Courtesy of "Josh .COM"
https://wp.josh.com/2014/05/13/ws2812-n ... know-them/
Perhaps this approach could greatly simplify things, and guarantee operation on devices with much lower clock frequencies?
Cheers,
Bill
Thanks for your efforts.
However, I don't know if you have come across this information (and, if not, it would seem to be well worth the read, especially Part II):-
Courtesy of "Tim's Blog"
https://cpldcpu.com/2014/01/14/light_ws ... he-ws2812/
https://cpldcpu.com/2014/01/19/light_ws ... rary-v2-0/
EDIT:
This is another useful link
Courtesy of "Josh .COM"
https://wp.josh.com/2014/05/13/ws2812-n ... know-them/
Perhaps this approach could greatly simplify things, and guarantee operation on devices with much lower clock frequencies?
Cheers,
Bill
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Which PIC devices support the WS2812 component?
Thanks Bill,
However I'm already following one of those simplification guides.
However I'm already following one of those simplification guides.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 31
- Joined: Tue May 04, 2010 8:05 pm
- Has thanked: 5 times
- Been thanked: 10 times
- Contact:
Re: Which PIC devices support the WS2812 component?
Hi Benj,
Sorry about the long delay - I seem to have too many other irons in the fire!
OK - at least we are all using the same book - even if I am several chapters behind you
Cheers,
Bill
Sorry about the long delay - I seem to have too many other irons in the fire!
OK - at least we are all using the same book - even if I am several chapters behind you
Cheers,
Bill