本次调试:
测量范围 1(非校准模式)
测量范围 1(非校准模式)
双通道单精度模式
90ps
每个通道接收1个脉冲
地址及寄存器配置值:
`define MS1022_REG_0 32'b00000000000000000001010011111111
`define MS1022_REG_1 32'b00011001010010010000000001010101
`define MS1022_REG_2 32'b00100000000000000000000010101010
`define MS1022_REG_3 32'b00000000000000000000000011111111
`define MS1022_REG_4 32'b00100000000000000000000011111111
`define MS1022_REG_5 32'b00001000000000000000000011111111
`define MS1022_addr0 8'h80 //写入寄存器0地址
`define MS1022_addr1 8'h81 //写入寄存器1地址
`define MS1022_addr2 8'h82 //写入寄存器2地址
`define MS1022_addr3 8'h83 //写入寄存器3地址
`define MS1022_addr4 8'h84 //写入寄存器4地址
`define MS1022_addr5 8'h85 //写入寄存器5地址
`define MS1022_POWER_RST 8'h50 //Power_On_Reset
`define MS1022_INIT 8'h70 //初始化
`define MS1022_ReadRES_0 8'hb0 //读测量结果寄存器
`define MS1022_ReadSTAT 8'hb4 //读状态寄存器
`define MS1022_ReadREG1 8'hb5 //寄存器1中的高8位,用来测试通信
配置步骤:
1、配置上电复位操作码0X50,并延时1ms;
2、配置reg0~reg5等6个寄存器;
3、配置初始化操作码0X70;
4、等待中断,判断中断下降沿;
5、配置操作码0XB0,读回16it数据;
6、循环步骤3~步骤5。
实际测量结果:
TDC接收一个脉冲后,中断会拉低:
中断拉低后,读回结果寄存器0中的数据(非校准模式下16bit)
结果换算:
脉冲飞行时间=RES_0*90ps;
距离(mm)=光速(单位:mm/s) /2 * 脉冲飞行时间*1e-12;