adafruit-pitft script kills SPI

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
destockwell
 
Posts: 38
Joined: Sun Sep 06, 2020 6:37 pm

adafruit-pitft script kills SPI

Post by destockwell »

have had a number of issues with setup of a Raspberry PI 0W, in which every time I try to display something on the 2.8' display (with resistive touchscreen, product 1770, the screen shows full white, fully washed out. I can turn the screen off by dropping the "lite" pin (pin 10 on the SPI side of the interface).

Digging further I found that when I run adafruit-pitft.py to set up the board, it inserts the following dtoverlay call into /boot/config.txt. digging a bit further, I see that this particular overlay disables the two spi ports. Not good.

Code: Select all

dtoverlay=pitft28-resistive,rotate=270,speed=64000000,fps=30
So, the first thing I want is guidance on changing that overlay (using dtc?) to re-enable the two SPI ports.

I am trying to get the pitft setupscript to run properly because checking the various pins feeding the tft, it seems to me that when I display something on the display, something in the firmware is tying the CLK pin (pin 4 on the SPI-side) high. I have a nearly identical setup on a breadboard with another Rasp Pi 0W and 2.8 screen, etc, and it works fine.

I have buzzed out the circuit board on which I am building my device and it checks out: routing is fine, no cold solder joints, no bridging, no short circuits, etc.

Swapping the two displays from one to the other yields same results: good display does not work in the circuit board, and the previously not working display works well on the breadboard.

Ideas and/or suggestions?

destockwell
 
Posts: 38
Joined: Sun Sep 06, 2020 6:37 pm

Re: adafruit-pitft script kills SPI

Post by destockwell »

Digging around in learn.adafruit.com I found the following page:
https://learn.adafruit.com/adafruits-ra ... guring-spi

At the bottom of that page, it says
The /dev/spidev0.x will not show up when using the PiTFT screens as it is using the SPI interface.
So, apparently this disabling of /dev/spidev0.0 and /dev/spidev0.1 is by design.

However, when I set up the SPI connection for the touchscreen in my Python code, I get the following traceback:

Code: Select all

Traceback (most recent call last):
  File "./remote_screens.py", line 156, in <module>
    screen = Screens()
  File "./remote_screens.py", line 38, in __init__
    board.SPI(),
  File "/usr/local/lib/python3.7/dist-packages/board.py", line 279, in SPI
    return busio.SPI(SCLK, MOSI, MISO)
  File "/usr/local/lib/python3.7/dist-packages/busio.py", line 271, in __init__
    self._spi = _SPI(portId)
  File "/usr/local/lib/python3.7/dist-packages/adafruit_blinka/microcontroller/generic_linux/spi.py", line 22, in __init__
    self._spi = spi.SPI(device=(portid, 0))
  File "/usr/local/lib/python3.7/dist-packages/Adafruit_PureIO/spi.py", line 167, in __init__
    raise IOError("{} does not exist".format(device))
OSError: /dev/spidev0.0 does not exist
The code I am executing that fails is:

Code: Select all

        self.disp = ili9341.ILI9341(
            board.SPI(),
            rotation=self.rotation,
            cs=digitalio.DigitalInOut(board.CE0),
            dc=digitalio.DigitalInOut(board.D25),
            rst=digitalio.DigitalInOut(board.D24),
            baudrate=BAUDRATE
        )
Note that I am not using (and have not yet tried) using the FourWire setup, as in:

Code: Select all

spi = board.SPI()
tft_cs = board.CE0
tft_dc = board.D25

display_bus = displayio.FourWire(spi, command=tft_dc, chip_select=tft_cs)
display = adafruit_ili9341.ILI9341(display_bus, width=320, height=240)
However, I suspect that this will behave in exactly the same way because the call to board.SPI() seems to be what triggered the failure of the other code. So, for now, I will just disable the pitft28 overlay in config.txt

Unless anybody has other suggestions...?

TIA

destockwell
 
Posts: 38
Joined: Sun Sep 06, 2020 6:37 pm

Re: adafruit-pitft script kills SPI

Post by destockwell »

Regarding the following: I found that one of the main issues was that I had forgotten to install the TTF font files on the second device.
destockwell wrote:have had a number of issues with setup of a Raspberry PI 0W, in which every time I try to display something on the 2.8' display (with resistive touchscreen, product 1770, the screen shows full white, fully washed out. I can turn the screen off by dropping the "lite" pin (pin 10 on the SPI side of the interface).
And, regarding the following, I am test-building the device by using headers and connectors to glue the bits together, and these are not quite making good contact
destockwell wrote:I am trying to get the pitft setupscript to run properly because checking the various pins feeding the tft, it seems to me that when I display something on the display, something in the firmware is tying the CLK pin (pin 4 on the SPI-side) high. I have a nearly identical setup on a breadboard with another Rasp Pi 0W and 2.8 screen, etc, and it works fine.

I have buzzed out the circuit board on which I am building my device and it checks out: routing is fine, no cold solder joints, no bridging, no short circuits, etc.
So, I am progressing...
20210910_155059.jpg
20210910_155059.jpg (906.91 KiB) Viewed 152 times

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”