Peter Gregory
Members-
Posts
30 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
-
Orange PI PC + 3+3 watt amp power issues
Peter Gregory replied to Peter Gregory's topic in Allwinner sunxi
I finally got a configuration that works. I got a 5v 4amp wall power supply to run the Orange PI PC I connected my amp power to the 2 5v header pins and 2 and pins. I connected the audio jack's L and R & common ground using the SMD pads instead of an audio plug (My plug was stereo and was shorting the video out to audio channels) I put the audio signals through a audio isolation transformer to get rid of the ground loop current and filter out the big pop when the audio codec kicks on That's it! The 4a is strong enough to run the board and the amp without significant voltage drop on high power usage (~200ma draw from amp) The isolation transformers eliminate the ground loop hum and chatter from the board operations. The audio is clean and loud. -
Turns out this issue was my audio jack. I think the stereo plug was shorting the video out and audio channels together causing a hot mess. I bypassed the audio jack by soldering my analog audio connections directly to the SMD pads in the audio jack and the sound is great. Now I'm having trouble getting my PAM8403 2x 3W Mini Digital Power Amplifier Board AMP Class D and orange pi pc to work with a single power supply. I can power the pi from a 2a 5v supply and the amp from a separate 1a 5v supply and it works great. No hum or audio problems (I thought it could be louder, but it is not bad). If I attempt to power both devices from a single 3a (or more, I tried up to 5a) 5v supply it does not work. It looks like I have a big ground loop problem with the audio outputs and the power amp. I have some audio isolation transformers on order and I hope that will fix the issue. Once the analog driver kicks on, I get a loudish "pop" from the amp and the 5v voltage dips briefly below the minimum to keep the board running. Even with separate power supplies, I see a lot of ripple and drops from the 5v supply on the amp while playing at higher volumes. I'm not sure if I need to add a low/high filter to keep the low / high frequencies out or if the audio isolation will do the trick. Any advice on getting an external audio amp to work well with this board will be appreciated.
-
Yeah, I think you are right. I got the device working on an Orange PI PC, but I wanted a lower cost board with wifi. I thought I could use the same technique to get the display working on my Orange PI Zero 2, but I couldn't find any pins I could use to drive the display. The device tree allocated all the exposed pins for other uses. Has anyone had luck getting a display like this one working on an Orange PI Zero W2 or similar hardware?
-
I'm using image Armbian_23.8.3_Orangepizero2_bookworm_current_6.1.53 I'm building a DTS overlay for a SPI Touchscreen and every pin I try to use is showing this error: [ 1.441808] sun50i-h616-pinctrl 300b000.pinctrl: pin PC11 already requested by 5011000.spi; cannot claim for 300b000.pinctrl:75 [ 1.441817] sun50i-h616-pinctrl 300b000.pinctrl: pin-75 (300b000.pinctrl:75) status -22 [ 1.441829] sun6i-spi 5011000.spi: cannot register SPI master I'm trying to configure my touchscreen dts to use the SPI1.0 & SPI1.1. However, the pins exposed on the headers are all allocated for device use under 300b000.pinctrl. How do you allocate header pins for another use? I need 5 pins + SPI1 for the touchscreen to work. My dts /dts-v1/; /plugin/; / { compatible = "allwinner,sun8i-h3"; fragment@0 { target = <&pio>; __overlay__ { spi1_cs1: spi1_cs1 { pins = "PC11"; function = "gpio_out"; output-high; }; opiz_display_pins: opiz_display_pins { pins = "PC9", "PC6", "PC5"; function = "gpio_out"; }; ads7846_pins: ads7846_pins { pins = "PH6"; function = "irq"; }; }; }; fragment@1 { target = <&spi1>; __overlay__ { #address-cells = <1>; #size-cells = <0>; status = "okay"; pinctrl-1 = <&spi1_cs1>; pinctrl-names = "default", "default"; cs-gpios= <0>, <&pio 2 11 0>; /* PH9 PC11 */ opizdisplay: opiz-display@0 { reg = <0>; /* Chip Select 0 */ compatible = "ilitek,ili9341"; spi-max-frequency = <16000000>; status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&opiz_display_pins>; rotate = <90>; bgr = <0>; fps = <10>; buswidth = <8>; dc-gpios = <&pio 2 6 0>; /* PC6 */ reset-gpios = <&pio 2 9 1 >; /* PC9 */ led-gpios=<&pio 2 5 0>; /* PC5 */ debug=<0>; }; ads7846: ads7846@1 { reg = <1>; /* Chip Select 1 */ compatible = "ti,ads7846"; spi-max-frequency = <500000>; status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&ads7846_pins>; interrupt-parent = <&pio>; interrupts = <7 6 2>; /* PH6 IRQ_TYPE_EDGE_FALLING */ pendown-gpio = <&pio 7 6 0>; /* PH6 */ /* 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>; }; }; }; };
-
So, it is working! It just wasn't working with my edge custom built image: Armbian_23.08.0-trunk_Orangepipc_bookworm_edge_6.5.5_minimal.img. I reproduced my efforts on the latest armbian image Armbian_23.8.1_Orangepipc_bookworm_current_6.1.47.img and it is working as expected. The display works and the touch events are working properly. I changed my wiring to test swapping LCD and Touch. Here is my working wiring chart: 1 - VCC (1) 3.3v 2 - GND (6) GND 3 - CS (24) PC3 SPI0 CS 4 - RESET (26) PA21 GPIO 11 5 - DC (31) PA8 GPIO 22 6 - SDI (MOSI) (19) PC0 SPI0 MOSI 7 - SCLK (23) PC2 SPI0 CLK 8 - LED (33) PA9 GPIO 23 9 - SDO (MISO) (21) PC1 SPI0 MISO 10 - T_CLK (23) PC2 SPI0 CLK * 11 - T_CS (18) PC7 GPIO 5 12 - T_DIN (19) PC0 SPI0 MOSI * 13 - T_DO (21) PC1 SPI0 MISO * 14 - T_IRQ (29) PA7 GPIO 21 Here are steps to get the display working: Install latest armbian image: Armbian_23.8.1_Orangepipc_bookworm_current_6.1.47.img sudo armbian-config enable desktop sudo nano /boot/armbianEnv.txt user_overlays=touchscreen extraargs=fbcon=map:1 nano touchscreen.dts /dts-v1/; /plugin/; / { compatible = "allwinner,sun8i-h3"; fragment@0 { target = <&pio>; __overlay__ { spi0_cs1: spi0_cs1 { pins = "PC7"; function = "gpio_out"; output-high; }; opiz_display_pins: opiz_display_pins { pins = "PA21", "PA8", "PA9"; function = "gpio_out"; }; ads7846_pins: ads7846_pins { pins = "PA7"; function = "irq"; }; }; }; fragment@1 { target = <&spi0>; __overlay__ { #address-cells = <1>; #size-cells = <0>; status = "okay"; pinctrl-1 = <&spi0_cs1>; pinctrl-names = "default", "default"; cs-gpios= <0>, <&pio 2 7 0>; /* PC7 */ ads7846: ads7846@1 { reg = <0>; /* Chip Select 0 */ compatible = "ti,ads7846"; spi-max-frequency = <500000>; status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&ads7846_pins>; interrupt-parent = <&pio>; interrupts = <0 7 2>; /* PA7 IRQ_TYPE_EDGE_FALLING */ pendown-gpio = <&pio 0 7 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>; }; opizdisplay: opiz-display@0 { reg = <1>; /* Chip Select 1 */ compatible = "ilitek,ili9341"; spi-max-frequency = <16000000>; status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&opiz_display_pins>; rotate = <90>; bgr = <0>; fps = <10>; buswidth = <8>; dc-gpios = <&pio 0 8 0>; /* PA8 */ reset-gpios = <&pio 0 21 1 >; /* PA21 */ led-gpios=<&pio 0 9 0>; /* PA9 */ debug=<0>; }; }; }; }; sudo armbian-add-overlay touchscreen.dts sudo nano /etc/modules-load.d/fbtft.conf fbtft fb_ili9341 sudo nano /usr/share/X11/xorg.conf.d/99-fbdev.conf Section "Device" Identifier "myfb" Driver "fbdev" Option "fbdev" "/dev/fb1" EndSection reboot and your display and touch should work!
-
The LCD part is working well. The touch part, not so well. I try running evtest and selecting the touch device, but I don't see activity. Connecting to the scope, I see the driver query the device and get data back, but I guess it is not decoding the results properly. even with activity like listed above, it is not returning any results from evtest. sudo evtest No device specified, trying to scan all of /dev/input/event* Available devices: /dev/input/event0: gpio-keys /dev/input/event1: ADS7846 Touchscreen /dev/input/event2: sunxi-ir /dev/input/event3: BRLTTY 6.5 Linux Screen Driver Keyboard Select the device event number [0-3]: 1 Input driver version is 1.0.1 Input device ID: bus 0x1c vendor 0x0 product 0x1ea6 version 0x0 Input device name: "ADS7846 Touchscreen" Supported events: Event type 0 (EV_SYN) Event type 1 (EV_KEY) Event code 330 (BTN_TOUCH) Event type 3 (EV_ABS) Event code 0 (ABS_X) Value 0 Min 1 Max 65535 Event code 1 (ABS_Y) Value 0 Min 1 Max 65535 Event code 24 (ABS_PRESSURE) Value 0 Min 0 Max 255 Properties: Testing ... (interrupt to exit) .... Crickets.... Does anyone have experience with the ads7843 driver interfacing with a XPT2046 chip? Is there a magic configuration that makes it decode the data properly? It looks like it should be valid to me.
-
I'm getting closer - I finally got the touch and display to initialize. The trick is determining which GPIO pins can be used and which support interrupts. Here is the pinout and connection diagram I am using: 1 - VCC (1) 3.3v 2 - GND (6) GND 3 - CS (24) PC3 SPI0 CS 4 - RESET (29) PA7 GPIO 21 5 - DC (31) PA8 GPIO 22 6 - SDI (MOSI) (19) PC0 SPI0 MOSI 7 - SCLK (23) PC2 SPI0 CLK 8 - LED (33) PA9 GPIO 23 9 - SDO (MISO) (21) PC1 SPI0 MISO 10 - T_CLK (23) PC2 SPI0 CLK * 11 - T_CS (26) PC7 GPIO 5 12 - T_DIN (19) PC0 SPI0 MOSI * 13 - T_DO (21) PC1 SPI0 MISO * 14 - T_IRQ (18) PA21 GPIO 11 (Supports interrupt) DTS that is working /dts-v1/; /plugin/; / { compatible = "allwinner,sun8i-h3"; fragment@0 { target = <&pio>; __overlay__ { spi0_cs1: spi0_cs1 { pins = "PC7"; function = "gpio_out"; output-high; }; opiz_display_pins: opiz_display_pins { pins = "PA7", "PA8", "PA9"; function = "gpio_out"; }; ads7846_pins: ads7846_pins { pins = "PA21"; function = "irq"; }; }; }; fragment@1 { target = <&spi0>; __overlay__ { #address-cells = <1>; #size-cells = <0>; status = "okay"; pinctrl-1 = <&spi0_cs1>; pinctrl-names = "default", "default"; cs-gpios= <0>, <&pio 2 7 0>; opizdisplay: opiz-display@0 { reg = <0>; /* Chip Select 0 */ compatible = "ilitek,ili9341"; spi-max-frequency = <16000000>; status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&opiz_display_pins>; rotate = <90>; bgr = <0>; fps = <10>; buswidth = <8>; dc-gpios = <&pio 0 8 0>; /* PA8 */ reset-gpios = <&pio 0 7 1 >; /* PA7 */ led-gpios=<&pio 0 9 0>; /* PA9 */ debug=<4>; }; ads7846: ads7846@1 { reg = <1>; /* Chip Select 1 */ compatible = "ti,ads7846"; spi-max-frequency = <2000000>; status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&ads7846_pins>; interrupt-parent = <&pio>; interrupts = <0 21 2>; /* PC7 IRQ_TYPE_EDGE_FALLING */ pendown-gpio = <&pio 0 21 0>; /* PC7 */ /* 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>; }; }; }; }; Using this configuration I get the following from dmesg: [ 6.231015] fbtft: module is from the staging directory, the quality is unknown, you have been warned. [ 6.234683] fb_ili9341: module is from the staging directory, the quality is unknown, you have been warned. [ 6.235590] systemd[1]: Mounting sys-fs-fuse-connections.mount - FUSE Control File System... [ 6.235823] fb_ili9341 spi0.0: fbtft_property_value: buswidth = 8 [ 6.235857] fb_ili9341 spi0.0: fbtft_property_value: debug = 4 [ 6.235870] fb_ili9341 spi0.0: fbtft_property_value: rotate = 90 [ 6.235892] fb_ili9341 spi0.0: fbtft_property_value: fps = 10 [ 6.573436] fb_ili9341 spi0.0: Display update: 1787 kB/s, fps=0 [ 6.574355] Console: switching to colour frame buffer device 40x30 [ 6.575115] graphics fb1: fb_ili9341 frame buffer, 320x240, 150 KiB video memory, 16 KiB buffer memory, fps=10, spi0.0 at 16 MHz [ 8.471370] SPI driver ads7846 has no spi_device_id for ti,tsc2046 [ 8.471402] SPI driver ads7846 has no spi_device_id for ti,ads7843 [ 8.471410] SPI driver ads7846 has no spi_device_id for ti,ads7845 [ 8.471417] SPI driver ads7846 has no spi_device_id for ti,ads7873 [ 8.471620] ads7846 spi0.1: setup mode 0, 8 bits/w, 2000000 Hz max --> 0 [ 8.471794] ads7846 spi0.1: supply vcc not found, using dummy regulator [ 8.481255] systemd[1]: Finished systemd-binfmt.service - Set Up Additional Binary Formats. [ 8.486590] ads7846 spi0.1: touchscreen, irq 62 [ 8.501181] input: ADS7846 Touchscreen as /devices/platform/soc/1c68000.spi/spi_master/spi0/spi0.1/input/input2 I try touching the screen, but I'm not set up to use the new touch device as the main input yet. I think I'm very close to getting this display operational. running everest I get the following: everest 'No device specified, trying to scan all of /dev/input/event* Not running as root, no devices may be available. Available devices: /dev/input/event0: gpio-keys /dev/input/event1: sunxi-ir /dev/input/event2: ADS7846 Touchscreen /dev/input/event3: BRLTTY 6.5 Linux Screen Driver Keyboard evtest --grab /dev/input/event2 Input driver version is 1.0.1 Input device ID: bus 0x1c vendor 0x0 product 0x1ea6 version 0x0 Input device name: "ADS7846 Touchscreen" Supported events: Event type 0 (EV_SYN) Event type 1 (EV_KEY) Event code 330 (BTN_TOUCH) Event type 3 (EV_ABS) Event code 0 (ABS_X) Value 0 Min 0 Max 4095 Event code 1 (ABS_Y) Value 0 Min 0 Max 4095 Event code 24 (ABS_PRESSURE) Value 0 Min 0 Max 65535 Properties: Testing ... (interrupt to exit) Event: time 1695777743.332287, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1695777743.332287, type 3 (EV_ABS), code 0 (ABS_X), value 562 Event: time 1695777743.332287, type 3 (EV_ABS), code 1 (ABS_Y), value 2228 Event: time 1695777743.332287, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 64919 Event: time 1695777743.332287, -------------- SYN_REPORT ------------ Event: time 1695777743.340652, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1695777743.340652, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 0 Event: time 1695777743.340652, -------------- SYN_REPORT ------------ Event: time 1695777762.428725, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1 Event: time 1695777762.428725, type 3 (EV_ABS), code 0 (ABS_X), value 21 Event: time 1695777762.428725, type 3 (EV_ABS), code 1 (ABS_Y), value 3185 Event: time 1695777762.428725, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 65502 Event: time 1695777762.428725, -------------- SYN_REPORT ------------ Event: time 1695777762.440670, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 0 Event: time 1695777762.440670, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 0 Event: time 1695777762.440670, -------------- SYN_REPORT ------------ I'm getting touch events. I still need to find out how to set the touch device as the default pointer. After testing and trying to get the touch working consistently I've come to the conclusion the interrupt is not working as expected. I can hook my device up to a scope and every touch will cause a drop in the pen down pin, but I don't see a corresponding drop in CS1 pin to SPI activity to get the touch data. Every now and then it will query the touch device in response to a touch event, but it does it only after repeated touch & move operations. I don't see a way to turn on debugging for the touch module, so it is difficult to determine where the problem is. Anyone else see this behavior?
-
Finally some success! My original wiring was correct. MISO goes to MISO and MOSI goes to MOSI. The problem was in my DTS. This device has a 8 bit bus, not a 16 bit bus. I also ran into a problem that pin A21 would not follow the DTS and was active all the time - making the touch active and corrupting the SPI data. I moved it to PC4. Correct wiring: 2.8 Inch TFT SPI 240x320, ads7846 Touch 1 - VCC (1) 3.3v 2 - GND (6) GND 3 - CS (24) PC3 SPI0 CS 4 - RESET (29) PA7 GPIO 21 5 - DC (31) PA8 GPIO 22 6 - SDI (MOSI) (19) PC0 SPI0 MOSI 7 - SCLK (23) PC2 SPI0 CLK 8 - LED (33) PA9 GPIO 23 9 - SDO (MISO) (21) PC1 SPI0 MISO 10 - T_CLK (23) PC2 SPI0 CLK * 11 - T_CS (16) PC4 GPIO 4 12 - T_DIN (19) PC0 SPI0 MOSI * 13 - T_DO (21) PC1 SPI0 MISO * 14 - T_IRQ (18) PC7 GPIO.5 Correct DTS for the display (still working on the touch controller...) /dts-v1/; /plugin/; / { compatible = "allwinner,sun8i-h3"; fragment@1 { target = <&pio>; __overlay__ { spi0_cs1_pin: spi0-cs1-pin { pins = "PC4"; function = "gpio_out"; output-high; }; ili9341_rst: ili9341-rst { pins = "PA7"; function = "gpio_out"; output-high; }; ili9341_dc: ili9341-dc { pins = "PA8"; function = "gpio_out"; output-high; }; ili9341_led: ili9341-led { pins = "PA9"; function = "gpio_out"; output-high; }; ads7846_pin: ads7846-pin { pins = "PC7"; function = "gpio_in"; }; }; }; fragment@2 { target = <&pio>; __overlay__ { ads7846_pins: ads7846_pins { pins = "PC4", "PC7"; /*SPI0.1 CS, PINDOWN*/ function = "gpio_out", "gpio_in" ; }; }; }; fragment@3 { target = <&pio>; __overlay__ { ili9341_pins: ili9341_pins { pins = "PA7", "PA8", "PA9"; /*RESET, DC_RS, LED*/ function = "gpio_out", "gpio_out", "gpio_out" ; }; }; }; fragment@4 { target = <&spi0>; __overlay__ { #address-cells = <1>; #size-cells = <0>; cs_gpios = <0>, <&pio 2 4 0>; pinctrl-0 = <&spi0_pins>; status = "okay"; ili9341: ili9341@0 { compatible = "ilitek,ili9341"; reg = <0>; pinctrl-names = "default"; pinctrl-0 = <&ili9341_pins>; status = "okay"; debug = <0>; rotate = <0>; bgr = <1>; fps = <10>; buswidth = <8>; regwidth = <8>; reset-gpios = <&pio 0 7 1>; dc-gpios = <&pio 0 8 0>; led-gpios = <&pio 0 9 0>; spi-max-frequency = <16000000>; }; xpt2046: xpt2046@1 { compatible = "ti,ads7846"; reg = <1>; pinctrl-names = "default"; pinctrl-0 = <&ads7846_pin>; interrupts = <2 7 2>; interrupt-parent = <&pio>; pendown_gpio = <&pio 2 7 2>; status = "okay"; spi-max-frequency = <10000000>; ti,keep-vref-on = <1>; ti,x-min = /bits/ 16 <00>; ti,x-max = /bits/ 16 <0xFFF>; ti,y-min = /bits/ 16 <00>; ti,y-max = /bits/ 16 <0xFFF>; ti,x-plate-ohms = /bits/ 16 <60>; ti,pressure-max = /bits/ 16 <255>; ti,swap-xy = <0>; }; }; }; }; Steps to get the display up and running: sudo nano /boot/armbianEnv.txt disp_mode=720p60 user_overlays=touchscreen extraargs=fbcon=map:1 nano touchscreen.dts <insert DTS source from above> sudo armbian-add-overlay touchscreen.dts sudo nano /etc/modules-load.d/fbtft.conf fbtft fb_ili9341 sudo nano /usr/share/X11/xorg.conf.d/99-fbdev.conf Section "Device" Identifier "myfb" Driver "fbdev" Option "fbdev" "/dev/fb1" EndSection reboot and your console / desktop will show in the LCD display I'm still getting the error from the touch driver: [ 9.423938] SPI driver ads7846 has no spi_device_id for ti,tsc2046 [ 9.423975] SPI driver ads7846 has no spi_device_id for ti,ads7843 [ 9.423984] SPI driver ads7846 has no spi_device_id for ti,ads7845 [ 9.423991] SPI driver ads7846 has no spi_device_id for ti,ads7873 [ 9.424199] ads7846: probe of spi0.1 failed with error -22 I'm trying to find a DTS with a shared SPI instance (SPI0.0 and SPI0.1). I'm pretty sure my setup for the second CS is causing the issue. At least now the display works when it is fully wired up.
-
I made a rookie mistake - I connect MOSI -> MOSI and MISO -> MISO (input to input, output to output). No wonder it would not work. I corrected my wiring connections and updated my dts: 2.8 Inch TFT SPI 240x320, ads7846 Touch => Orange PI PC 1 - VCC => (1) 3.3v 2 - GND => (6) GND 3 - CS => (24) PC3 SPI0 CS 4 - RESET => (29) PA7 GPIO 21 5 - DC => (31) PA8 GPIO 22 6 - SDI (MOSI) => (21) PC1 SPI0 MISO 7 - SCLK => (23) PC2 SPI0 CLK 8 - LED => (33) PA9 GPIO 23 9 - SDO (MISO) => (19) PC0 SPI0 MOSI 10 - T_CLK => (23) PC2 SPI0 CLK * 11 - T_CS => (26) PA21 GPIO 11 12 - T_DIN => (21) PC1 SPI0 MISO * 13 - T_DO => (19) PC0 SPI0 MOSI * 14 - T_IRQ => (18) GPIO.5 PC7 /dts-v1/; /plugin/; / { compatible = "allwinner,sun8i-h3"; fragment@1 { target = <&pio>; __overlay__ { spi0_cs1_pin: spi0-cs1-pin { pins = "PA21"; function = "gpio_out"; output-high; }; ili9341_rst: ili9341-rst { pins = "PA7"; function = "gpio_out"; output-high; }; ili9341_dc: ili9341-dc { pins = "PA8"; function = "gpio_out"; output-high; }; ili9341_led: ili9341-led { pins = "PA9"; function = "gpio_out"; output-high; }; ads7846_pin: ads7846-pin { pins = "PC7"; function = "gpio_in"; }; }; }; fragment@3 { target = <&pio>; __overlay__ { ili9341_pins: ili9341_pins { pins = "PA7", "PA8", "PA9"; /*RESET, DC_RS, LED*/ function = "gpio_out", "gpio_out", "gpio_out" ; }; }; }; fragment@4 { target = <&spi0>; __overlay__ { #address-cells = <1>; #size-cells = <0>; cs_gpios = <0>, <&spi0_cs1_pin>; pinctrl-0 = <&spi0_pins>; status = "okay"; ili9341: ili9341@0 { compatible = "ilitek,ili9341"; reg = <0>; pinctrl-names = "default"; pinctrl-0 = <&ili9341_pins>; status = "okay"; debug = <0>; rotate = <90>; bgr; fps = <10>; buswidth = <8>; regwidth = <16>; reset-gpios = <&pio 0 7 1>; dc-gpios = <&pio 0 8 0>; led-gpios = <&pio 0 9 0>; spi-max-frequency = <1000000>; }; xpt2046: xpt2046@1 { compatible = "ti,ads7846"; reg = <1>; pinctrl-names = "default"; pinctrl-0 = <&spi0_cs1_pin>; interrupts = <&ads7846_pin>; interrupt-parent = <&pio>; pendown_gpio = <&ads7846_pin>; status = "okay"; spi-max-frequency = <1000000>; ti,keep-vref-on = <1>; ti,x-min = /bits/ 16 <00>; ti,x-max = /bits/ 16 <0xFFF>; ti,y-min = /bits/ 16 <00>; ti,y-max = /bits/ 16 <0xFFF>; ti,x-plate-ohms = /bits/ 16 <60>; ti,pressure-max = /bits/ 16 <255>; ti,swap-xy = <0>; }; }; }; }; Now, my display will light up on reboot but I still get no images and no activity. I thought I could force an image on /dev/fb1 using the following command: sudo fbi -vt 1 -noverbose -d /dev/fb1 /boot/boot.bmp but the screen does not change. When I got the fbtft_device working in the legacy kernel, the screen would blank after initialization, so something must still be wrong
-
I'm connecting my Orange PI PC 3.5mm jack to this power amp: HiLetgo 5pcs PAM8403 2x 3W Mini Digital Power Amplifier Board AMP Class D 2.5-5V Input If I connect a 5v 2a power supply to the amp and a 3a 5v power supply to the Orange PI PC, it sounds great with no noise form the Orange PI and no distortion from the amp power supply. If I try to run the amp from the 5v pins on the Orange PI PC with the 3amp 5v supply, it will work, but there is a lot of noise from the main board and the amp does not get enough power to run properly. Should 3a be enough to run both these peripherals? I think the power amp will pull about 600ma, not sure what the Orange PI PC will pull. I also want to connect a small 3.3v 2.8 inch LCD display to the board as well. I think I'll need two supplies to make this work with no interference noise unless there is an isolation trick for the amp. I also don't see wall pugs over 3a if I need more power. Any suggestions?
-
I'm on an Orange PI PC running Armbian_23.08.0-trunk_Orangepipc_bullseye_edge_6.5.1_minimal I've enabled analog audio out the 3.5mm jack using overlays=analog-codec in /boot/armbianEnv.txt I'm connecting the analog 3.5mm jack to a 3watt amp & speakers. It works mostly, but I only get audio on the left channel. Alsa mixer Line Out only allows one channel to be unmuted at a time - left channel or right channel. Left channel sounds pretty good (DAC reversed appears to increase dynamic output). Right channel is very low volume and appears to be "squelched" - is the audio signal reversed from ground or something? Anyway, is there some way to get stereo output working similar to a USB sound card with stereo DAC? I'm currently connecting the left channel to both left/right inputs to my amp and that appears to be working well. Any audiophiles out there get stereo working through the 3.5mm jack?
-
I'm trying to get a HDMI LCD touchscreen working. The pinout is compatible with Orange PI PC except the SPI CS pin is on pin 26 (WPI 11) instead of pin 24 (WPI 10). Is there an easy way to move the SPI CS pin to another GPIO pin? Also, I'm not sure how to properly configure the pen down interrupt pin for pin 22 (WPI 6) So far, I've got the following working: Image: Orangepipc_2.0.8_debian_buster_desktop_linux5.4.65.7z Touchscreen: 3.5 Inch HD HDMI USB LCD Touch Screen 3.5" Display Module 480×320 1920x1080 for Raspberry Pi 3rd 4th Generation 4B/3B+/3B/2B orangepiEnv.txt: overlays=spi-add-cs1 spi-spidev param_spidev_spi_bus=0 param_spidev_spi_cs=0 Luckily, the kernel headers are loaded, so Makefile works. mkdir ds7846 cd ds7846 wget https://sourceforge.net/p/openipmi/linux-ipmi/ci/master/tree/drivers/input/touchscreen/ads7846.c?format=raw mv ads7846.c?format=raw ads7846.c nano Makefile: obj-m := ads7846.o KDIR := /lib/modules/$(shell uname -r)/build PWD := $(shell pwd) all: $(MAKE) -C $(KDIR) M=$(PWD) modules clean: $(MAKE) -C $(KDIR) M=$(PWD) clean install: $(MAKE) -C $(KDIR) M=$(PWD) modules_install make make install depmod cd .. git clone https://github.com/notro/fbtft_tools/ cd fbtft_tools/ads7846_device make make install depmod cd .. sudo nano /etc/modules-load.d/99-ads7846.conf ads7846 ads7846_device sudo nano /etc/modprobe.d/ads7846_device.conf options ads7846_device model=7846 verbose=2 cs=0 gpio_pendown=1 keep_vref_on=1 swap_xy=1 pressure_max=255 x_plate_ohms=60 x_min=200 x_max=3900 y_min=200 y_max=3900 after reboot, the SPI device is there and the touch driver attaches to the port. [ 7.124454] ads7846_device: loading out-of-tree module taints kernel. [ 7.125336] ads7846_device: ads7846_device_init() [ 7.125343] ads7846_device: SPI devices registered: [ 7.125354] ads7846_device: spidev spi0.0 1000kHz 8 bits mode=0x00 [ 7.125357] ads7846_device: [ 7.125366] ads7846_device: Settings: [ 7.125369] ads7846_device: model = 7846 [ 7.125372] ads7846_device: gpio_pendown = 1 [ 7.125375] ads7846_device: swap_xy = 1 [ 7.125378] ads7846_device: x_min = 200 [ 7.125380] ads7846_device: x_max = 3900 [ 7.125383] ads7846_device: y_min = 200 [ 7.125386] ads7846_device: y_max = 3900 [ 7.125388] ads7846_device: x_plate_ohms = 60 [ 7.125391] ads7846_device: pressure_min = 0 [ 7.125393] ads7846_device: pressure_max = 255 [ 7.125396] ads7846_device: keep_vref_on = 1 [ 7.125398] ads7846_device: vref_delay_usecs = 0 [ 7.125401] ads7846_device: vref_mv = 0 [ 7.125403] ads7846_device: settle_delay_usecs = 0 [ 7.125406] ads7846_device: penirq_recheck_delay_usecs = 0 [ 7.125409] ads7846_device: y_plate_ohms = 0 [ 7.125411] ads7846_device: debounce_max = 0 [ 7.125414] ads7846_device: debounce_tol = 0 [ 7.125416] ads7846_device: debounce_rep = 0 [ 7.125425] ads7846_device: Deleting spi0.0 [ 7.126442] ads7846 spi0.0: spi0.0 supply vcc not found, using dummy regulator [ 7.144047] ads7846 spi0.0: touchscreen, irq 65 [ 7.144980] input: ADS7846 Touchscreen as /devices/platform/soc/1c68000.spi/spi_master/spi0/spi0.0/input/input1 [ 7.145055] ads7846_device: SPI devices registered: [ 7.145063] ads7846_device: ads7846 spi0.0 2000kHz 8 bits mode=0x00 [ 7.145066] ads7846_device: Of course, no touch events are detected. Anyone else have any luck getting this to work? I'm not familiar with changing the device tee to move GPIO pins, is there a configuration option for the spi_add_cs1?
-
I got my 320x240 ILI9341 touchscreen to work with the image from the OrangePI site: Armbian_23.5.2_Orangepizero2_bookworm_legacy_4.9.318_minimal The display is one I bought from Amazon Hosyond 2.8 Inches TFT LCD Touch Screen Shield Display Module 320x240 SPI Serial ILI9341 with Touch Pen Compatible with Arduino R3/Mega2560 Development Board This document was very helpful getting the display set up on the OPZero 2: https://tienda.tettsa.gt/wp-content/uploads/2022/08/OrangePi_Zero2_H616_User-manual_v3.7.pdf I still don't have the touch part working. If anyone has success getting 2 selects working with SPI1 on OPZero2 and touch working, let me know. The basic steps to getting the SPI LCD to work are: 1) wire up the display to the OPZero2 2.8 Inch TFT SPI 240x320 => OPZero2 1 - VCC => (1) 3.3v 2 - GND => (6) Gnd 3 - CS => (24) Spi1 CS 4 - RESET => (7) GPIO 6 5 - DC => (11) GPIO 1 6 - SDI (MOSI) => (19) Spi1 MOSI 7 - SCLK => (23) Spi1 CLK 8 - LED => (13) GPIO 0 9 - SDO (MISO) => (21) Spi1 MISO 10 - T_CLK 11 - T_CS 12 - T_DIN 13 - T_DO 14 - T_IRQ 2) Install Armbian_23.5.2_Orangepizero2_bookworm_legacy_4.9.318_minimal - must be legacy kernel to work 4.9 is OK 3) sudo apt install fbi kbd armbian-config 4) sudo armbian-config set up desktop now to make the LCD work and start on boot 5) sudo nano /boot/armbianEnv.txt overlays=spi-spidev param_spidev_spi_bus=1 param_spidev_spi_cs=1 extraargs=fbcon=map:1 6) sudo nano /etc/modules-load.d/fbtft.conf fbtft fbtft_device 7) sudo nano etc/modprobe.d/fbtft.conf options fbtft_device custom name=fb_ili9341 gpios=dc:70,reset:73,led:69 speed=16000000 busnum=1 cs=1 bgr=1 txtbuflen-32768 fps=10 rotate=90 😎 sudo dpkg-reconfigure console-setup select UTF-8 select Guess optimal character set select terminus select 6/12 9) sudo nano /usr/share/X11/xorg.conf.d/99-fbdev.conf Section "Device" Identifier "myfb" Driver "fbdev" Option "fbdev" "/dev/fb1" EndSection Now when it boots it should boot to the SPI LCD Display
