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: Object detection at two different distance

Part Number: PGA450-Q1
Other Parts Discussed in Thread: TIDA-00151

Hi,

How to detect  / Identify two objects in different distance.

Reference software which is given by TI will able to detect only first near object only.

Kindly share me reference code / notes regarding subjected query.

  • Arun,

    We will get back with you soon.
  • Hi Arun,
    To repurpose the existing "TIDA-00151 UART & LIN Demo Firmware" example code to enable multiple object detection , you will need to update/modify the following if-statement to store an array of TimeOfFlight results.

    if ( data_FIFO[lcv] > DetectionThreshold) {

    EN_CTRL = 0x8C; //log free running timer
    FRT_T2.u8[0]=FRT_MSB;
    FRT_T2.u8[1]=FRT_LSB;
    if (FRT_T1.u16 > FRT_T2.u16) {
    TimeOfFlight.u16 = 65535+FRT_T2.u16-FRT_T1.u16;
    }
    else {
    TimeOfFlight.u16 = FRT_T2.u16-FRT_T1.u16;
    }
    MaskEcho = 1;
    //break; // when enabled, break for loop as soon as an object is found, and not all FIFO will be filled

    }

    Be sure to keep the break; option disabled so the threshold comparison will continue to run after the first object has been logged.
    You will need to create a new/custom command to read out the array of ToF results similarly to Command 2's "Read first instance of threshold crossing.":

    void command2 (void){ // Transmit Results (2 bytes) to Master

    UART_send_data (TimeOfFlight.u8[0]);
    UART_send_data (TimeOfFlight.u8[1]);
    UART_send_data (~(checksum_add_cary (TimeOfFlight.u8[0], TimeOfFlight.u8[1])));
    }

    Instead of executing the UART_send_data function for one ToF log, you could for-loop a UART_send_data of each ToF_Array element.