- A口和B口通过一个电阻相连,都是双向IO口,通过上拉电阻连接VDD。FPGA芯片引脚分别与A,B口相接。
A,B口可能存在的问题
某一个口接地
A1,B1口开路
A1,A2短路
B1,B2短路
- IO_test.v主程序模块
module io_test(
inout [29:0] JH2_A, //JH1 A口 30个A口 A_register表示
//
inout [29:0] JH2_B, //JH1 B口 30个B口 B_register表示
input wire clk, //50mhz
input wire rst_n,
input wire clr,
output wire zz, //为了实验激励信号而存在
output reg [30:0] A_out_chk,
output reg [59:0] error_out,error_out1,error_out0,
output reg process,
output reg [59:0] error_out_fifo //上电检测的错误加上不同A_out输出情况反馈回的错误的集合
);
reg [30:0] A_out;
//reg [59:0] error_out,error_out1,error_out0;
/*error_out0 为扫描上电时得出的(接地端口)错误信号;
error_out1 为A口一次输出得出的(A、B开路,B1、B2短路,A1、A2短路)错误信号。*/
//reg process; //if 0,上电检测模式. if 1,短路检测模式.
reg z ; //三态门选通信号
assign zz = ~z;
//---------------------------------------------------------------------------