3 wire SPI 9 bit

Posted on
  • i want to provide a module for a specific display driver, so far it works perfectly - when using 4 wire SPI

    the driver provides the option to use 3 wire SPI, but the data must be 9 bit (where the first bit determines a command or a data byte)

    so far i have no luck with

    // add 'it is data' to the data by setting an additional 9. left bit
          data |= (1 << 8);
          this.spi.write(data, chipSelectPin);
    

    is there some module where 9 bit SPI is used already?

  • I'm not 100% sure if anyone uses it already... Are you using hardware or software SPI? I'm not sure about hardware, but software SPI definitely should work with 9 bits.

    I just looked at the code and it seems like there is a bug that means that individual numbers being sent to spi.send are cropped to 8 bits, so that could be causing you grief? spi.write seems fine though.

    If you need to use spi.send, for now, just use spi.send([data], chipSelectPin)

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

3 wire SPI 9 bit

Posted by Avatar for MichaelPralow @MichaelPralow

Actions