Jump to content

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.

  1. The answer was soldering the left/right/gnd connections directly to the SMD pads and using audio isolation transformers. They eliminated the loud pop when the audio codec kicks in and removed the ground loop causing the amp to draw too much power. The sound is great now.
  2. 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.
  3. 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.
  4. 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?
  5. 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>; }; }; }; };
  6. 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!
  7. 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.
  8. 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?
  9. 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.
  10. 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
  11. The issue with pen down GPIO (PA10) is that the Orange PI PC dts is using it for the power pins: leds { compatible = "gpio-leds"; pwr_led { label = "orangepi:green:pwr"; gpios = <0x46 0x00 0x0a 0x00>; default-state = "on"; }; status_led { label = "orangepi:red:status"; gpios = <0x16 0x00 0x0f 0x00>; }; }; I moved the GPIO to PC7 and got past the GPIO error. I'm still getting SPI error -22. I think there is something wrong with my 2nd SPI CS declaration. Not much progress tonight.
  12. I've tried powering the hat from the header pins using the Orange PI PC board power, but that did not work well. The board would reset when the amp would play. I also tried connecting the power to the hat and powering the Orange PI PC from the header +5v pins, thinking that might help with the voltage drop, same result. It really seems like the power amp + Orange PI PC draws more power than the 5v 3a supply can supply, or it drops the voltage too much. I would think 3a could power the board & amp, but maybe not. I'll hook a scope to it and see what's happening to the power levels. Do I need isolation capacitors (0.1uf + 100k resistor to ground) on the audio output to remove positive voltage bias on the analog output? Am I driving the amp always & draining power?
  13. Getting some more progress... Updated my DTS to the following: /dts-v1/; /plugin/; / { compatible = "allwinner,sun8i-h3"; fragment@1 { target = <&pio>; __overlay__ { spi0_cs1_pin: spi0-cs1-pin { pins = "PA21"; function = "gpio_out"; }; ili9341_rst: ili9341-rst { pins = "PA7"; function = "gpio_out"; }; ili9341_dc: ili9341-dc { pins = "PA8"; function = "gpio_out"; }; ili9341_led: ili9341-led { pins = "PA9"; function = "gpio_out"; output-high; }; ads7846_pin: ads7846-pin { pins = "PA10"; function = "irq"; }; }; }; 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 0 21 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=<1>; rotate = <90>; bgr; fps = <25>; buswidth = <8>; regwidth = <16>; reset-gpios = <&pio 0 7 0>; dc-gpios = <&pio 0 8 0>; led-gpios = <&pio 0 9 0>; }; xpt2046: xpt2046@1 { compatible = "ti,ads7846"; reg = <1>; pinctrl-names = "default"; pinctrl-0 = <&spi0_cs1_pin>; interrupts = <0 10 2>; interrupt-parent = <&pio>; pendown_gpio = <&pio 0 10 0>; 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, the I reboot, my display lights up and I get more info in the logs: [ 5.855178] fbtft: module is from the staging directory, the quality is unknown, you have been warned. [ 5.856536] systemd[1]: Finished Load Kernel Module drm. [ 5.860629] systemd[1]: modprobe@fuse.service: Succeeded. [ 5.862192] systemd[1]: Finished Load Kernel Module fuse. [ 5.870725] fb_ili9341: module is from the staging directory, the quality is unknown, you have been warned. [ 5.871537] fb_ili9341 spi0.0: fbtft_property_value: regwidth = 16 [ 5.871583] fb_ili9341 spi0.0: fbtft_property_value: buswidth = 8 [ 5.871601] fb_ili9341 spi0.0: fbtft_property_value: debug = 1 [ 5.871647] fb_ili9341 spi0.0: fbtft_property_value: fps = 25 [ 5.871990] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'reset' GPIO [ 5.872048] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'dc' GPIO [ 5.872079] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'rd' GPIO [ 5.872105] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'wr' GPIO [ 5.872132] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'cs' GPIO [ 5.872159] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'latch' GPIO [ 5.872185] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'db' GPIO [ 5.872225] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'led' GPIO [ 5.872253] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'aux' GPIO [ 5.872280] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'db' GPIO [ 5.872309] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'led' GPIO [ 5.872335] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'aux' GPIO [ 5.872361] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'db' GPIO [ 5.872388] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'led' GPIO [ 5.872414] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'aux' GPIO [ 5.872440] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'db' GPIO [ 5.872468] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'led' GPIO [ 5.872493] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'aux' GPIO [ 5.872520] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'db' GPIO [ 5.872547] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'led' GPIO [ 5.872573] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'aux' GPIO [ 5.872600] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'db' GPIO [ 5.872627] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'led' GPIO [ 5.872654] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'aux' GPIO [ 5.872681] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'db' GPIO [ 5.872709] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'led' GPIO [ 5.872735] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'aux' GPIO [ 5.872761] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'db' GPIO [ 5.872787] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'led' GPIO [ 5.872814] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'aux' GPIO [ 5.872840] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'db' GPIO [ 5.872867] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'led' GPIO [ 5.872893] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'aux' GPIO [ 5.872919] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'db' GPIO [ 5.872947] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'led' GPIO [ 5.872974] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'aux' GPIO [ 5.873001] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'db' GPIO [ 5.873029] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'led' GPIO [ 5.873084] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'aux' GPIO [ 5.873136] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'db' GPIO [ 5.873185] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'led' GPIO [ 5.873220] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'aux' GPIO [ 5.873249] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'db' GPIO [ 5.873276] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'led' GPIO [ 5.873302] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'aux' GPIO [ 5.873329] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'db' GPIO [ 5.873380] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'led' GPIO [ 5.873432] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'aux' GPIO [ 5.873463] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'db' GPIO [ 5.873514] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'led' GPIO [ 5.873555] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'aux' GPIO [ 5.873583] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'db' GPIO [ 5.873611] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'led' GPIO [ 5.873638] fb_ili9341 spi0.0: fbtft_request_one_gpio: 'aux' GPIO [ 6.139465] graphics fb1: fb_ili9341 frame buffer, 320x240, 150 KiB video memory, 16 KiB buffer memory, fps=25, spi0.0 at 100 MHz [ 6.879396] systemd[1]: Starting Load/Save Screen Backlight Brightness of backlight:fb_ili9341... [ 6.989237] systemd[1]: Finished Load/Save Screen Backlight Brightness of backlight:fb_ili9341. [ 7.220279] SPI driver ads7846 has no spi_device_id for ti,tsc2046 [ 7.220305] SPI driver ads7846 has no spi_device_id for ti,ads7843 [ 7.220313] SPI driver ads7846 has no spi_device_id for ti,ads7845 [ 7.220319] SPI driver ads7846 has no spi_device_id for ti,ads7873 [ 7.220557] ads7846 spi0.1: failed to request pendown GPIO [ 7.220570] ads7846: probe of spi0.1 failed with error -2 However, the display does not blank, so I'm probably missing the init codes. Also, my pin down declarations are not correct. However, I'm getting closer to getting this display to work.
  14. 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?
  15. 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?
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines