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 register config for single stop, no timeout

Other Parts Discussed in Thread: TDC7200, TDC7200EVM

Hi --

I am using the TDC7200 in a simple application that reads a single STOP signal within a range of about 100ns - 125us.  I am having trouble getting the INT_MASK, STOP_MASK, and overflow registers set properly.


I want to signal INTB as soon as the measurement is complete, but it always delays until either COARSE or CLOCK overflows occur, depending on the overflow value I set.  Using INT_MASK 0x01 seems like it should set "interrupt on measurement only", but it still waits for an overflow.


What are the proper register settings to have the TDC complete a measurement and set INTB right after the first STOP pulse, without waiting for overflows?

Thanks!

John

  • John,

    One reason this can happen is if NUM_STOP (in CONFIG2) register is chosen as 2 or 3 but device is seeing only 1 STOP pulse. Is it possible you are not sending the number of STOPs device is expecting? With default INT_MASK register setting, INTB should assert as soon as the expected number of STOP pulses are received and the calibration is done.

    Good to leave STOP_MASK as 0xFFFF unless you want device to start looking for stop only after a certain period chosen in STOP_MASK registers.
    Thanks,
    Vishy
  • Hi Vishy --

    I have commented out all the writes to STOP_MASK and the overflow registers to leave those at default.

    At initialization, I am writing 0x80 into CONFIG2 to set 20 cal periods, then before each measurement writing 0x83 into CONFIG1 to force cal, set mode 2, and enable measurement.

    With those settings, I never get an INTB flag. To ever get a result, I need to set CLOCK_COUNTER_OVF to some amount greater than the TOF, and I get INTB after that time.

    What register values should I be using for this situation (again mode 2, 20 cal periods, one stop)?

    Thanks!
  • John,

    Your register values look correct (CONFIG2 to 0x80 and CONFIG1 to 0x83 before each measurement). Please try with CONFIG1 as 0x03 also (no force calibration).

    Leave other registers default (Correction:STOP_MASK should be left 0x0000 not 0xFFFF as I mention above).

    Do you have a pull up on INTB? INTB is open drain. Are you using the TDC7200EVM or your own board?


    Thanks,
    Vishy
  • Thanks for all the help, Vishy. But I am getting *very* strange results. Basically, if I write 0x80 into CONFIG1 (or 0x00) with everything else as default, I do not get INTB from the chip. If I write 0x81 or larger (ie, 2 stops), then I get INTB but only after about 6ms, which is close to the maximum interval for the 10 MHz clock I'm using.

    It seems like the real problem is that I can't set for just 1 stop event; it requires at least two (0x81) to trigger INTB.

    I am timing slow rate, fast edge (testing with 1 pulse per second) events that last from 300ns to a bit over 100us from START to STOP. This is my own board, and INTB is pulled high -- and I get great performance if I allow measurements to time out. However, I'm trying to speed up the cycle time and this measurement interrupt thing is driving me nuts!
  • John,

    Could you give me some details of your setup? What's your clock frequency?

    Are you using TRIGGER output of TDC7200? We have to make sure START/STOP are happening after TRIGGER goes high (typ 5ns specs from TRIG to START)?

    Are you ensuring START/STOP are rising edge (as per the register bit selection)? Are the signals clean (no bouncing)? Could you share some scope shots?

    Please share how TDC7200 portion of your schematic.

    Thanks,
    Vishy
  • Hi Vishy --

    I am not using the TRIGGER signal (I know...). However, the event rate is low (1 per second for this testing). The loop is pretty much:

    setup // CONFIG2 0x80, but that doesn't work -- only 0X81 through 0x84 work
    while (1) {
    if (!INTB) {
    readchip()
    enablenextreading() // CONFIG1 0x83
    do some calculations and output
    }
    }

    It takes the processor only about 1 millisecond to do all this (other than the time waiting for INTB) and the START event rate is 1 per second (this is running on an Arduino). So the system just loops for almost a second after enabling the next measurement, and I don't believe we are underrunning the setup time.

    I'm not sure I can easily extract the TDC from the multi-page schematic, and the full schematic isn't quite ready for public view at this point. I can email to you if you'd likeut wouldn't want to post it to the forum publicly. One thing to note is that hardware logic guarantees that the START->STOP time will be between 300ns and 1.3us.

    However, if it helps both START and STOP are being driven by on=board 3.3V logic. The clock is at 10 MHz and comes from a reasonably high-quality external timebase (OCXO) through a sine-square converter circuit that is well tested. INTB is pulled up through 1.5K The TDC has the recommended bypass caps, mounted very close to the chip. The board is 4 layers with VCC and ground planes on the inside. None of the TDC-related traces are more than about an inch long.

    What scope shots would be helpful? I can try to take some tomorrow, though at the moment I only have a 100 MHz scope available so may not spot very fast glitches.

    Thanks for your patience helping me work through this.
  • Hi Vishy --

    We have discovered a possible logic glitch that might explain this (or another related) problem. We have some hardware gates that supply the STOP signal to the chip. When INTB triggers after a STOP event, it clears the logic and returns it to a low state.

    It turns out that logic could glitch and lock high at startup, which means the TDC sees STOP before START and it causes problems in other parts of the circuit as well).

    So, we need to assert INTB momentarily after startup to clear that condition.

    Is there a set of register values we can write in our setup routine that would cause INTB to assert regardless of the START or STOP states? That would allow us to clear the logic and then proceed with initialization as normal. If not, we'll have to look at a (hopefully blue-wire) hardware change.

    Thanks!
  • John,
    I am glad you are close to tracking down the issue. I don't really see a register combination to trigger INTB without START/STOP. Writing 1 to the interrupt status bit only clears it, no software based int generation.
    Thanks,
    Vishy