TS-7250-V3 TS-SER4: Difference between revisions

From embeddedTS Manuals
No edit summary
No edit summary
 
(9 intermediate revisions by 3 users not shown)
Line 6: Line 6:
|labelstyle  = width:33%
|labelstyle  = width:33%
|datastyle    =  
|datastyle    =  
|data1        = [http://www.embeddedarm.com/products/board-detail.php?product=TS-SER4 Product Page]
|data1        = [http://www.embeddedTS.com/products/board-detail.php?product=TS-SER4 Product Page]
|header2      = 8-bit IO
|header2      = 8-bit IO
}}
}}


The TS-SER4 supports 4 UARTs as RS-232, RS-485, or RS-422.
The TS-SER4 supports 4 UARTs as RS-232, RS-485, or RS-422.  Refer to the [[TS-SER4|TS-SER4 manual for hardware documentation]].


Refer to the [[TS-SER4|TS-SER4 manual for hardware documentation]].
{{:TS-7250-V3 16550 Notes}}


The TS-SER4 implements 16550A based UARTs which require a kernel driver. 
This below example will set up the serial devices for a TS-SER4 with the IRQ2, IRQ4 (selects IRQ6), and COM1 jumpers installed. Open the device tree at arch/arm/boot/dts/imx6ul-ts7250v3.dtsi.  Add the highlighted section to the device tree and recompile.
 
<source lang=json highlight="6-40" line>
Under Linux this requires a device tree change.  See the [[#Compile the kernel|Kernel compile section]] for more details about getting set up the compile the kernel.
 
For example, with the IRQ2,IRQ6, and COM1 jumpers installed.
 
Open the device tree at arch/arm/boot/dts/imx6ul-ts7250v3.dts:
<source lang=json line highlight="13-55">
pc104bus: fpgaisa@50 {
pc104bus: fpgaisa@50 {
compatible = "technologic,pc104-bus";
    ...
reg = <0x50 0x4>;
 
ranges = <0 0 0x1000>;
reset-gpio = <&gpio3 7 0>;
 
#address-cells = <0x1>;
#address-cells = <0x1>;
#size-cells = <0x1>;
#size-cells = <0x1>;
status = "okay";


/* COMA */
/* COMA */
Line 40: Line 27:
reg = <0x3f8 8>;
reg = <0x3f8 8>;
interrupt-parent = <&fpga_intc>;
interrupt-parent = <&fpga_intc>;
interrupts = <15>;
interrupts = <15 IRQ_TYPE_LEVEL_HIGH>;
 
status = "okay";
};
};


Line 51: Line 36:
reg = <0x2f8 8>;
reg = <0x2f8 8>;
interrupt-parent = <&fpga_intc>;
interrupt-parent = <&fpga_intc>;
interrupts = <15>;
interrupts = <15 IRQ_TYPE_LEVEL_HIGH>;
 
status = "okay";
};
};


Line 62: Line 45:
reg = <0x3e8 8>;
reg = <0x3e8 8>;
interrupt-parent = <&fpga_intc>;
interrupt-parent = <&fpga_intc>;
interrupts = <15>;
interrupts = <15 IRQ_TYPE_LEVEL_HIGH>;
 
status = "okay";
};
};


Line 73: Line 54:
reg = <0x2e8 8>;
reg = <0x2e8 8>;
interrupt-parent = <&fpga_intc>;
interrupt-parent = <&fpga_intc>;
interrupts = <15>;
interrupts = <15 IRQ_TYPE_LEVEL_HIGH>;
 
status = "okay";
};
};
};
};
</source>
</source>
On the next boot check the "dmesg" output to verify it loaded:
<console>
root@tsimx6:~# dmesg | grep ts16550
[    2.259413] ts16550 50004050.fpgaisa:ts16550@3f8: Adding 16550 UART ttyS0
[    2.268166] ts16550 50004050.fpgaisa:ts16550@2f8: Adding 16550 UART ttyS1
[    2.278539] ts16550 50004050.fpgaisa:ts16550@3e8: Adding 16550 UART ttyS2
[    2.287455] ts16550 50004050.fpgaisa:ts16550@2e8: Adding 16550 UART ttyS3
</console>
Now that these are loaded:
{|class=wikitable
|-
! Device
! Description
|-
| /dev/ttyS0
| COMA
|-
| /dev/ttyS1
| COMB
|-
| /dev/ttyS3
| COMC
|-
| /dev/ttyS4
| COMD
|}

Latest revision as of 10:37, 29 September 2023

TS-SER4
Ts-ser4.jpg
Product Page
8-bit IO

The TS-SER4 supports 4 UARTs as RS-232, RS-485, or RS-422. Refer to the TS-SER4 manual for hardware documentation.

This peripheral implements 16550A based UARTs which require a kernel driver. Under Linux this requires a device tree change. See the Kernel compile section for more details about getting set up the compile the kernel.

In general for 16550 UARTs we recommend these kernel config options:

CONFIG_HZ_PERIODIC=y
CONFIG_HZ_1000=y
CONFIG_SERIAL_8250_TS=y

The default kernel is ideal for low power, but has some tradeoffs with latency. A 16550 only has a 16 byte FIFO and needs to be serviced with relatively low latency, so a the above options make the latency far more deterministic. These changes are necessary to run at 115200 and not drop any data.

This below example will set up the serial devices for a TS-SER4 with the IRQ2, IRQ4 (selects IRQ6), and COM1 jumpers installed. Open the device tree at arch/arm/boot/dts/imx6ul-ts7250v3.dtsi. Add the highlighted section to the device tree and recompile.

pc104bus: fpgaisa@50 {
    ...
	#address-cells = <0x1>;
	#size-cells = <0x1>;

	/* COMA */
	ts16550@3f8 {
		compatible = "technologic,ts16550";

		reg = <0x3f8 8>;
		interrupt-parent = <&fpga_intc>;
		interrupts = <15 IRQ_TYPE_LEVEL_HIGH>;
	};

	/* COMB */
	ts16550@2f8 {
		compatible = "technologic,ts16550";

		reg = <0x2f8 8>;
		interrupt-parent = <&fpga_intc>;
		interrupts = <15 IRQ_TYPE_LEVEL_HIGH>;
	};

	/* COMC */
	ts16550@3e8 {
		compatible = "technologic,ts16550";

		reg = <0x3e8 8>;
		interrupt-parent = <&fpga_intc>;
		interrupts = <15 IRQ_TYPE_LEVEL_HIGH>;
	};

	/* COMD */
	ts16550@2e8 {
		compatible = "technologic,ts16550";

		reg = <0x2e8 8>;
		interrupt-parent = <&fpga_intc>;
		interrupts = <15 IRQ_TYPE_LEVEL_HIGH>;
	};
};

On the next boot check the "dmesg" output to verify it loaded:

root@tsimx6:~# dmesg | grep ts16550
[    2.259413] ts16550 50004050.fpgaisa:ts16550@3f8: Adding 16550 UART ttyS0
[    2.268166] ts16550 50004050.fpgaisa:ts16550@2f8: Adding 16550 UART ttyS1
[    2.278539] ts16550 50004050.fpgaisa:ts16550@3e8: Adding 16550 UART ttyS2
[    2.287455] ts16550 50004050.fpgaisa:ts16550@2e8: Adding 16550 UART ttyS3

Now that these are loaded:

Device Description
/dev/ttyS0 COMA
/dev/ttyS1 COMB
/dev/ttyS3 COMC
/dev/ttyS4 COMD