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: No interrupt after receiving START and STOP

Part Number: TDC7200
Other Parts Discussed in Thread: TDC1011

Currently using the TDC7200 along with the TDC1011PWR to determine time-of flight.

We are getting the trigger out of the TDC7200 when we write to Config0 bit 0 and the TDC1011PWR is giving us the START then 32uS later the TDC1011PWR is giving us the STOP, the problem is we are never seeing the INTB going low and when we read the interrupt mask register we get 0xFF.

The clock into the TDC7200 is shared with the TDC1011PWR and is a 6MHz clock and we are programming the TDC7200 for "Measurement Mode 2" .

Looking at only the first TOF, if we do the math, then the STOP = 32uS with a 6MHz clock we are at a "CLOCK_COUNT1" = 204 (0xC8) so we set the CLOCK COUNTER OVERFLOW = 0xCA and the CLOCK COUNTER STOP MASK = 0xC2 so that the overflow interrupt would not halt the measurement.

The following are the registers and what values we are storing into them before we send the START_MEAS bit.

Name  (Address) = Value written
Confg1 (0x00) = 0x40,

Confg2 (0x01) = 0x00, 

IRQ_St (0x02) = 0x1F,

Int_Mask (0x03) = 0x04  

CCOH (0x04) = 0x00,

CCOL = (0x05) = 0x02

CLCOH (0x06) = 0x00

CLCOL (0x07) = 0xCA

CLCMH (0x08) = 0x00

CLCML (0x09) = 0xC2

Can you see any issues with the values we loaded the above registers with?

Are there additional registers we need to make changes from the default values in order to get the INTB to toggle?

Any help would be appreciated.

Thanks

  • Hello,

    The register settings look okay. I see you write a 1 for the MEAS_STARTED_FLAG and MEAS_COMPLETE_FLAG, to clear them, which is fine. Do you also read a 1 for these after the INTB pin should have gone low? 

    Also, please make sure that the INTB pin is has a 10k ohm pullup resistor attached (to 3.3V). 

    Another possible cause of missing INTB is mentioned here

    Regards,

    Gabriel

  • Hi Gabriel,

    We do have a 10k pull-up on INTB.

    I looked at the thread that you sent and in that case the problem seems to be that the TDC7200 is sending the TRIG, and consequently getting the START, before the TDC7200 SPI-CS# is asserted back high, which seems like a problem the TDC7200 should wait until the TDC7200 SPI-CS# is asserted back high before performing any operation.

    Not sure why programming the for TDC1011 SHORT-TOF should effect the TDC7200, they should be independent the TDC7200 should provide trigger and not care what the TDC1011 is programmed too the TDC7200 should look for START and STOP to perform its job.

    But when I program the TDC1011 for SHORT-TOF the trigger from the TDC7200 is extended and TDC7200 SPI-CS# is asserted back high before the START, how does the TDC7200 know what the TDC1011 is programmed too?

    In either case that the TDC1011 is programmed too (standard TOF or SHORT-TOF) I still do not get any INTB. In fact after I initiate the START-MEAS command to the TDC7200 I cannot read any registers, I can read them back before initiating the START-MEAS, so somehow the TDC7200 SPI is getting locked up.

    See attached document for waveforms, let me know if they get uploaded.

    ThanksTDC1011 programmed for TOF.pdf

  • Hi,  

    First, a few comments: 

    - I would set the TDC1011 NUM_RX to match the number of stops expected by the TDC7200.

    - These devices are not designed for SPI communication to be active at any time during the progress of a measurement, and doing so could interrupt a measurement. CS should remain high for the duration of the measurement, which should be controlled by the host device. 

    For debugging INTB: Next I recommend trying a test with a single START and STOP, probing START, STOP, TRIGG, and INTB, with no SPI communication initiated during the measurement. After INTB (or a delay period, if INTB does not go low), read the INT_STATUS registers. If the scope plot and status registers look fine but INTB is malfunctioning, then I suggest trying again with default device settings and going from there. If the problem persists, I would suspect a board or device issue to be the cause. 

    Regards,

    Gabriel

  • Hi Gabriel,

    We have the NUM_RX on both devices set to the same value = 1.

    The TDC7200 SPI-CS# that you see in the screen captures that were sent are when the processor is sending the START-MEAS command to the TDC7200, nothing we can do about that in standard TOF the TDC7200 is sending the trigger before the processor is done sending the START-MEAS command. In the case of the short TOF, for some reason that I cannot figure out, the trigger command is staying high longer so the TDC7200 SPI-CS# has the chance to go high before the START is sent to the TDC1011.

    I have run the debug test that you suggest many, many times with the same results using a scope that INTB never goes low. We have used multiple boards with the same results. We start by issueing the START-MEAS command to the TDC7200 and it sends the TRIG -> the TDC1011 sends the START -> xuS later the TDC1011 issues a STOP and never a INTB.

    We have also gone back to all defaults on both IC's and get the same results.

    Can you explain how the TDC7200 controls TRIG differently between a short TOF and standard TOF when it does not know what kind of TOF the TDC1011 is programmed too?

    Thanks

  • The relationship between TRIGG and START between the TDC1011 and TDC7200 is covered in data sheet sections 8.4.5.2 and 8.4.6 respectively. 

    I'll get back to you tomorrow. 

    -Gabriel

  •  I see why the TRIG signal is different between SHORT-TOF and STANDARD-TOF

    TCD7200 section 8.4.6

    4. Immediately after sending the trigger, the TDC7200 enables the START pin and waits to receive the START
    pulse edge
    5. After receiving a START, the TDC resets the TRIGG pin

    And it is the AUTOZERO_PERIOD that controls the width of TRIGG during SHORT-TOF thus holding off the start until after the TDC7200 SPI_CS# goes low and we can read from the TDC7000 registers.

    I tried to extend AUTOZERO_PERIOD in STANDARD-TOF with no effect to extend the TRIGG signal so the TDC7200 SPI_CS# still is low during the START and we cannot read anything from the TDC7200 registers

    If I use SHORT-TOF and, clear the processor SPI TX/RX buffers after sending the START-MEAS command, I can read the TDC7200 registers, the following is what is returned after writing a 0x03 to Config1 to set measurement mode1 and start the measurement.

    Name  (Address) = Value written

    IRQ_St (0x02) = 0x0A    (so we are getting the MEAS_COMPLETE_FLAG and the NEW_MEAS_INT which should signal that we have an INTB, but no INTB was output, INT_MASK (0x03) = 0x04 so we should see the INTB if the CLOCK_CNTR_OVF is seen.

    Cal1_reg (0x1B) = 0x00 

    Cal2_reg (0x1C) = 0x00       (Confif2 (0x01) = 0x40 so we are setup for Calibration 2 - measuring 10 CLOCK periods

    Time1 (0x10) = 0x00          (currently only checking the lower 8-bits so we should see some value in these lower 8-bits)

    Time2 (0x12) = 0x00          (currently only checking the lower 8-bits so we should see some value in these lower 8-bits)

    Clock_Cnt1 (0x11) = 0x00

    Clock_Cnt2 (0x13) = 0x00

    Could the fact that we are not getting anything in the Cal2_reg when the TDC7200 is suppose to be calibrating to the external 6MHz clock be why we are not seeing any value in the timing register?

    Not sure why we see the MEAS_COMPLETE_FLAG and the NEW_MEAS_INT but not an INTB, we are using a PSOc4 processor and the INTB is configured as an input the only other thing on this trace is the 10K pull-up and we have confirmed that it is 10K.

    Appreciate your help, thanks.

  • I found out what the problem with the SPI port was and now have STANDARD-TOF functioning, the SPI clock speed was too slow moved it up to 1.5MHz and no longer have problems with TDC7200-SPICS# being low when START is asserted.

    We still have the other problem of getting the MEAS_COMPLETE_FLAG and the NEW_MEAS_INT set high in INT_STATUS register and no INTB.

    Thanks

  • I did get the INTB to go low, about 5mS after the STOP signal goes high, but the INTB does not go high again until another START-MEAS is initiated and then INTB goes back high for approximately 5mS

    They way we got INTB to go low was by setting the CLOCK_CNTR_MASK_HIGH = 0x30 (768d) anything lower then this will not allow the INTB to toggle low.

    CCOH (0x04) = 0xFF,

    CCOL = (0x05) = 0xFF

    CLCOH (0x06) = 0xFF

    CLCOL (0x07) = 0xFF

    CLCMH (0x08) = 0x30

    CLCML (0x09) = 0x00

    What do I have to do to get INTB to go back high after seeing a STOP on the inout to the TDC7200, are the values in the registers above correct?

    Do I have to write to a register after giving the START_MEAS command (possibly waiting mS)?

    Thanks

  • Some additional information:

    I think the problem is with the CLOCK_CNTR_STOP_MASK we have to set it to 0x0300 (768d) in order to get INTB to go low and I think INTB does not go high because the STOP has already occurred before the CLOCK_CNTR_STOP_MASK value.

    Our STOP pulse is 54uS from START pulse with a system clock of 6MHz (tCLOCK = 167nS).

    If you do the math from page 14: (54μs / tCLOCK) = 54uS/167nS = 323d = 0x0143 and is smaller than the 0x300 we have to set the CLOCK_CNTR_STOP_MASK too.

    If we set the CLOCK_CNTR_STOP_MASK to 0x100, which is below the above count value we never see the INTB.

    So what do we need to change to get INTB with a proper CLOCK_CNTR_STOP_MASK value?

    I really need to get this working.

    Thanks

  • Hi Duane,

    Thanks for the update. 

    After reviewing your initial register settings again, I overlooked an important register setting in the beginning. 

    You initially had the setting: Int_Mask (0x03) = 0x04. Setting NEW_MEAS_MASK to 0 will disable INTB. Please try setting this to 1 if you have not done so already. I apologize if this was the issue, I should have seen this the first time.  

    Regards,

    Gabriel

  • Hi Gabriel,

    Yes we did figure out the mask and are capable of acknowledging the INTB and getting the data out of the TDC7200 that represents the delta between the START and STOP.

    Thanks