At Sat, 21 Sep 2019 08:41:25 -0700 (PDT) [email protected] wrote:
> > > > > For some reason all my responses of the last week via > gmane.comp.hardware.beagleboard.user have been getting rejected at the > Google Groups interface; I had to join the group using the Web interface... > > On Saturday, September 21, 2019 at 8:46:56 AM UTC-4, Hanah anees wrote: > > > > I am using ST7735S.It has a 3 wire serial mode which is 9 bit in every > > "byte transaction, 9th bit 1 for command and 0 for data. > > It does have a 4 wire configuration (which would have made my life much > > easier), but the hardware vendor wanted it to be 3 wire mode. Can we even > > do this over SPIDEV in user space? I have set 9 bit word size and nothing > > seems to help. > > > > > If I understand the documentation > https://www.crystalfontz.com/controllers/Sitronix/ST7735S/437/ the 3-wire > mode uses the SAME pin for both input and output data. If so,you can NOT > rely on a "loopback" echoing the output command/data as you'd be reading > bits from your own output, possibly delayed by a half clock or so. > > How does one even wire this? Processor MISO and MOSI both connected to one > pin (SDA) of the display? That is NOT SPI, that sounds like I2C, which is a completely different interface... Looking at the Adafruit 1.8" TFT Display Breakout and Shield documentation, which also has a ST7735S embeded in it, it looks like Adafruit just wired MOSI (through a level shifter) to "SDA". The Adafruit ST7735S does not perform any readback functions. Eg. it is treated as a write-only device (Adafruit has it configured as a 4-wired SPI). > > The documentation indicates that 1) you should only be reading display > output after sending a "read command" and 2) the output from the processor > needs to go tri-state (float/open) at the end of said command before > reading the display return value. You need to keep chip select and clock > going through this cycle. > > That's a half-duplex mode, where each side takes turns putting data on the > bus. I don't think SPI operates that way -- SPI is full-duplex, with both > sides putting data on the bus on each clock cycle. > https://en.wikipedia.org/wiki/Serial_Peripheral_Interface#Three-wire_serial_buses > > "Few SPI master controllers support this mode; although it can often be > easily bit-banged in software. " Given the pin names (SCL and SDA), this *sounds* like an early incarnation of I2C somehow mixed with SPI. > > You might have to code the protocol using a PRU, with some interface to the > main processor for sending/receiving data. Though, given that the protocol > only transfers on clock transitions, just using GPIO from Linux may be > sufficient -- a longer clock cycle from the OS pre-empting your code > shouldn't matter. Or you can do what Adafruit did: use it in write-only mode. Or not use the hardware SPI at all, and just bit-bang some GPIO pins. I think the GPIO pins can be set to a bi-directional mode. > -- Robert Heller -- 978-544-6933 Deepwoods Software -- Custom Software Services http://www.deepsoft.com/ -- Linux Administration Services [email protected] -- Webhosting Services -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/20190922132820.D603326C07FC%40sharky3.deepsoft.com.
