WS2811 and WS2812 One-Wire Communication Assembly Help


Closed Thread
Results 1 to 25 of 25

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

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

    Yes, I understand what your goal is and want to try your code out. I have a 8x8 neopixel to run it on.

    I referenced the other thread for the op who said he wasn't great at assembly code.

    Thanks

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    2,645


    Did you find this post helpful? Yes | No

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

    Quote Originally Posted by mark_s View Post
    Yes, I understand what your goal is and want to try your code out. I have a 8x8 neopixel to run it on.

    I would love to hear how you get on
    Warning I'm not a teacher

  3. #3


    Did you find this post helpful? Yes | No

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

    Richard I gave the code in post #2 a try. I don't have a 12mhz crystal so I am having problems configuring 4550 for 48mhz internal osc. My test board has a 10mhz resonator. The usb pre-scale stuff is throwing me off. If you could help me with the configurations for internal osc 48mhz or 40mhz using the pll and the 10mhz resonator. I may have it set ok I'm getting the signal on portc.0

    Also as posted the code makes one pass and stops. Is this the way it is intended to function? The neopixel did nothing so I added "goto aloop"
    above "stop" and get continuous pulse train on c.0. A few of the leds light. Unable to try your other code because I don't have that pic. Tomorrow I will give it another go.
    Thanks

    Code:
    aloop: 
    
    
         p_pc=nows    ;set number of leds to load 
         @ Flash2Ram  _pixels,_rw1' Get a String from flash memory
         p_pc=nows     ;set number of leds to show
         call showpix
         
      goto aloop '????????????????
         stop
    end

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


    Did you find this post helpful? Yes | No

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

    I don't have a 12mhz crystal so I am having problems configuring 4550 for 48mhz internal osc. My test board has a 10mhz resonator. The usb pre-scale stuff is throwing me off. If you could help me with the configurations for internal osc 48mhz or 40mhz using the pll and the 10mhz resonator.

    the pll input needs to be 4MHz if you are going to use it . a 10MHz resonator
    cant be divided down to 4MHz using plldiv to keep pll input within specs .

    the xtal/res needs to be a multiple of 4 for correct use, my board has a 20MHz xtal

    out of spec operation may be possible but may lack stability required for this use

    Also as posted the code makes one pass and stops
    yep that's all that code did , you should see a white "R" , a loop serves no
    purpose here, the other examples are more elaborate




    if you want text scroll

    Code:
    aloop: 
    
     for  p_offset=0 to 1536 step 24
         p_pc=nows    ;set number of leds to load 
         @ Flash2Ram  _pixels,_rw1' Get a String from flash memory
         p_pc=nows     ;set number of leds to show
         call showpix
         pause 200
      next   
         
     goto aloop     
         stop
    end
    rw1:
      @ DW  0,0,0, 0,0,0,    0,0,0,    0,0,0,    0,0,0,    0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 0,0,0,    0,0,0,    0,0,0,    0,0,0,    0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 0,0,0,    0,0,0,    0,0,0,    0,0,0,    0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 0,0,0,    0,0,0,    0,0,0,    0,0,0,    0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 0,0,0,    0,0,0,    0,0,0,    0,0,0,    0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 0,0,0,    0,0,0,    0,0,0,    0,0,0,    0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 0,0,0,    0,0,0,    0,0,0,    0,0,0,    0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 0,0,0,    0,0,0,    0,0,0,    0,0,0,    0,0,0, 0,0,0, 0,0,0
      ;192
      @ DW  0,0,0, 50,50,50, 50,50,50, 50,50,50, 0,0,0,    0,0,0, 0,0,0, 0,0,0 ;23
      @ DW  0,0,0, 50,50,50, 0,0,0,    0,0,0,    50,50,50, 0,0,0, 0,0,0, 0,0,0 ;47
      @ DW  0,0,0, 50,50,50, 0,0,0,    0,0,0,    50,50,50, 0,0,0, 0,0,0, 0,0,0 ;71
      @ DW  0,0,0, 50,50,50, 50,50,    50,50,50, 50,0,0,0, 0,0,0, 0,0,0, 0,0,0 ;95
      @ DW  0,0,0, 50,50,50, 0,0,0,    0,0,0,    50,50,50, 0,0,0, 0,0,0, 0,0,0 ;119
      @ DW  0,0,0, 50,50,50, 0,0,0,    0,0,0,    50,50,50, 0,0,0, 0,0,0, 0,0,0 ;143
      @ DW  0,0,0, 50,50,50, 0,0,0,    0,0,0,    50,50,50, 0,0,0, 0,0,0, 0,0,0 ;167
      @ DW  0,0,0, 0,0,0,    0,0,0,    0,0,0,    0,0,0,    0,0,0, 0,0,0, 0,0,0 ;191
      ;384
      @ DW  0,0,0, 0,0,0,    50,50,50, 50,50,50, 50,50,50, 0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 0,0,0,    0,0,0,    50,50,50, 0,0,0,    0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 0,0,0,    0,0,0,    50,50,50, 0,0,0,    0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 0,0,0,    0,0,0,    50,50,50, 0,0,0,    0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 0,0,0,    0,0,0,    50,50,50, 0,0,0,    0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 0,0,0,    0,0,0,    50,50,50, 0,0,0,    0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 0,0,0,    50,50,50, 50,50,50, 50,50,50, 0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 0,0,0,    0,0,0,    0,0,0,    0,0,0,    0,0,0, 0,0,0, 0,0,0 
      ;576                                                  
      @ DW  0,0,0, 0,0,0,    50,50,50, 50,50,50, 50,50,50, 0,0,0, 0,0,0, 0,0,0 
      @ DW  0,0,0, 50,50,50, 0,0,0,    0,0,0,    0,0,0,    0,0,0, 0,0,0, 0,0,0 
      @ DW  0,0,0, 50,50,50, 0,0,0,    0,0,0,    0,0,0,    0,0,0, 0,0,0, 0,0,0 
      @ DW  0,0,0, 50,50,50, 0,0,0,    0,0,0,    0,0,0,    0,0,0, 0,0,0, 0,0,0 
      @ DW  0,0,0, 50,50,50, 0,0,0,    0,0,0,    0,0,0,    0,0,0, 0,0,0, 0,0,0 
      @ DW  0,0,0, 50,50,50, 0,0,0,    0,0,0,    0,0,0,    0,0,0, 0,0,0, 0,0,0 
      @ DW  0,0,0, 0,0,0,    50,50,50, 50,50,50, 50,50,50, 0,0,0, 0,0,0, 0,0,0 
      @ DW  0,0,0, 0,0,0,    0,0,0,    0,0,0,    0,0,0,    0,0,0, 0,0,0, 0,0,0
      ;768
      @ DW  0,0,0 ,50,50,50, 0,0,0,    0,0,0,    50,50,50, 0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 50,50,50, 0,0,0,    0,0,0,    50,50,50, 0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 50,50,50, 0,0,0,    0,0,0,    50,50,50, 0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 50,50,50, 50,50,50, 50,50,50, 50,50,50, 0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 50,50,50, 0,0,0,    0,0,0,    50,50,50, 0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 50,50,50, 0,0,0,    0,0,0,    50,50,50, 0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 50,50,50, 0,0,0,    0,0,0,    50,50,50, 0,0,0, 0,0,0, 0,0,0 
      @ DW  0,0,0, 0,0,0,    0,0,0,    0,0,0,    0,0,0,    0,0,0, 0,0,0, 0,0,0
      ;960
      @ DW  0,0,0, 0,0,0,    50,50,50, 50,50,50, 0,0,0,    0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 50,50,50, 0,0,0,    0,0,0,    50,50,50, 0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 50,50,50, 0,0,0,    0,0,0,    50,50,50, 0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 50,50,50, 50,50,50, 50,50,50, 50,50,50, 0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 50,50,50, 0,0,0,    0,0,0,    50,50,50, 0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 50,50,50, 0,0,0,    0,0,0,    50,50,50, 0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 50,50,50, 0,0,0,    0,0,0,    50,50,50, 0,0,0, 0,0,0, 0,0,0 
      @ DW  0,0,0, 0,0,0,    0,0,0,    0,0,0,    0,0,0,    0,0,0, 0,0,0, 0,0,0
      ;1152
      @ DW  0,0,0, 50,50,50, 50,50,50, 50,50,50, 0,0,0,    0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 50,50,50, 0,0,0,    0,0,0,    50,50,50, 0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 50,50,50, 0,0,0,    0,0,0,    50,50,50, 0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 50,50,50, 50,50,50, 50,50,50, 0,0,0,    0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 50,50,50, 0,0,0,    0,0,0,    50,50,50, 0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 50,50,50, 0,0,0,    0,0,0,    50,50,50, 0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 50,50,50, 0,0,0,    0,0,0,    50,50,50, 0,0,0, 0,0,0, 0,0,0 
      @ DW  0,0,0, 0,0,0,    0,0,0,    0,0,0,    0,0,0,    0,0,0, 0,0,0, 0,0,0
      ;1344
      @ DW  0,0,0 ,50,50,50, 50,50,50, 50,50,50, 0,0,0,    0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 50,50,50, 0,0,0,    0,0,0,    50,50,50, 0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 50,50,50, 0,0,0,    0,0,0,    50,50,50, 0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 50,50,50, 0,0,0,    0,0,0,    50,50,50, 0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 50,50,50, 0,0,0,    0,0,0,    50,50,50, 0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 50,50,50, 0,0,0,    0,0,0,    50,50,50, 0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0 ,50,50,50, 50,50,50, 50,50,50, 0,0,0,    0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 0,0,0,    0,0,0,    0,0,0,    0,0,0,    0,0,0, 0,0,0, 0,0,0
      ;1536
      @ DW  0,0,0, 0,0,0,    0,0,0,    0,0,0,    0,0,0,    0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 0,0,0,    0,0,0,    0,0,0,    0,0,0,    0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 0,0,0,    0,0,0,    0,0,0,    0,0,0,    0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 0,0,0,    0,0,0,    0,0,0,    0,0,0,    0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 0,0,0,    0,0,0,    0,0,0,    0,0,0,    0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 0,0,0,    0,0,0,    0,0,0,    0,0,0,    0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 0,0,0,    0,0,0,    0,0,0,    0,0,0,    0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 0,0,0,    0,0,0,    0,0,0,    0,0,0,    0,0,0, 0,0,0, 0,0,0
      @ DW  0,0,0, 0,0,0,    0,0,0,    0,0,0,    0,0,0,    0,0,0, 0,0,0, 0,0,0
    Warning I'm not a teacher

  5. #5


    Did you find this post helpful? Yes | No

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

    Richard

    I changed the crystal to 20mhz and added the scroll code above. It's now working, so thanks for your efforts.

    I'll study the other code and see what I can do.

    Mark

  6. #6
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,133


    Did you find this post helpful? Yes | No

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

    Similar to WS2811/2812 is the APA102C led chip, produced as a strip too.

    The Datasheet is unclear of the timing specs.

    I tried many hours to make it work but in vein. No led so far is under my control. Any ideas, welcome.

    An example code is this:
    Code:
    arraywrite leds,[0,0,0,0,$f0,128,128,128,255,255,255,255]
    
    shiftout led_data,led_clock,1,[leds[0],leds[1],leds[2],leds[3],leds[4],leds[5],leds[6],leds[7],leds[8],leds[9],leds[10],leds[11]]
    
    Lcdout  $fe,$1,"Stoped"
    stop
    Any help?
    Ioannis
    Attached Images Attached Images

  7. #7
    Join Date
    May 2013
    Location
    australia
    Posts
    2,645


    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

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