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.

PGA450Q1EVM: TIDA-00151 from Arduino MEGA

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

Hi!

I do not get the expected response from the PGA450Q1EVM-S (TIDA-00151), purchased April 2019 when interfacing using an Arduino MEGA on Serial1 UART programmed with the sketch  PGA450Q1EVMS_UART_Demo.ino from TI.

My problem seems very similar to an issue brought up by Jared Rawlins in a post: http://e2e.ti.com/support/tools/sim-hw-system-design/f/234/p/728573/2749777#jktype=e2e&pi320995filter=all&pi320995scroll=false&pi320995=2

I'm powering the PGA450Q1EVM-S with 13.8V, 1A DC, joined grounds with the arduino I receive seemingly random data from the sensor unit when I run the sketch. It didn't seem like Jared solved his problem on the forum. 

Grateful for advice. 

Output from serial monitor after running command 0 repeatedly, 18 times, then command 1 long range, then  command 2, 6 times followed by command 4, twice, to give you an idea what it prints:

PGA450Q1EVM-S UART Demo
Enter command number to run:
0: Test UART communication.
1: Trigger a short or long distance burst and capture with hard-coded drive and receive settings.
2: Read first instance of threshold crossing for closest object detected.
3: Update an EEPROM value.
4: Read all 768 bytes of FIFO data
5: Burst and capture ultrasonic profile based on EEPROM configuration of drive and receive settings.
6: Threshold values report for selected mode of operation (short or long).
7: Not used in example firmware. Reserved for custom user defined function.
255,255,
255,255,
255,255,
83,255,
255,255,
255,255,
255,255,
255,255,
255,255,
255,255,
255,255,
255,255,
255,255,
255,255,
83,255,
255,255,
255,255,
255,255,

CMD1 input selection: 0=listen, 1=short, 2=long
255,255,
255,255,
255,255,
255,255,
255,255,
255,255,
ERROR - Did not receive data from PGA450-Q1. SerialAvailable=1
ERROR - Did not receive data from PGA450-Q1. SerialAvailable=1
0,255,

sometimes command 0 also returns: 

18,52,

Changing the sketch to print HEX formatted strings to serial monitor (using: Serial.print(UART_RX[n], HEX); ) responds to repeated command 0 calls as below: 

FF,FF,
53,FF,
53,FF,
12,34,
FF,FF,
12,34,
FF,FF,
34,B9,
FF,FF,
FF,FF,
FF,FF,
FF,FF,
FF,FF,
FF,FF,
FF,FF,
FF,FF,
FF,FF,
FF,FF,
B9,FF,

From the http://www.ti.com/lit/ug/sldu019b/sldu019b.pdf I find that I should expect 0x12, 0x23 to be returned after a command 0 call.

Grateful for advice. 

  • Hi Johannes,

    I should clarify that the PGA450Q1EVMS_UART_Demo.ino has not been fully tested (beta release), and that there are known bugs regarding the response data handling. It looks as though you are occasionally seeing the proper response (0x,12,34 with checksum of 0xB9) from Cmd0, though I cannot immediately assess why so many idle response bytes (0xFF) are being captured. Let me take a look using a LaunchPad (may be an Arduino issue).

    We are working towards an official/stable release of this demo firmware, but not until later this quarter. Thanks for experimenting with the beta version in the meanwhile.
  • Hi Akeem,

    Thanks for your reply. I follow up with three sub topics:

    1.  From your message I conclude and reflect on a few things:

    - 0xFF means the sensor system is in an idle state. 

    - Proper response from cmd0 is 0x12, 0x34 (TI UART guide doc indicates 0x12,0x23 to be the proper response) , why are there two possible responses?

    - Checksum should be 0xB9 from cmd0, how is it calculated?

    2. Could you describe, step-by-step, what command calls I should execute and the expected results in order to make a range measurement with my setup, given that I have a target 1m from the transducer?

    3. I'd be very pleased to test a stable release of this firmware on the MEGA, in the meantime, since this is not as straight forward as I thought, can you advice on what I need to purchase to get ranging data from this system (TI launchpad? TIGER?, USB-FTDI dongle)?

    Best Regards,

    Johannes Wiig 

  • Hi Johannes,

    Responding to your points:

    1.

      - Yes, 0xFF may indicate an idle state if the master is forced to read the UART without the slave indicating data is available.

      - CMD0 only offers one response: 0x12, 0x24, 0xB9.

      - Checksum is calculated based on example code function "checksum_add_cary" in TIDA-00151 UART & LIN Demo Firmware for PGA450-Q1:

    char checksum_add_cary (char param1, char param2)

    {

    union {unsigned short u16; unsigned char u8[2];} Sum;

    Sum.u16 = param1+param2;

    return ((Sum.u8[0] != 0) ? (Sum.u8[1] + 1) : Sum.u8[1]);

    }

    2. The most basic example to trigger a burst/listen command, and then read the results is to send command1 followed by command2:

    Command 1—Trigger a short or long distance burst and capture with hard-coded drive and receive settings. Also reads first instance of threshold crossing for closest object detected.

    Example hex entry: 0x00, 0x55, 0x11, 0x02, 0x00

    where:

      • • [0] 0x00: break field
      • • [1] 0x55: synchronization field
      • • [2] 0x11: 1 = command 1. 1 = sensor address set in EEPROM address 0x31
      • • [3] 0x02: 00 = listen. 01 = short. 02 = long

    Command 2—Read first instance of threshold crossing for closest object detected.

    Example hex entry: 0x00, 0x55, 0x21, 0x00

    where:

      • • [0] 0x00: break field
      • • [1] 0x55: synchronization field
      • • [2] 0x21: 2 = command 2. 1 = sensor address set in EEPROM address 0x31
      • • [3] 0x00: ignored but required checksum

    For a complete listing of predefined UART commands, refer to the PGA450Q1EVM-S User's Guide and TIDA-00151 UART Demo Instructional.

    3. The aforementioned UART Demo Instructional provides an example on how to collect ranging data using the PGA450Q1EVM's TI-GER board.