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.

PGA450-Q1: PGA450-Q1 about the SPI and the distance measuring questions

Part Number: PGA450-Q1
Other Parts Discussed in Thread: PGA460-Q1

Hi team,

The customer is using PGA450-Q1. PGA450-Q1 has the SPI, UART and LIN interfaces.

His ultrasonic transmission waveform is fine from the oscilloscope. The customer would like to use SPI interface to communicate for the distance measuring. 

But he does not know how to use SPI to read the receive signal for the distance measuring.

Q1: For the customer's application, my understanding is LIN or UART can be used to measure the distance. The SPI can only be used for OTP programming.

Is my understanding correct?

Q2: If SPI can also be used to measure the distance, would you explain how to use SPI to measure the distance and read the receive signal?

Q3: If the customer uses the PGA450-Q1, what do we recommend the communication to measure the distance?LIN? UATR? OR SPI?

Best Wishes,
Mickey Zhang
Asia Customer Support Center
Texas Instruments

  • Hi Mickey,

    A1: LIN or UART are the TI recommended interface modes for the PGA450-Q1. This is mainly due to the SPI interface requiring the PGA450-Q1's internal 8051 to always be in the RESET mode to enable communication. SPI can be used just as UART and LIN, but SPI is the only interface that can be used to program the OTP or DEVRAM memory.

    A2: Similarly to the UART and LIN approach, and while the micro is in the RESET state, the EN_CTRL's BURST_A_EN bit must be toggled from 0 --> 1. Immediately after this bit is toggled, the driver will excite the transducer, and the FIFO start to fill. After waiting for the FIFO to fill (several millieseconds), the user can read the FIFO memory using the external memory read command found in Table 15 SPI Protocol Transfer Widths.
    Note: to set the PGA450-Q1 into RESET mode, refer to section 7.4.3 RESET of the datasheet.

    A3: If they use the PGA450-Q1, I would prefer UART or LIN, especially since we already have example code for both of these modes. We do not have any example code or instructions on using SPI, other than what is already in the datasheet. Have you introduced them to the PGA460-Q1? The PGA460-Q1 is better in performance, and offers UART, One-Wire UART (LIN like), and Time Command Interface (TCI) communication modes.
  • Hi Akeem,

    Thanks for your help.
  • Hi Akeem,

    Update:

    Now the customer uses SPI to measure the distance.

    He has excited the transducer and the ultrasonic transmission has been configured. The ultrasonic transmission waveform can be seen clearly in the oscilloscope. That is the ultrasonic transmission waveform is fine.

    He needs to know what the sign is when the  returned echo signal is received. Then he can calculate the distance.

     Would you explain more about this?

  • Hi Akeem,

    Would you provide some suggestions? The customer is waiting for my reply.
  • Hi Mickey,
    The ultrasonic echo activity is logged in the FIFO memory of the PGA450. Since the ultrasonic activity is digitized and filtered through the internal DSP, the waveform will be stored in the echo data dump format shown in Figures 129-130 of the PGA450 datasheet. This is 768 bytes of echo data stored in FIFO memory. To convert the FIFO memory data point into a distance equivalent, use the following equation:

    Distance(m) = [BlankingTime + (FIFOSampleNumber * Downsample * ADCSampleRate)] * SpeedOfSound /2
    where
    •Blanking Time = 0 to 255dec = 0 to 4.08ms
    • FIFOSampleNumber = 0 to 767
    • Downsample rate = 25 to 50
    • ADCSampleRate = 1MSPS (1us)
    • SpeedOfSound (at room temp) = 343m/s

    An example would be: [2.048ms + (500 * 40 * 1us)] * 343m/s / 2 = 3.78m

    Is the customer not interested in using the latest USSC PGA460-Q1 device? Is SPI a hard requirement?

  • Hi Akeem,

    Thanks for your support. Now the customer has used PGA450-Q1. And SPI is a hard requriement.