Shop OBEX P1 Docs P2 Docs Learn Events
WS2801 MAX_PIXELS Question — Parallax Forums

WS2801 MAX_PIXELS Question

ryfitzger227ryfitzger227 Posts: 99
edited 2014-05-05 04:11 in Propeller 1
Hello everyone.

This is fairly simple question, I just don't know the answer and would like someone to confirm it for me.

I'm working on a digit display board with 36mm RGB LED Squares from Adafruit using the WS2801. I'm using the jm_ws2801.spin object and a TC4427 MOSFET. I have a total of 4 36" x 22" digits on one board. That's a total of 304 WS2801 squares. In the WS2801 object I'm using there is a constant titled MAX_PIXELS with a value 256. Since I'm using 304 pixels I want to make sure that they will work all with one instance of the object. I can always use two instances of the object, but I want to know if I can just change that value to 304 and it would still work. I saw some other WS2801 projects with <1000 pixels.

Anyone know the answer to this question or an easier solution?

Thanks.
- Ryan

Comments

  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-05-04 17:41
    IMO, it's a good idea to link to an object you're asking about.

    I'm not sure if the object you're using is the same as the one I have but I see this in the CON section.
      MAX_CHANNELS = 512 / 3 { 170 }                                ' one dmx universe
    
    
    

    I'm guessing JonnyMac uses this value because he does a lot of stuff with DMX. I don't see anything in the code that would limit the number of LEDs you could use. You're limited by the amount of hub RAM available and by how fast you want the LEDs refreshed.

    If you wanted to increase the refresh rate, you could use more than one WS2801 object to control the LEDs. If you used two sets of clock and data pins, you could have two cogs sending data to the two strands of LEDs.
  • ryfitzger227ryfitzger227 Posts: 99
    edited 2014-05-04 18:32
    Okay. I think I know what you're saying, but I want to make sure first.

    I can change that value to 304 and the only thing that I would notice is that it would take longer for the LEDs to be refreshed, correct?

    I have attached the object now, sorry I didn't do this before.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-05-04 18:41
    I can change that value to 304 and the only thing that I would notice is that it would take longer for the LEDs to be refreshed, correct?

    That's my guess.
  • JonnyMacJonnyMac Posts: 9,105
    edited 2014-05-04 19:08
    I can change that value to 304 and the only thing that I would notice is that it would take longer for the LEDs to be refreshed, correct?

    No, because in that driver YOU set the update timing with the start method, in milliseconds.

    Keep in mind that my driver auto refreshes, so you may won't to throw a 'scope on the clock line to see what the actual speed is. From there you can work out what the maximum refresh rate accounting for 24-bits for every channel, plus the reset period. The last time I worked with WS2801 strips I did a test and was able to refresh 180 LEDs in under 3ms. If you don't want to look at the speed with a 'scope, start with a 10ms frame time; this is 100Hz and will probably be fine for you app.
  • ryfitzger227ryfitzger227 Posts: 99
    edited 2014-05-05 04:11
    JonnyMac wrote: »
    No, because in that driver YOU set the update timing with the start method, in milliseconds.

    Keep in mind that my driver auto refreshes, so you may won't to throw a 'scope on the clock line to see what the actual speed is. From there you can work out what the maximum refresh rate scouting to 24-bits for every channel, plus the reset period. The last time I worked with WS2801 strips I did a test and was able to refresh 180 LEDs in under 3ms. If you don't want to look at the speed with a 'scope, start with a 10ms frame time; this is 100Hz and will probably be fine for you app.

    Makes complete sense.

    Thank you.
Sign In or Register to comment.