Jump to content

Recommended Posts

Posted

Hello!

I have orange pi one, and i need to connect 2-ch rs232 hat from waveshare, i tried to do something similar to instruction for raspberry only with replacement to armbianEnv.txt, but it’s not worked. I’m newbie, can anyone describe how i can connect this hat?

  • Werner changed the title to t 2-ch rs232 hat
Posted
30 минут назад, Untronix сказал:

i need to connect 2-ch rs232 hat from waveshare

Question. Can you publish any technical documentation for this device?

Posted
1 час назад, Untronix сказал:

First, you need to connect the pins correctly.

They will be different for your board:

Hardware Connection
232 PIN 	Raspberry Pi (BCM) 	Description
VCC 	    5V 	                3.3/5V Power Input
GND 	    GND 	            Ground
SCLK 	    P21 (SPI1 SCLK) 	SPI Clock Signal Input
MOSI 	    P20 (SPI1 MOSI) 	SPI Data Input
MISO 	    P19 (SPI1 MISO) 	SPI Data Output
CS 	        P18 (SPI1 CS) 	    SPI Chip Select
IRQ 	    P24 	            Interrupt Output 

.

 

Цитата

Software setup

 

Open the terminal and modify the config.txt file by commands:

sudo nano /boot/config.txt

 

Add the line below to the file, the int_pin should be set according to the actual welding:

dtoverlay=sc16is752-spi1,int_pin=24

You need to write the correct overlay file and compile it. Then this instruction.

Posted

/dts-v1/;

/plugin/;

 

/{

   compatible = "allwinner,sun8i-h3";

   fragment@0 {

        target = <&spi0>;  // Targeting SPI0 bus (corrected)

         overlay {

             status = "okay";

             sc16is752: sc16is752@0 {

                 compatible = "nxp,sc16is752";

                 reg = <0>;

                 clocks = <&sc16is752_clk>;

                 interrupt-parent = <&pio>;

                 interrupts = <0 7 2>;

                 gpio-controller;

                 #gpio-cells = <2>;

                 spi-max-frequency = <4000000>;

                 status = "okay";

                 sc16is752_clk: sc16is752_clk {

                     compatible = "fixed-clock";

                     #clock-cells = <0>;

                     clock-frequency = <14745600>; // Clock frequency for SC16IS752

                 };

             };

         };

     };

};

 

created this overlay for this hat, but i have such logs from dmesg

[    2.533014] spi spi0.0: Fixed dependency cycle(s) with /soc/spi@1c68000/sc16is752@0/sc16is752_clk

[    2.533163] sun6i-spi 1c68000.spi: chipselect 0 already in use

[    2.533175] spi_master spi0: spi_device register error /soc/spi@1c68000/spidev@0

[    2.533206] spi_master spi0: Failed to create SPI device for /soc/spi@1c68000/spidev@0

[    8.704292] spi0.0: ttySC0 at I/O 0x0 (irq = 48, base_baud = 921600) is a SC16IS752

[    8.708394] spi0.0: ttySC1 at I/O 0x1 (irq = 48, base_baud = 921600) is a SC16IS752
 Based on this i thought that interfaces are created but not, how i can fix it?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines