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.

编译/ PGA460: Radar measurement results return value is not normal

Part Number: PGA460
Other Parts Discussed in Thread: ENERGIA,

Tool/software: TI C/C++ Compiler

The details are as follows:

1.Configuration process(0x0c Instruction EEPROM->wait 100ms->0x0e Instruction Configuration TVG->wait 100ms->0x10 Instruction Configuration THRESHOLD->wait 100ms->BURST_LISTEN_PRESET1 Start measuring ->wait 500ms->0x05 Instruction Reading measurement results).

2.Results returned: The measured results returned are byte0 to 0x40 but the first set of measurements returned is small (almost unchanged), starting from the second set of randomly measured values, and the measured values do not change with the distance of the obstacle.

3.PGA460 Configuration

#define UART_ADD 0

#define MEASURE_OBJNUM 8 //Number of objects to be measured(1~8)

#define BURST_LISTEN_PRESET1 ( 0 + (UART_ADD<<5) )
#define BURST_LISTEN_PRESET2 ( 1 + (UART_ADD<<5) )
#define LISTEN_PRESET1 ( 2 + (UART_ADD<<5) )
#define LISTEN_PRESET2 ( 3 + (UART_ADD<<5) )

#define READ_MESURE_RESULT ( 5 + (UART_ADD<<5) )

#define SYSTEMDIAGNOSTICS ( 8 + (UART_ADD<<5) ) //System Diagnostics
#define REGISTER_READ ( 9 + (UART_ADD<<5) )
#define REGISTER_WRITE ( 10 + (UART_ADD<<5) )
#define EEPROM_READ ( 11 + (UART_ADD<<5) )
#define EEPROM_WRITE ( 12 + (UART_ADD<<5) )
#define TVG_READ ( 13 + (UART_ADD<<5) )
#define TVG_WRITE ( 14 + (UART_ADD<<5) )
#define THRESHOLD_READ ( 15 + (UART_ADD<<5) )
#define THRESHOLD_WRITE ( 16 + (UART_ADD<<5) )

//===================EEPROM CFG VALUE(Fully closed probes)==================
#define USER_DATA1 0
#define USER_DATA2 0
#define USER_DATA3 0
#define USER_DATA4 0
#define USER_DATA5 0
#define USER_DATA6 0
#define USER_DATA7 0
#define USER_DATA8 0
#define USER_DATA9 0
#define USER_DATA10 0
#define USER_DATA11 0
#define USER_DATA12 0
#define USER_DATA13 0
#define USER_DATA14 0
#define USER_DATA15 0
#define USER_DATA16 0
#define USER_DATA17 0
#define USER_DATA18 0
#define USER_DATA19 0
#define USER_DATA20 0

#define TVGAIN0 0x88
#define TVGAIN1 0x88
#define TVGAIN2 0x88
#define TVGAIN3 0x82
#define TVGAIN4 0x08
#define TVGAIN5 0x20
#define TVGAIN6 0x80 //50% levels
#define INIT_GAIN 0x54 //01010100
#define FREQUENCY 0x32//0x8f
#define DEADTIME 0xa0
#define PULSE_P1 0x04 //4 pulse
#define PULSE_P2 0x10
#define CURR_LIM_P1 0x55 //Current limit21*7+50(MA)
#define CURR_LIM_P2 0x55
#define REC_LENGTH 0x19
#define FREQ_DIAG 0x33
#define SAT_FDIAG_TH 0xee
#define FVOLT_DEC 0x7c
#define DECPL_TEMP 0x4f //52~84db
#define DSP_SCALE 0x00
#define TEMP_TRIM 0x00
#define P1_GAIN_CTRL 0x09
#define P2_GAIN_CTRL 0x09

#define P1_THR_0 0x88
#define P1_THR_1 0x88
#define P1_THR_2 0x88
#define P1_THR_3 0x88
#define P1_THR_4 0x88
#define P1_THR_5 0x88
#define P1_THR_6 0x84
#define P1_THR_7 0x21
#define P1_THR_8 0x42
#define P1_THR_9 0x10
#define P1_THR_10 0x10
#define P1_THR_11 0x80
#define P1_THR_12 0x80
#define P1_THR_13 0x80
#define P1_THR_14 0x80
#define P1_THR_15 0x00
#define P2_THR_0 0x88
#define P2_THR_1 0x88
#define P2_THR_2 0x88
#define P2_THR_3 0x88
#define P2_THR_4 0x88
#define P2_THR_5 0x88
#define P2_THR_6 0x84
#define P2_THR_7 0x21
#define P2_THR_8 0x42
#define P2_THR_9 0x10
#define P2_THR_10 0x10
#define P2_THR_11 0x80
#define P2_THR_12 0x80
#define P2_THR_13 0x80
#define P2_THR_14 0x80
#define P2_THR_15 0x00

  • I now use 40KHz, can detect more than 40cm distance, 40cm will not be able to detect, but my application needs to detect 10cm distance. I would like to ask if 200KHz can be implemented.

  • i Charles,

    1. Your configuration process is valid, so I have no concern here.

    2. Can you share all values of the entire Ultrasonic Measurement Result command? I assume the threshold must be optimized if the values are remaining mostly unchanged.

    • How did you set your threshold?  It appears that you are using the mid-code value example from the Energia example code.
    • Do you have an EVM that you can use to further optimize and map the threshold?
    • If you increase the number of objects to detect to 8, do any of these values change in accordance to the actual distance of an object?
    • Can you also check the bit state of THR_CRC_ERR int he DEV_STAT0 register. This bit must be a value of 0 in order for the enable burst+listen command. This bit is automatically cleared if the bulk threshold command was successfully executed.
    • I see you are using the DECPL pin. Are you using time or temperature decouple mode? Since the transformer is grounded through the DECPL FET, you must use time decouple mode for the transformer driver.  Note: the DECPL pin is an optional feature; you can directly ground the transformer and tuning capacitor if this feature is not needed.
    • Have you confirmed that the transducer is being properly excited by probing the positive transducer terminal during burst+listen? What is the peak to peak voltage?
    • What transducer part number are you using?

    I suspect you are encountering a similar discussed in the PGA460 FAQ (; specifically, FAQ # 5.2 and 5.6 (linked document includes supporting images):

    5.2 How can I detect more than eight objects?

    Can I set the threshold to ignore ringing decay ripple or objects for a given time after bursting? How can the Threshold Offset be used? The threshold map can be set to ignore ultrasonic activity at any point of the record window, when the threshold level is set to a value of 255. The user may want to consider setting the threshold to a value of 255 during the initial burst and decay time. Even when the return data is saturated, such as during the burst window or strong return peaks, the threshold comparator will not trigger when the threshold is maximized. For threshold levels 1-8, the value of 255 can only be attained when the threshold level is maximized to a value of 248, and the threshold offset is set to a maximum positive value of +7. This offset applies to all 1- 8 levels. For levels 9-12, the offset does not apply, and these levels can be independently set to 255.

    5.6 The ultrasonic measurement result data is random, very short, always the maximum value, or never updates.

    Before the ultrasonic measurement results can be of any use, the thresholds must be mapped for object detection based on the echo data dump profile. Use the mid-code threshold timing and levels option to bypass the need for manual threshold optimization. The mid-code option sets the threshold to a fixed 50% detection level.

    If the threshold has been set appropriately, and the value returned is always less than 10 cm, then the threshold is initially set too high, but not maximized. At low analog gains, the DSP output supplied to the data comparator to detect a threshold crossing initially ramps during the burst and decay window. As a result, the echo data dump equivalent is not immediately saturated as it is represented in the analog domain, thus the threshold comparator can be false-triggered by the initially ramped DSP output. To prevent this false-trigger, initially set the threshold to the maximum value of 255, increase your threshold deglitch time, or lower the threshold such that ramping is at an initial value above the threshold level. Alternatively, set the initial gain to a larger value such that the ramping is saturated, and does not trigger the threshold.

    Best practice is to initialize the TVG and/or SR digital gain to a large value during the expecting burst and initial decay window, and radically reduce the TVG to a lower value during the later portion of the decay period to enable short range detection.

    If the threshold is always at a maximum value, the threshold is set too high throughout the entire profile, or no object is detected. Reduce the threshold levels to force the threshold comparator to trigger. A forced trigger will confirm whether a burst-and-listen command has truly executed. If the ultrasonic measurement results (UMR) are not updated, ensure that the DATADUMP_EN bit of the EE_CNTRL register is disabled (default). If the DATADUMP_EN bit is enabled, the echo data dump memory is filled, and the UMR will not update because the threshold comparator disabled. Only the echo data dump memory can be filled, or the ultrasonic measurement results be captured, but not both simultaneously. When the GUI displays the echo data dump and captures the ultrasonic measurement results, two independent burst-and-listen commands are run sequentially.

    You can also run a transducer echo data dump read (command 7) to visually inspect the echo data dump profile.

    • Can you provide this 128 byte EDD output with the object at 30cm?

    If you need to reliably detect downwards of 10cm in a mono-static configuration, then you can use high-frequency transducers in the range of 180-480kHz. See a recent E2E discussion at which discusses a high-frequency transducer half-bridge driver implementation.

    You can also use a transformer driver to excite a high-frequency transducer. If you are seeking a transducer resonating near 200kHz, I recommend the Massa 200639-501 (Model E-188/220) transducer.

    You can find a full listing of high-frequency transducers and transformers at:

  • My application is that the transducer is 5~40cm to detect the distance of the object, now using 40Khz transducer, found that the detection of more than 35cm is effective, the detection of the following 35cm objects, received feedback value is inaccurate, for my application, because my transducer is facing the sky, When using a 40Khz transducer, I received feedback results are fixed, I want to determine whether there is an object based on the change of feedback value, as long as the feedback is not to the value of the sky to determine the existence of the object, I do not need to get a specific distance,Is it feasible?Is there a risk?
  • Hi Charles,
    If your application requires 5~40cm detection, your options are to use:
    • Bi-static low-frequency (40kHz) transducer pair.
    • Mono-static high-frequency (180-480kHz) transducer.

    Your description to detect the presence of an object can be achieved by the PGA460. The PGA460's threshold allows you to wrap the threshold are a no-object profile. For you application, you would wrap the threshold around the burst-and-listen profile when the transducer is facing the sky, and no objects are present. Whenever an object exceeds the threhsold, it would indicate the presence of an object. The PGA460 will calculate the time-of-flight for a distance calculation, and report this value as a non-0xFFFF value to the master.

    See PGA460 FAQ#5.3's image ( for an example of how the threshold should be set with respect to the noise floor:

    5.3 Can I automatically set the threshold map?
    The PGA460 does not implement automatic threshold mapping, but the master controller can implement a
    function to set the threshold based on the average echo data dump of a no-object burst-and-listen
    (NOBAL) profile. Multiple iterations (such as 100) of the NOBAL command should be to run and recorded
    to collect a reliable running average of the noise floor. The threshold is then mapped such that the timing
    of all 12 thresholds points are spaced to fit just within or beyond the record time length of the respective
    preset. The levels would be set based on the worst case value of the segmentation between the level in
    question and the subsequent level. An additional margin of 8 or more decimal spaces should be added as
    buffer to the threshold levels.
  • Charles,
    I also recommend that you view the "Ultrasonic Sensing with the PGA460-Q1" video series ( to see an example of how to set the threshold.