This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TDC7200: TDC7200 read time BUG!!!

Part Number: TDC7200

Hi all 

i use TDC7200 with stm32f103 in TDC7200 Mode 2 for Measure Tof with one stop pulse

but at my test i  use two digital pulses to TDC start and stop pins after A few pulses i receive 1.049 Second !!!

but at Mode 2 TDC can Measuremax 8ms of tof time i confirm registers with this program can help me to debug my code?

my oscillator clock is 8Mhz 

i most Measure250ns to 8ms of tof 

void TDC7200_Init(void){
	TDC7200_Write8bitREG(TDC_REG_ADD_CONFIG1,0xDA); //trig falling / stop falling / start falling / mode2 /req not active
	TDC7200_Write8bitREG(TDC_REG_ADD_CONFIG2,0x00);
	TDC7200_Set_Stopmask(400);
	TDC7200_SETClock_OVF(0xFFFF);
};

float TDC7200_Readtime(void){
	uint32_t TIME1,TIME2,CALIBRATION1,CALIBRATION2,CALIBRATION2_PERIODS,CLOCK_COUNT1;
	float CLOCK_PERIOD=0.000000125,calCount,normLSB,TOF1;

	TIME1=TDC7200_Read24bitREG(TDC_REG_ADD_TIM1);
	TIME2=TDC7200_Read24bitREG(TDC_REG_ADD_TIM2);
	CALIBRATION1=TDC7200_Read24bitREG(TDC_REG_ADD_Calibration1);
	CALIBRATION2=TDC7200_Read24bitREG(TDC_REG_ADD_Calibration2);
	CALIBRATION2_PERIODS=2;
	CLOCK_COUNT1=TDC7200_Read24bitREG(TDC_REG_ADD_CLOCK_Count1);

	calCount=(CALIBRATION2-CALIBRATION1)/CALIBRATION2_PERIODS-1;
	normLSB=CLOCK_PERIOD/calCount;
	TOF1=TIME1*normLSB+CLOCK_COUNT1*CLOCK_PERIOD-TIME2*normLSB;
	return TOF1;
}