一、相关参数
字数
2121 字
阅读时间
12 分钟
FPGA芯片型号:XC7A15tcsg324-2
工程名:7A15T_PathSwitch_V1
拨码开关对应通路 XC7A15充当一个”开关箱“的功能
| 序号 | 对应通路 | |
|---|---|---|
| 1 | 00 | FMQL100TAI |
| 2 | 01 | FMQL100TAI |
| 3 | 10 | FMQL45 |
| 4 | 11 | FMQL20S |


接口对应关系
| 信号类型 | 外设侧信号 | FMQL100TAI 对应信号 | FMQL45 对应信号 | FMQL20S 对应信号 |
|---|---|---|---|---|
| RS422 | RS422_7A_TX_5 | RS422_100_TX_5 | RS422_45_TX_5 | RS422_20_TX_5 |
| RS422 | RS422_7A_RX_5 | RS422_100_RX_5 | RS422_45_RX_5 | RS422_20_RX_5 |
| RS422 | RS422_7A_TX_6 | RS422_100_TX_6 | RS422_45_TX_6 | RS422_20_TX_6 |
| RS422 | RS422_7A_RX_6 | RS422_100_RX_6 | RS422_45_RX_6 | RS422_20_RX_6 |
| RS422 | RS422_7A_TX_7 | RS422_100_TX_7 | RS422_45_TX_7 | RS422_20_TX_7 |
| RS422 | RS422_7A_RX_7 | RS422_100_RX_7 | RS422_45_RX_7 | RS422_20_RX_7 |
| RS422 | RS422_7A_TX_8 | RS422_100_TX_8 | RS422_45_TX_8 | RS422_20_TX_8 |
| RS422 | RS422_7A_RX_8 | RS422_100_RX_8 | RS422_45_RX_8 | RS422_20_RX_8 |
| RS485 | RS485_7A_TX_51 | RS485_100_TX_51 | RS485_45_TX_51 | RS485_20_TX_51 |
| RS485 | RS485_7A_RX_51 | RS485_100_RX_51 | RS485_45_RX_51 | RS485_20_RX_51 |
| RS485 | RS485_7A_EN_51 | RS485_100_EN_51 | RS485_45_EN_51 | RS485_20_EN_51 |
| RS485 | RS485_7A_TX_52 | RS485_100_TX_52 | RS485_45_TX_52 | RS485_20_TX_52 |
| RS485 | RS485_7A_RX_52 | RS485_100_RX_52 | RS485_45_RX_52 | RS485_20_RX_52 |
| RS485 | RS485_7A_EN_52 | RS485_100_EN_52 | RS485_45_EN_52 | RS485_20_EN_52 |
| RS485 | RS485_7A_TX_53 | RS485_100_TX_53 | RS485_45_TX_53 | RS485_20_TX_53 |
| RS485 | RS485_7A_RX_53 | RS485_100_RX_53 | RS485_45_RX_53 | RS485_20_RX_53 |
| RS485 | RS485_7A_EN_53 | RS485_100_EN_53 | RS485_45_EN_53 | RS485_20_EN_53 |
| RS485 | RS485_7A_TX_61 | RS485_100_TX_61 | RS485_45_TX_61 | RS485_20_TX_61 |
| RS485 | RS485_7A_RX_61 | RS485_100_RX_61 | RS485_45_RX_61 | RS485_20_RX_61 |
| RS485 | RS485_7A_EN_61 | RS485_100_EN_61 | RS485_45_EN_61 | RS485_20_EN_61 |
| RS485 | RS485_7A_TX_62 | RS485_100_TX_62 | RS485_45_TX_62 | RS485_20_TX_62 |
| RS485 | RS485_7A_RX_62 | RS485_100_RX_62 | RS485_45_RX_62 | RS485_20_RX_62 |
| RS485 | RS485_7A_EN_62 | RS485_100_EN_62 | RS485_45_EN_62 | RS485_20_EN_62 |
| RS485 | RS485_7A_TX_63 | RS485_100_TX_63 | RS485_45_TX_63 | RS485_20_TX_63 |
| RS485 | RS485_7A_RX_63 | RS485_100_RX_63 | RS485_45_RX_63 | RS485_20_RX_63 |
| RS485 | RS485_7A_EN_63 | RS485_100_EN_63 | RS485_45_EN_63 | RS485_20_EN_63 |
| RS485 | RS485_7A_TX_71 | RS485_100_TX_71 | RS485_45_TX_71 | RS485_20_TX_71 |
| RS485 | RS485_7A_RX_71 | RS485_100_RX_71 | RS485_45_RX_71 | RS485_20_RX_71 |
| RS485 | RS485_7A_EN_71 | RS485_100_EN_71 | RS485_45_EN_71 | RS485_20_EN_71 |
| RS485 | RS485_7A_TX_72 | RS485_100_TX_72 | RS485_45_TX_72 | RS485_20_TX_72 |
| RS485 | RS485_7A_RX_72 | RS485_100_RX_72 | RS485_45_RX_72 | RS485_20_RX_72 |
| RS485 | RS485_7A_EN_72 | RS485_100_EN_72 | RS485_45_EN_72 | RS485_20_EN_72 |
| RS485 | RS485_7A_TX_73 | RS485_100_TX_73 | RS485_45_TX_73 | RS485_20_TX_73 |
| RS485 | RS485_7A_RX_73 | RS485_100_RX_73 | RS485_45_RX_73 | RS485_20_RX_73 |
| RS485 | RS485_7A_EN_73 | RS485_100_EN_73 | RS485_45_EN_73 | RS485_20_EN_73 |
| RS485 | RS485_7A_TX_81 | RS485_100_TX_81 | RS485_45_TX_81 | RS485_20_TX_81 |
| RS485 | RS485_7A_RX_81 | RS485_100_RX_81 | RS485_45_RX_81 | RS485_20_RX_81 |
| RS485 | RS485_7A_EN_81 | RS485_100_EN_81 | RS485_45_EN_81 | RS485_20_EN_81 |
| RS485 | RS485_7A_TX_82 | RS485_100_TX_82 | RS485_45_TX_82 | RS485_20_TX_82 |
| RS485 | RS485_7A_RX_82 | RS485_100_RX_82 | RS485_45_RX_82 | RS485_20_RX_82 |
| RS485 | RS485_7A_EN_82 | RS485_100_EN_82 | RS485_45_EN_82 | RS485_20_EN_82 |
| RS485 | RS485_7A_TX_83 | RS485_100_TX_83 | RS485_45_TX_83 | RS485_20_TX_83 |
| RS485 | RS485_7A_RX_83 | RS485_100_RX_83 | RS485_45_RX_83 | RS485_20_RX_83 |
| RS485 | RS485_7A_EN_83 | RS485_100_EN_83 | RS485_45_EN_83 | RS485_20_EN_83 |
二、仿真测试三态门是否可以实现通路选择
写个简单的程序测试一下三态门是否能实现通路选择 核心思路
2.1 swith拨码打拍消抖

2.2 三态门控制通路选择

2.3 仿真结果
00:通道关闭 01:100t打开 10:54打开 11:通道关闭 符合预期结果 
就不上板测试了,接下来就是把大量的信号线移植到这段程序里 代码如下(代码文件在工程)
三、设计思路
为方便移植和增减接口 设计成 422子模块+485子模块的模式 需要几个422就例化几个422就可以了。 
仿真调试 
四、调试遇到问题
问题一:
用三阻态控制,总线悬空怎么办,会不会有影响 还是说默认接某个芯片(100t)
答:。所以00和01都设计成对应100TAI。
问题二: 485的en信号是单向的吗,是fpga控制485芯片的单向en
五、最终代码
verilog
`timescale 1ns / 1ps
// 单路RS422通路选择器子模块
// (仅切换逻辑,无消抖,机械拨码消抖要放在子模块外)
// mode_stable(2位输入)映射规则:
// 00 = FMQL100TAI ,
// 01 = FMQL100TAI ,
// 10 = FMQL45 ,
// 11 = FMQL20S
module channel_switch_422 (
input [1:0] mode_stable, // 2位稳定模式选择(已在子模块外部消抖)
// 主侧 7A FPGA
input rx_7a, // 7A接收端(来自外部)
output tx_7a, // 7A发送端(输出到外部)
// 从侧1:FMQL100TAI
input rx_100, // 100TAI接收端
output tx_100, // 100TAI发送端
// 从侧2:FMQL45
input rx_45, // 45接收端
output tx_45, // 45发送端
// 从侧3:FMQL20S
input rx_20, // 20S接收端
output tx_20 // 20S发送端
);
// 422接口 -> 7A -> 目标芯片
assign tx_100 = ((mode_stable == 2'b00) || (mode_stable == 2'b01)) ? rx_7a : 1'bz;
assign tx_45 = (mode_stable == 2'b10) ? rx_7a : 1'bz;
assign tx_20 = (mode_stable == 2'b11) ? rx_7a : 1'bz;
// 目标芯片 -> 7A -> 422接口
assign tx_7a = ((mode_stable == 2'b00) || (mode_stable == 2'b01)) ? rx_100 :
(mode_stable == 2'b10) ? rx_45 :
(mode_stable == 2'b11) ? rx_20 : 1'bz;
endmoduleverilog
`timescale 1ns / 1ps
// 单路RS485通路选择器子模块
// (仅切换逻辑,无消抖,机械拨码消抖要放在子模块外)
// mode_stable(2位输入)映射规则:
// 00 = FMQL100TAI ,
// 01 = FMQL100TAI ,
// 10 = FMQL45 ,
// 11 = FMQL20S
module channel_switch_485 (
input [1:0] mode_stable,
// 主侧 7A
input rx_7a, // 7A接收端(来自485芯片RX)
output tx_7a, // 7A发送端(输出到485芯片TX)
output en_7a, // 7A使能端(输出到485芯片EN/DE)
// 从侧1:100TAI
input rx_100,
input en_100,
output tx_100,
// 从侧2:45
input rx_45,
input en_45,
output tx_45,
// 从侧3:20S
input rx_20,
input en_20,
output tx_20
);
// 485接口 -> 7A -> 目标芯片
assign tx_100 = ((mode_stable == 2'b00) || (mode_stable == 2'b01)) ? rx_7a : 1'bz;
assign tx_45 = (mode_stable == 2'b10) ? rx_7a : 1'bz;
assign tx_20 = (mode_stable == 2'b11) ? rx_7a : 1'bz;
// 目标芯片 -> 7A -> 485接口
assign tx_7a = ((mode_stable == 2'b00) || (mode_stable == 2'b01)) ? rx_100 :
(mode_stable == 2'b10) ? rx_45 :
(mode_stable == 2'b11) ? rx_20 : 1'bz;
// EN/DE引脚禁止悬空!未选中时输出低电平(禁用收发),避免硬件乱码
assign en_7a = ((mode_stable == 2'b00) || (mode_stable == 2'b01)) ? en_100 :
(mode_stable == 2'b10) ? en_45 :
(mode_stable == 2'b11) ? en_20 : 1'b0;
endmoduleverilog
`timescale 1ns / 1ps
module top_rs_switch (
// 系统
input clk_50m,
input rst_n,
// 2位拨码开关(外部消抖一次,全局共用)
input [1:0] sw,
// ================================ RS422 通道 5/6/7/8 ================================
// 7A 主侧
input RS422_7A_RX_5, output RS422_7A_TX_5,
input RS422_7A_RX_6, output RS422_7A_TX_6,
input RS422_7A_RX_7, output RS422_7A_TX_7,
input RS422_7A_RX_8, output RS422_7A_TX_8,
// FMQL100TAI
input RS422_100_RX_5, output RS422_100_TX_5,
input RS422_100_RX_6, output RS422_100_TX_6,
input RS422_100_RX_7, output RS422_100_TX_7,
input RS422_100_RX_8, output RS422_100_TX_8,
// FMQL45
input RS422_45_RX_5, output RS422_45_TX_5,
input RS422_45_RX_6, output RS422_45_TX_6,
input RS422_45_RX_7, output RS422_45_TX_7,
input RS422_45_RX_8, output RS422_45_TX_8,
// FMQL20S
input RS422_20_RX_5, output RS422_20_TX_5,
input RS422_20_RX_6, output RS422_20_TX_6,
input RS422_20_RX_7, output RS422_20_TX_7,
input RS422_20_RX_8, output RS422_20_TX_8,
// ================================ RS485 全通道 ================================
// === 51/52/53 ===
input RS485_7A_RX_51, output RS485_7A_TX_51, output RS485_7A_EN_51,
input RS485_7A_RX_52, output RS485_7A_TX_52, output RS485_7A_EN_52,
input RS485_7A_RX_53, output RS485_7A_TX_53, output RS485_7A_EN_53,
input RS485_100_RX_51, output RS485_100_TX_51, input RS485_100_EN_51,
input RS485_100_RX_52, output RS485_100_TX_52, input RS485_100_EN_52,
input RS485_100_RX_53, output RS485_100_TX_53, input RS485_100_EN_53,
input RS485_45_RX_51, output RS485_45_TX_51, input RS485_45_EN_51,
input RS485_45_RX_52, output RS485_45_TX_52, input RS485_45_EN_52,
input RS485_45_RX_53, output RS485_45_TX_53, input RS485_45_EN_53,
input RS485_20_RX_51, output RS485_20_TX_51, input RS485_20_EN_51,
input RS485_20_RX_52, output RS485_20_TX_52, input RS485_20_EN_52,
input RS485_20_RX_53, output RS485_20_TX_53, input RS485_20_EN_53,
// === 61/62/63 ===
input RS485_7A_RX_61, output RS485_7A_TX_61, output RS485_7A_EN_61,
input RS485_7A_RX_62, output RS485_7A_TX_62, output RS485_7A_EN_62,
input RS485_7A_RX_63, output RS485_7A_TX_63, output RS485_7A_EN_63,
input RS485_100_RX_61, output RS485_100_TX_61, input RS485_100_EN_61,
input RS485_100_RX_62, output RS485_100_TX_62, input RS485_100_EN_62,
input RS485_100_RX_63, output RS485_100_TX_63, input RS485_100_EN_63,
input RS485_45_RX_61, output RS485_45_TX_61, input RS485_45_EN_61,
input RS485_45_RX_62, output RS485_45_TX_62, input RS485_45_EN_62,
input RS485_45_RX_63, output RS485_45_TX_63, input RS485_45_EN_63,
input RS485_20_RX_61, output RS485_20_TX_61, input RS485_20_EN_61,
input RS485_20_RX_62, output RS485_20_TX_62, input RS485_20_EN_62,
input RS485_20_RX_63, output RS485_20_TX_63, input RS485_20_EN_63,
// === 71/72/73 ===
input RS485_7A_RX_71, output RS485_7A_TX_71, output RS485_7A_EN_71,
input RS485_7A_RX_72, output RS485_7A_TX_72, output RS485_7A_EN_72,
input RS485_7A_RX_73, output RS485_7A_TX_73, output RS485_7A_EN_73,
input RS485_100_RX_71, output RS485_100_TX_71, input RS485_100_EN_71,
input RS485_100_RX_72, output RS485_100_TX_72, input RS485_100_EN_72,
input RS485_100_RX_73, output RS485_100_TX_73, input RS485_100_EN_73,
input RS485_45_RX_71, output RS485_45_TX_71, input RS485_45_EN_71,
input RS485_45_RX_72, output RS485_45_TX_72, input RS485_45_EN_72,
input RS485_45_RX_73, output RS485_45_TX_73, input RS485_45_EN_73,
input RS485_20_RX_71, output RS485_20_TX_71, input RS485_20_EN_71,
input RS485_20_RX_72, output RS485_20_TX_72, input RS485_20_EN_72,
input RS485_20_RX_73, output RS485_20_TX_73, input RS485_20_EN_73,
// === 81/82/83 ===
input RS485_7A_RX_81, output RS485_7A_TX_81, output RS485_7A_EN_81,
input RS485_7A_RX_82, output RS485_7A_TX_82, output RS485_7A_EN_82,
input RS485_7A_RX_83, output RS485_7A_TX_83, output RS485_7A_EN_83,
input RS485_100_RX_81, output RS485_100_TX_81, input RS485_100_EN_81,
input RS485_100_RX_82, output RS485_100_TX_82, input RS485_100_EN_82,
input RS485_100_RX_83, output RS485_100_TX_83, input RS485_100_EN_83,
input RS485_45_RX_81, output RS485_45_TX_81, input RS485_45_EN_81,
input RS485_45_RX_82, output RS485_45_TX_82, input RS485_45_EN_82,
input RS485_45_RX_83, output RS485_45_TX_83, input RS485_45_EN_83,
input RS485_20_RX_81, output RS485_20_TX_81, input RS485_20_EN_81,
input RS485_20_RX_82, output RS485_20_TX_82, input RS485_20_EN_82,
input RS485_20_RX_83, output RS485_20_TX_83, input RS485_20_EN_83
);
// ===================================================================================
// 全局拨码开关消抖(只做一次,所有通道共用)
// ===================================================================================
reg [1:0] sw_r1, sw_r2, sw_r3;
always @(posedge clk_50m or negedge rst_n) begin
if (!rst_n) begin
sw_r1 <= 2'b00;
sw_r2 <= 2'b00;
sw_r3 <= 2'b00;
end else begin
sw_r1 <= sw;
sw_r2 <= sw_r1;
sw_r3 <= sw_r2;
end
end
wire [1:0] mode_stable = sw_r3;
// ===================================================================================
// RS422 通道 5/6/7/8 例化
// ===================================================================================
channel_switch_422 u_rs422_ch5 (
.mode_stable (mode_stable),
.rx_7a (RS422_7A_RX_5),
.tx_7a (RS422_7A_TX_5),
.rx_100 (RS422_100_RX_5),
.tx_100 (RS422_100_TX_5),
.rx_45 (RS422_45_RX_5),
.tx_45 (RS422_45_TX_5),
.rx_20 (RS422_20_RX_5),
.tx_20 (RS422_20_TX_5)
);
channel_switch_422 u_rs422_ch6 (
.mode_stable (mode_stable),
.rx_7a (RS422_7A_RX_6),
.tx_7a (RS422_7A_TX_6),
.rx_100 (RS422_100_RX_6),
.tx_100 (RS422_100_TX_6),
.rx_45 (RS422_45_RX_6),
.tx_45 (RS422_45_TX_6),
.rx_20 (RS422_20_RX_6),
.tx_20 (RS422_20_TX_6)
);
channel_switch_422 u_rs422_ch7 (
.mode_stable (mode_stable),
.rx_7a (RS422_7A_RX_7),
.tx_7a (RS422_7A_TX_7),
.rx_100 (RS422_100_RX_7),
.tx_100 (RS422_100_TX_7),
.rx_45 (RS422_45_RX_7),
.tx_45 (RS422_45_TX_7),
.rx_20 (RS422_20_RX_7),
.tx_20 (RS422_20_TX_7)
);
channel_switch_422 u_rs422_ch8 (
.mode_stable (mode_stable),
.rx_7a (RS422_7A_RX_8),
.tx_7a (RS422_7A_TX_8),
.rx_100 (RS422_100_RX_8),
.tx_100 (RS422_100_TX_8),
.rx_45 (RS422_45_RX_8),
.tx_45 (RS422_45_TX_8),
.rx_20 (RS422_20_RX_8),
.tx_20 (RS422_20_TX_8)
);
// ===================================================================================
// RS485 通道:51/52/53
// ===================================================================================
channel_switch_485 u_rs485_ch51 (
.mode_stable (mode_stable),
.rx_7a (RS485_7A_RX_51),
.tx_7a (RS485_7A_TX_51),
.en_7a (RS485_7A_EN_51),
.rx_100 (RS485_100_RX_51),
.en_100 (RS485_100_EN_51),
.tx_100 (RS485_100_TX_51),
.rx_45 (RS485_45_RX_51),
.en_45 (RS485_45_EN_51),
.tx_45 (RS485_45_TX_51),
.rx_20 (RS485_20_RX_51),
.en_20 (RS485_20_EN_51),
.tx_20 (RS485_20_TX_51)
);
channel_switch_485 u_rs485_ch52 (
.mode_stable (mode_stable),
.rx_7a (RS485_7A_RX_52),
.tx_7a (RS485_7A_TX_52),
.en_7a (RS485_7A_EN_52),
.rx_100 (RS485_100_RX_52),
.en_100 (RS485_100_EN_52),
.tx_100 (RS485_100_TX_52),
.rx_45 (RS485_45_RX_52),
.en_45 (RS485_45_EN_52),
.tx_45 (RS485_45_TX_52),
.rx_20 (RS485_20_RX_52),
.en_20 (RS485_20_EN_52),
.tx_20 (RS485_20_TX_52)
);
channel_switch_485 u_rs485_ch53 (
.mode_stable (mode_stable),
.rx_7a (RS485_7A_RX_53),
.tx_7a (RS485_7A_TX_53),
.en_7a (RS485_7A_EN_53),
.rx_100 (RS485_100_RX_53),
.en_100 (RS485_100_EN_53),
.tx_100 (RS485_100_TX_53),
.rx_45 (RS485_45_RX_53),
.en_45 (RS485_45_EN_53),
.tx_45 (RS485_45_TX_53),
.rx_20 (RS485_20_RX_53),
.en_20 (RS485_20_EN_53),
.tx_20 (RS485_20_TX_53)
);
// ===================================================================================
// RS485 通道:61/62/63
// ===================================================================================
channel_switch_485 u_rs485_ch61 (
.mode_stable (mode_stable),
.rx_7a (RS485_7A_RX_61),
.tx_7a (RS485_7A_TX_61),
.en_7a (RS485_7A_EN_61),
.rx_100 (RS485_100_RX_61),
.en_100 (RS485_100_EN_61),
.tx_100 (RS485_100_TX_61),
.rx_45 (RS485_45_RX_61),
.en_45 (RS485_45_EN_61),
.tx_45 (RS485_45_TX_61),
.rx_20 (RS485_20_RX_61),
.en_20 (RS485_20_EN_61),
.tx_20 (RS485_20_TX_61)
);
channel_switch_485 u_rs485_ch62 (
.mode_stable (mode_stable),
.rx_7a (RS485_7A_RX_62),
.tx_7a (RS485_7A_TX_62),
.en_7a (RS485_7A_EN_62),
.rx_100 (RS485_100_RX_62),
.en_100 (RS485_100_EN_62),
.tx_100 (RS485_100_TX_62),
.rx_45 (RS485_45_RX_62),
.en_45 (RS485_45_EN_62),
.tx_45 (RS485_45_TX_62),
.rx_20 (RS485_20_RX_62),
.en_20 (RS485_20_EN_62),
.tx_20 (RS485_20_TX_62)
);
channel_switch_485 u_rs485_ch63 (
.mode_stable (mode_stable),
.rx_7a (RS485_7A_RX_63),
.tx_7a (RS485_7A_TX_63),
.en_7a (RS485_7A_EN_63),
.rx_100 (RS485_100_RX_63),
.en_100 (RS485_100_EN_63),
.tx_100 (RS485_100_TX_63),
.rx_45 (RS485_45_RX_63),
.en_45 (RS485_45_EN_63),
.tx_45 (RS485_45_TX_63),
.rx_20 (RS485_20_RX_63),
.en_20 (RS485_20_EN_63),
.tx_20 (RS485_20_TX_63)
);
// ===================================================================================
// RS485 通道:71/72/73
// ===================================================================================
channel_switch_485 u_rs485_ch71 (
.mode_stable (mode_stable),
.rx_7a (RS485_7A_RX_71),
.tx_7a (RS485_7A_TX_71),
.en_7a (RS485_7A_EN_71),
.rx_100 (RS485_100_RX_71),
.en_100 (RS485_100_EN_71),
.tx_100 (RS485_100_TX_71),
.rx_45 (RS485_45_RX_71),
.en_45 (RS485_45_EN_71),
.tx_45 (RS485_45_TX_71),
.rx_20 (RS485_20_RX_71),
.en_20 (RS485_20_EN_71),
.tx_20 (RS485_20_TX_71)
);
channel_switch_485 u_rs485_ch72 (
.mode_stable (mode_stable),
.rx_7a (RS485_7A_RX_72),
.tx_7a (RS485_7A_TX_72),
.en_7a (RS485_7A_EN_72),
.rx_100 (RS485_100_RX_72),
.en_100 (RS485_100_EN_72),
.tx_100 (RS485_100_TX_72),
.rx_45 (RS485_45_RX_72),
.en_45 (RS485_45_EN_72),
.tx_45 (RS485_45_TX_72),
.rx_20 (RS485_20_RX_72),
.en_20 (RS485_20_EN_72),
.tx_20 (RS485_20_TX_72)
);
channel_switch_485 u_rs485_ch73 (
.mode_stable (mode_stable),
.rx_7a (RS485_7A_RX_73),
.tx_7a (RS485_7A_TX_73),
.en_7a (RS485_7A_EN_73),
.rx_100 (RS485_100_RX_73),
.en_100 (RS485_100_EN_73),
.tx_100 (RS485_100_TX_73),
.rx_45 (RS485_45_RX_73),
.en_45 (RS485_45_EN_73),
.tx_45 (RS485_45_TX_73),
.rx_20 (RS485_20_RX_73),
.en_20 (RS485_20_EN_73),
.tx_20 (RS485_20_TX_73)
);
// ===================================================================================
// RS485 通道:81/82/83
// ===================================================================================
channel_switch_485 u_rs485_ch81 (
.mode_stable (mode_stable),
.rx_7a (RS485_7A_RX_81),
.tx_7a (RS485_7A_TX_81),
.en_7a (RS485_7A_EN_81),
.rx_100 (RS485_100_RX_81),
.en_100 (RS485_100_EN_81),
.tx_100 (RS485_100_TX_81),
.rx_45 (RS485_45_RX_81),
.en_45 (RS485_45_EN_81),
.tx_45 (RS485_45_TX_81),
.rx_20 (RS485_20_RX_81),
.en_20 (RS485_20_EN_81),
.tx_20 (RS485_20_TX_81)
);
channel_switch_485 u_rs485_ch82 (
.mode_stable (mode_stable),
.rx_7a (RS485_7A_RX_82),
.tx_7a (RS485_7A_TX_82),
.en_7a (RS485_7A_EN_82),
.rx_100 (RS485_100_RX_82),
.en_100 (RS485_100_EN_82),
.tx_100 (RS485_100_TX_82),
.rx_45 (RS485_45_RX_82),
.en_45 (RS485_45_EN_82),
.tx_45 (RS485_45_TX_82),
.rx_20 (RS485_20_RX_82),
.en_20 (RS485_20_EN_82),
.tx_20 (RS485_20_TX_82)
);
channel_switch_485 u_rs485_ch83 (
.mode_stable (mode_stable),
.rx_7a (RS485_7A_RX_83),
.tx_7a (RS485_7A_TX_83),
.en_7a (RS485_7A_EN_83),
.rx_100 (RS485_100_RX_83),
.en_100 (RS485_100_EN_83),
.tx_100 (RS485_100_TX_83),
.rx_45 (RS485_45_RX_83),
.en_45 (RS485_45_EN_83),
.tx_45 (RS485_45_TX_83),
.rx_20 (RS485_20_RX_83),
.en_20 (RS485_20_EN_83),
.tx_20 (RS485_20_TX_83)
);
endmodule