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.

CCS/TDC7200: Interrupt for a false measurement

Part Number: TDC7200

Tool/software: Code Composer Studio

Hi 

for my application it is very important to get an accurate and fast result from the TDC7200.

Now I ask me, if i get wrong values/glitches and so on, can I handle this wrong value with an interrupt (INTB) to get a new measurement or it is possible to minimze this glitches (see picture below) 
and fix the errors in any other way?

pink: in this case is pink an analog Output which shows glitches and wrong measurements through an DAC.

I read in this Forum and in the datasheet that polling the Interrupt status register make more measurement problems and INTB is only to check a Measurement is complete.

But actually i dont  use the INTB.

when i Implement the INTB what for advantages i get and can i measure after asking INTB a better accurate frequency?

I used an 8MHz reference clock or the TDC the same oscillator which is used in the TDC7200EVM

my measured frequency is between 400 KHz - 1 MHz

The MSP5529 have an MCU Clock 24 MHZ and SPI 12 MHz

Thanks for help!

greets Ben

  • Hi Ben,

    Can you please describe the pink signal? Where is it coming from, and what is it connected to? It's labeled as chip select 1 (unless CS1 stands for something else), but you say it has glitches, which should not happen if the master is controlling it.

    If you do not use INTB, then how do you know when the measurement is completed so that you can read the timing registers? You need to use the INTB to tell the microcontroller when the measurement cycle is finished so it can read the registers. 

    The only other functionality of the INTB pin is to send an interrupt if the clock counters overflow. There is an interrupt mask register that can disable any of these functions, but you really need the INTB measurement complete flag active so that you can know the measurement is done and read the registers before you start a new measurement period.

    Regards,

  • At first I tell you what I try to measure.
    In my Application i want only measure a frequency f=660khZ.
    This means the Start Signal and the Stop Signal have the same input frequency with no delay or something else.

    the pink Signal show the output value of measurement inaccuracies with an digital analog converter after each measurement result.
    when the Pink Signal is HIGH i have a wrong measurement.
    A wrong measurement: TOF= 119790480.000000
    A correct measurement: approx. TOF= 1512.099731

    Then I tried to figure out where the wrong TOF came from:

    my settings in the config register look like this:
    single stop;1 Measurement cycle; 10 clockperiods; Start rising edge stop rising edge; Measure Mode2
    and i figure out that only my TIME 1 register have measure a to big Value.


    normally i get a difference about TIME1-TIME2=approx. 200
    Example:
    TIME1: 541
    TIME2: 320
    or
    TIME1: 2018
    TIME2: 1799

    but sometimes i get such a value
    TIME1: 29086
    TIME2: 1745
    TIME1-TIME2=27341
    this wrong value leads me to the peaks in the Pink Signal.

    After your last reply i added the INTB query for a ready measurement.

    The most Values are perfect and correctly but i need a quick and exactly Measure result!!!
    Now I'm ask me where the wrong TIME value comes from and how I could fix it.

    Could it be an overflow of the Coarse Counter, because the start and stop signal arrive at the same time???


    greets Ben
  • int main(void)
    {
    
    
          WDTCTL = WDTPW | WDTHOLD;              // stop watchdog timer
    
          SPI_init();
    
          for(;;)
          {
          SPI_write_config(0x41,0x40);           // write register address 01h with commands Single Stop/1 Measurement_cycle/ 10 Clock_periods Config1
          SPI_write_config(0x40,0x03);           // write register address 00h with commands Meas Mode2/StartMeas Config1
    
          //wait for INTB pin to go low
          t_inter=0;
                 while(P2IN & BIT6)
                  {
                     t_inter++;
                    if (t_inter >= 200000)
                       break;
                  }
    
          data_einzeln[0] = SPI_read_longbyte(0x10);     // read only one register with bit shifting
          data_einzeln[1] = SPI_read_longbyte(0x11);     // read only one register with bit shifting
          data_einzeln[2] = SPI_read_longbyte(0x12);     // read only one register with bit shifting
          data_einzeln[3] = SPI_read_longbyte(0x1B);     // read only one register with bit shifting
          data_einzeln[4] = SPI_read_longbyte(0x1C);     // read only one register with bit shifting
    
          //SPI_readall_Reg(0x90);                       // autoinc Read register read all registers in an array
          Frequenz_Berechnung();
          SPI_DAC(HIGH_BYTE,LOW_BYTE);
    
          //SPI_write_config(0x40,0x03);
          }
    
    
    }

    here is my main sequence:

  • can anyone help me with this question ??

    greets Ben
  • Hi Ben,

    The time spikes are due to a counter overflow. You can confirm this by reading the INT_STATUS register before starting the next measurement. This is why it is not recommended to input the same signal to both the START and STOP inputs, since it is unreliable whether the STOPs will be registered correctly.

    The best option to resolve this is to MUX the input signal so that it only goes to the START first, then the STOP no earlier than 12ns after the START has been registered. The TRIGG pin can be useful in this as it will only go low after the START signal has arrived.

    Regards,