Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

SPI1 CS pin on Orange Pi Zero +2???

Featured Replies

Hey.

I'm working on getting a small touch screen working on my OPiZ+2.

It's a Waveshare 4.3 with a resistive touchpanel (using HDMI for displaying).

I've had some issues getting the touch panel to work, and just wanted to share my findings, and ask whether I have misunderstood something.

 

The waveshare wiki does provide a script for setting up the panel, but I think it's more aimed at a raspberry pi, and it didn't get the touch panel working.

 

I manually added spi-spidev and spi-add-cs1 to to armbianEnv.txt.

I also added the parameters:

param_spidev_spi_bus=1

param_spidev_spi_cs=1

(took me a bit to figure out that I had to use spi1 instead of spi0, but so far so good).

I also made a dts for the touchpanel chip - ads7846.dts: (using PA2 - never mind where it says PA7)

 

/dts-v1/;
/plugin/;

/ {
	compatible = "allwinner,sun4i-a10", "allwinner,sun7i-a20", "allwinner,sun8i-h3", "allwinner,sun50i-a64", "allwinner,sun50i-h5";

	fragment@0 {
		target = <&pio>;
		__overlay__ {
			ads7846_pins: ads7846_pins {
				pins= "PA2";
				function = "irq";
           		};
		};
	};

	fragment@1 {
		target = <&spi1>;
		__overlay__ {
			#address-cells = <1>;
			#size-cells = <0>;
			status = "okay";
			ads7846@0 {
				compatible = "ti,ads7846";
				reg = <0>; /* Chip Select 0 */ // vi prøver med 1
				status = "okay";
				pinctrl-names = "default";
				pinctrl-0 = <&ads7846_pins>;
				spi-max-frequency = <2000000>;
				interrupt-parent = <&pio>;
				interrupts = <0 2 2>; /* PA7 IRQ_TYPE_EDGE_FALLING */
				pendown-gpio = <&pio 0 2 0>; /* PA7 */

				/* driver defaults, optional */
				ti,x-min = /bits/ 16 <0>;
				ti,y-min = /bits/ 16 <0>;
				ti,x-max = /bits/ 16 <0x0FFF>;
				ti,y-max = /bits/ 16 <0x0FFF>;
				ti,pressure-min = /bits/ 16 <0>;
				ti,pressure-max = /bits/ 16 <0xFFFF>;
				ti,x-plate-ohms = /bits/ 16 <400>;
			};
		};
	};
};

 

 

Anyways, I still could not get the touch to work.

After many hours of messing around, I found an image of the pins on the orange pi zero here:

Orange-Pi-Zero-Pinout.jpg&f=1&nofb=1

which seems to indicate that SPI_CS is on pin PA13 - not PA10.......

The connector on the display has the CS connection on pin nr. 26.....

So I tried using wires between the OPi and the display connector, using pin nr. 24 (PA13) instead, and touch came to life!

So far so good - but does this mean I'm doing something wrong? Looking through the dts overlays, it seems that it SHOULD be PA10 for the SPI_CS....??

IS it possible to get the board to use PA10 instead of PA13, so I can connect the display directly on the board??

 

Regards

Anders.

 

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.