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: PGA460 is not responding with ESP arduino

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

Hi,

We are using PGA460 with ESP32  arduino for ultasonic sensor control.

We are able to send the data from ESP32 to PGA460, but unable to receive the acknowledgement from PGA.

Kindly let us know the solution.

  • Padmaraj,
    If you are not receiving data from the PGA460-Q1 your master-transmit command data/structure is likely incorrect.
    Are you using UART? Are you using the PGA460 Energia library and example as a reference? If so, can you send me an example of the command sequence transmitted from the master?

    For instance:
    An example of a Preset 2 Burst & Listen of 3 objects for UART address 0 would be:
    0x55, 0x01, 0x03, 0xFB
    where 0x55 is the sync byte
    0x01 is the UART address and command #
    0x03 is the number of objects to detect
    0xFB is the UART checksum

    Please provide your example in the same format.

    What command(s) are you sending and not receiving a response for? Not all commands automatically prompt the PGA460 to provide a response.
  • Hi sir,

    Thank you for your reply.

    We are using UART  2 from esspressif. Data sending is alright, checked in serial  terminal window.

    An example of writing threshold for UART address is:

    0x55, 0x50 , data0 , data1..........0x35(checksum).

    But while in threshold bulk read address to UART 2 is:

    0x55, 0x4F,0xBO

    I am not able to read proper threshold data's , and I m getting only 0xFF........

    Is the  command is right for UART2 address?

  • Hi Padmaraj,

    If I understand correctly, you are trying to execute a threshold bulk read command 15 on PGA460 UART_ADDR 2.

    You are sending the correct UART sequence for this particular command: 0x55, 0x4F, 0xB0

    Have you confirmed that your master is using a baud rate between 9.6-115.2kBaud, 8 data bits, 2 stop bits, no parity, and no flow control?

    Are you certain the TXD of the master is connected to the RXD of the PGA460, and vice-versa?

    Are you able to get any response from the PGA460? The default address is '0', so try sending 0x55, 0x0F, 0xF0 instead for the same command.

  • Hi Akeem,

    On ESP32, PGA460Q1 does not respond on UART1 OR UART2 (we cannot allocate UART0 since its already utilized) and the PGA460 code provided by TI is not able to Read the 128 bytes Transducer data dump on UART2. It seems that between the two functions of "runEchoDataDump" and "pullEchoDataDump" the code is somehow not able to set / get the result on UART2. UART0 works on the PGA460 EVM though there is no way to test UART1.I have checked UART2 works independently.
  • Hello Akeem,

    As per your suggestion, we tried with UART0 of ESP arduino it is working fine, but we cannot use UART0 as it is already occupied.

    We already designed for UART2 instead of UART0 to PGA460. We are unable get respond from PGA over UART2.

    Please let us know what we need to change in our code to get it work.

    Kindly requesting you to reply for our query asap. we require it to be done immediately.

  • Hi padmaraj,
    Just to clarify, the UART_ADDR of the PGA460 is not related to the UART channel # of the master. So when using UART2 on your ESP Arduino, you still communicate to the default PGA460 UART_ADDR '0'. If your UART0 channel is working, UART2 must be leveraged identically (don't change the code). As far as the PGA460 is concerned, the Arduino UART channels could be labeled UART-A and UART-B, or UART-Red or UART-Blue.

    Have you attempted to communicate to PGA460 UART address '0' using UART2?
  • Hi Akeem,

    I attempted to communicate to PGA460 UART address '0' using UART2, but with UART 2 of ESP it is not working.

    I am able to get result with UART0 with junk ( as I am using same UART for dumping and to print ) but not with UART2.

    Below is the log,

    Configuring the PGA460 with the selected settings. Wait...
    ERROR - Did not receive data!
    System Diagnostics - Frequency (kHz): inf
    System Diagnostics - Decay Period (us): 0.00
    ERROR - Did not receive data!
    System Diagnostics - Temperature (C): -42.67
    ERROR - Did not receive data!
    System Diagnostics - Noise Level: 0.00
    Retrieving echo data dump profile. Wait...
    255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,2
    55,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,25
    5,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
    ,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,
    255,255,255,
    EEPROM programmed successfully.
    ERROR - Did not receive data!
    ERROR - Did not receive data!
    Error reading measurement results...

    Kindly requesting you to reply asap.

  • Are you using version 1.0.2 of the Energia library? This will ensure you are using the latest version of code, which offers several bug fixes and improvements to the library. Your output snipped is similar to the older version.

    When using UART2, are you updating the PGA460_USSC.cpp file to use UART2 of your ESP? The library is hard-coded to only enable Serial1 for the UART communication to the PGA460 device.

    You'd need to initiate and update any instance of Serial1. ... to Serial2. (or the equivalent call to the ESP's UART2 port).
  • Hello Akeem,

    We are using latest version of PGA code.

    While using UART2, i am updating .cpp file too, but still it is not working.

    One more thing we discovered is after 2 minutes it gives some random data.

    Please suggest something to get it work. We are struggling since many days.

  • Hello Akeem,

    Kindly requesting you to reply asap, as we want this to be work soon. We are already into production, but got stuck because of this UART issue.

    Please revert back us.

  • padmaraj,
    Pardon my delay; I have been out-of-office for the last week.

    I am unable to provide further guidance unless I am able to view your source code and latest schematic. Can you provide these files?

    If UART0 and UART2 are configured exactly the same, there should be no reason for UART2 not to work. I can only suspect that UART2 is not configured properly, or porting the Energia library requires additional Serial configuration for use with Arduino's ESP32.

    Have you been able to verify if UART1 works with the PGA460-Q1?
  • AKeem,

    PGA sensor is working with UART2 of ESP.  But data always between 1.65m to 1.68m range, even in MSP430 same, below i have attached the log please go through it.

    I am selecting (Murata MA40H1S-R) sensor with 40 kHz frequency ,distance range not changing even object is present.Please check it and let me know your suggestion asap.

    Thank you

  • Hi Padmaraj,
    You may need to change/optimize the default values within the PGA460_USSC.cpp library file based on the configuration of the GUI.

    I did recently notice one error in version 1.0.2 of the example for the MA40H1SR defaults (case 1: // MA40H1SR). There are 0 pulses given for a Preset 2 command; the fix is:
    PULSE_P2 = 0x10; // AW updated 1.0.3 //was 0x00

    Have you tried adjusting the TVG gain range and fixed TVG level on the COM terminal? The 58-90dB range may be too high for the MA40H1SR. Also, try setting your threshold to 75% instead.

    Can you plot or provide the full string for the echo data dump profile? The features do seem to be working, I think it is just a matter of optimizing the settings.