TDC_GP22模块的状态寄存器为0x0408,粗值计算溢出

电子说

1.3w人已加入

描述

最近在使用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);				

单片机

超声波测量流程

 

打开APP阅读更多精彩内容
声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉

全部0条评论

快来发表一下你的评论吧 !

×
20
完善资料,
赚取积分