电子说
最近在使用tdc_gp22模块做超声波测距项目,但是在写入0x70,0x05,并产生中断后,读取状态寄存器的的值为0x0408,。按数据手册里的描述,0x0408 & 0x0600 > 0 时即错误。
状态寄存器
//这里是我的寄存器配置 uint8_t config_reg0[]={0x80,0xA3,0x0B,0x68,0x11}; uint8_t config_reg1[]={0x81,0x21,0x44,0x59,0x22}; uint8_t config_reg2[]={0x82,0xA0,0x23,0x00,0x33}; uint8_t config_reg3[]={0x83,0xD8,0xA2,0x48,0x44}; uint8_t config_reg3[]={0x83,0xD8,0x51,0x03,0x44}; uint8_t config_reg4[]={0x84,0x20,0x00,0x4A,0x55}; uint8_t config_reg5[]={0x85,0x40,0x00,0x00,0x66}; uint8_t config_reg6[]={0x86,0xC0,0xC0,0x60,0x77}; tdc_Write(config_reg0,sizeof(config_reg0));HAL_Delay(10); tdc_Write(config_reg1,sizeof(config_reg1));HAL_Delay(10); tdc_Write(config_reg2,sizeof(config_reg2));HAL_Delay(10); tdc_Write(config_reg3,sizeof(config_reg3));HAL_Delay(10); tdc_Write(config_reg4,sizeof(config_reg4));HAL_Delay(10); tdc_Write(config_reg5,sizeof(config_reg5));HAL_Delay(10); tdc_Write(config_reg6,sizeof(config_reg6));HAL_Delay(10);
超声波测量流程
全部0条评论
快来发表一下你的评论吧 !