WS2811 and WS2812 One-Wire Communication Assembly Help


Closed Thread
Results 1 to 25 of 25

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,656


    Did you find this post helpful? Yes | No

    Default Re: WS2811 and WS2812 One-Wire Communication Assembly Help

    this may help
    Warning I'm not a teacher

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,146


    Did you find this post helpful? Yes | No

    Default Re: WS2811 and WS2812 One-Wire Communication Assembly Help

    Hi Richard.

    Thanks for the link. The real help was ... the color of the cables. On my strip the ground is Blue and +5V is Black. Really! They made +5V Black!

    Of course I used Black as ground and that was the problem.

    Be careful if color is not red then,

    Black is +5, NOT ground.
    Blue is Ground.

    Chinese people might have a different color preferences...

    I had it working now. Almost got crazy, since logic analyzer was showing all was OK!

    This type of LED's is more easy to control since they do not need strict timings. Just spit out at whatever pace you like or can and LED's follow. Very easy for any MCU.

    People have reported driving SPI up to 60MHz on these strips.

    Ioannis

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,146


    Did you find this post helpful? Yes | No

    Default Re: WS2811 and WS2812 One-Wire Communication Assembly Help

    The following is a simple test program to demonstrate how to use of APA-102 leds.

    It lights the Blue led and shifts it ten places in 100ms interval.

    To successfully manage this, tens of hours were spent... Datasheet sucks.

    But in general is much easier to control as the timings are those of an SPI interface and can be really fast driven if you have the resources.

    Code:
    arraywrite red_a,[0,0,0,0,0,0,0,0,0,0,0]
    arraywrite green_a,[0,0,0,0,0,0,0,0,0,0,0]
    arraywrite blue_a,[255,0,0,0,0,0,0,0,0,0,0]
    
    gosub display_led
    
    stop
    
    display_led:
        for k=0 to led_num
            for i=0 to led_num
                shiftout led_data,led_clock,1,[lum,blue_a[i],green_a[i],red_a[i]]
            next i
        gosub shift_sub
        next k
        pause 1000 'delay from one color to another
    return
    
    shift_sub:
        shiftout led_data,led_clock,1,[%11100011,0,0,0,0,0] 'END of Frame
        pause 100'led move step delay
        temp=red_a[k]:RED_A[k]=RED_A[k+1]:RED_A[k+1]=temp
        temp=green_a[k]:green_a[k]=green_a[k+1]:green_a[k+1]=temp
        temp=blue_a[k]:blue_a[k]=blue_a[k+1]:blue_a[k+1]=temp
    return
    Ioannis

  4. #4
    Join Date
    May 2013
    Location
    australia
    Posts
    2,656


    Did you find this post helpful? Yes | No

    Smile Re: WS2811 and WS2812 One-Wire Communication Assembly Help

    But in general is much easier to control as the timings are those of an SPI interface and can be really fast driven if you have the resources.
    I had 3 in the parts bin , so I had a go using mssp module . @64mhz with the fastest spi clk its no problem at all .
    a complete 3 led frame is less than 80uS . heaps easier than ws2812
    Attached Files Attached Files
    Warning I'm not a teacher

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,146


    Did you find this post helpful? Yes | No

    Default Re: WS2811 and WS2812 One-Wire Communication Assembly Help

    Great job on the asm Richard.

    Though this kind of LED's are easier most people look after the WS28xx series.

    Ioannis

Similar Threads

  1. PIC to WS2812B / WS2811 IC
    By comwarrior in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 19th January 2018, 19:37
  2. ws2812 - pic12f1822
    By richard in forum Code Examples
    Replies: 0
    Last Post: - 12th January 2016, 09:52
  3. Assembly
    By Normnet in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 19th March 2007, 03:44
  4. How do you do this in Assembly
    By ice in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 10th May 2005, 06:47
  5. Assembly?
    By Dwayne in forum General
    Replies: 11
    Last Post: - 4th January 2004, 18:18

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts