2 Replies Latest reply on Jul 23, 2015 8:53 AM by rayh

    SPI for 24 bits

      The current SPI component "out of the box" supports only a bit length maximum of 16 bits.  Can the code be modified to support 24 bits?


      I'm trying to interface to WS2801 and SM16715 LED string controllers, which have data + clock lines, and appear to be compatible with the SPI control... except they require 24 bits (8 each for red, green, and blue).


      Seems to me (and I haven't peered into the existing code for SPI - yet) that the 16-bit limit is probably hard-coded, and if I changed the limit to 24 and stored as my own component, it should work.


      Ultimately I'd like to implement a PSoC-compatible library of LED string controllers similar to what's done for Arduino on the FastLED.io site.  The single-line WS2811/WS2812 devices already have a PSoC component that controls multiple strings.

        • 1. Re: SPI for 24 bits

          The SPI is done using cascadable  8 bit wide UDBs which must be programmed using VeriLog as HDL.The UDB already contains the needed FIFOs in input and output paths.


          Not quite an easy job, but doable.


          On the other hand: It could be managed to transmit 3 bytes via SPI to get 24 bits as a result.





          • 2. Re: SPI for 24 bits

            Bob, thanks.  I hadn't considered that SPI might send 3 8-bit bytes "contiguously".  I'll give that a try and see how it works. In the meantime, someone at Cypress was able to locate (or create) an SPI component supposedly configurable for up to 32 bit length data items.  I might try that as well...