READ instruction data access time
StephenMoore
Posts: 188
I am trying to read bytes of data and shift them out in groups of 3 to a string of
Has anyone else encountered this timing problem?
WS2801 LED driver chips.
However, the LED driver chips latch the transmitted data if there is a 500 microsecond delay in transmission. I am only able to shift out data to two chips before the data is latched so that I cqn never access the down line driver chips. I believe this is because of slow data read times on the BS2px. I am reading the data from a different store than the slot my program is running in.Has anyone else encountered this timing problem?
program1: STORE 1 FOR idx1 = 0 TO 50 STEP 3 READ idx1, red, green, blue SHIFTOUT dataPin, clkPin, 1, [red, green, blue] NEXT RETURN
Comments
I did not see any timing info on a cross bank READ but the website is full of great data.
If I use 126 bytes of scratchpad RAM, I can read R-G-B data for 42 LEDS from memory. I need 24 more bytes of storage. If I reserve variable RAM I am only left with 1 word for program use!
I am still playing with the program itself but I am trying to load a string of 50 LEDs with R-G-B data. I can not exceed .5 msec between writes to the LED driver chip.
Somehow I need to better utilize memory.
sm
Unfortunately, schemes for better utilizing memory usually trade off speed for space and you have nothing to spare in either camp. You may be better off switching to another microcontroller with more memory and speed. The Propeller would be one that could handle this. If you already have some hardware built up, you could substitute a Spin Stamp for the BS2px as long as you don't have 5V sensors since you'd need to protect the Spin Stamp's 3.3V inputs from the 5V signals (a 3.3K series resistor would do that). You'd have to rewrite your program in Spin (or C or Forth), but we could help you get started with that.
As it is, my basic stamp program reads the R-G-B color pattern for 1/2 of the LEDs from the alternate bank store and copies it twice to the LED string. To the un-discerning eye there is no duplicity and all of the LEDs get updated everytime with some sort of color pattern.
Overall the project turned out pretty well. Here's a picture of one color scheme. With the great number of menu possibilities from the pot (1 to 1463) and all of the additional Stamp memory to store custom R-G-B tables, I've got more than enough color schemes. I also interpret a range of settings to give me delay values for dynamic color programs and maximum attained brightness on certain pot settings. Quite a lot of versatility from that RCTIME feature.
Thanks for your help again.
sm