PGA460: Configuring from EVM to Energia Library

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

Tool/software:

Hello,

I am running into issues when trying to configure the PGA460 in the Energia Library (GetDistance.io) to match the settings I successfully used in the GUI. My workflow is as follows:

  1. Configure the PGA460 in the GUI to achieve the desired results.

  2. Export all configuration files from the GUI to a text document using its built-in export feature.

  3. Create a separate case statement in my Energia code to replicate all of the configuration functions, for example:

    1. ussc.initBoostXLPGA460(commMode, baudRate, uartAddrUpdate);
      ussc.initThresholds(fixedThr);
      ussc.defaultPGA460(xdcr);
      ussc.initTVG(agrTVG, fixedTVG);
      ussc.runDiagnostics(1, 0);
      ussc.burnEEPROM();
  4. Use the register values exported from the GUI in the Energia code.

However, when I run this, the measurement results in Energia do not match the results from the GUI, even though I have ensured that #define userInputMode is set correctly and all my selections are passed in properly.

I would appreciate any guidance on why the measurements might differ and how to ensure the standalone Energia configuration matches the GUI behavior.

  • Hi Sahaj,

    Thank you for posting to the Sensors forum!

    How do the results from Energia compare to the results seen by GUI? Just to be sure, are you able to verify that the device is being programmed correctly (i.e., communication signals of RXD/TXD are the same for both Energia and the GUI)?

    Best

    ~Alicia

  • Hello,

    I captured the serial data using a logic analyzer for the GUI writing the registers versus the Energia library:

    GUI output:

    0x55·0x0A·0x80·0x00·0x75·0x55·0x0A·0x81·0x00·0x74·0x55·0x0A·0x82·0x00·0x73·0x55·0x0A·0x83·0x00·0x72·0x55·0x0A·0x84·0x00·0x71·0x55·0x0A·0x85·0x00·0x70·0x55·0x0A·0x86·0x00·0x6F·0x55·0x0A·0x87·0x00·0x6E·0x55·0x0A·0x88·0x00·0x6D·0x55·0x0A·0x89·0x00·0x6C·0x55·0x0A·0x8A·0x00·0x6B·0x55·0x0A·0x8B·0x00·0x6A·0x55·0x0A·0x8C·0x00·0x69·0x55·0x0A·0x8D·0x00·0x68·0x55·0x0A·0x8E·0x00·0x67·0x55·0x0A·0x8F·0x00·0x66·0x55·0x0A·0x90·0x00·0x65·0x55·0x0A·0x91·0x00·0x64·0x55·0x0A·0x92·0x00·0x63·0x55·0x0A·0x93·0x00·0x62·0x55·0x0A·0x94·0x00·0x61·0x55·0x0A·0x95·0x00·0x60·0x55·0x0A·0x96·0x00·0x5F·0x55·0x0A·0x97·0x00·0x5E·0x55·0x0A·0x98·0x00·0x5D·0x55·0x0A·0x99·0x00·0x5C·0x55·0x0A·0x9A·0x00·0x5B·0x55·0x0A·0x9B·0x00·0x5A·0x55·0x0A·0x9C·0x00·0x59·0x55·0x0A·0x9D·0x00·0x58·0x55·0x0A·0x9E·0x00·0x57·0x55·0x0A·0x9F·0x00·0x56·0x55·0x0A·0xA0·0x00·0x55·0x55·0x0A·0xA1·0x00·0x54·0x55·0x0A·0xA2·0x00·0x53·0x55·0x0A·0xA3·0x00·0x52·0x55·0x0A·0xA4·0x00·0x51·0x55·0x0A·0xA5·0x00·0x50·0x55·0x0A·0xA6·0x00·0x4F·0x55·0x0A·0xA7·0x00·0x4E·0x55·0x0A·0xA8·0x00·0x4D·0x55·0x0A·0xA9·0x00·0x4C·0x55·0x0A·0xAA·0x00·0x4B·0x55·0x0A·0xAB·0x00·0x4A·0x55·0x0A·0xAC·0x00·0x49·0x55·0x0A·0xAD·0x00·0x48·0x55·0x0A·0xAE·0x00·0x47·0x55·0x0A·0xAF·0x00·0x46·0x55·0x0A·0xB0·0x00·0x45·0x55·0x0A·0xB1·0x00·0x44·0x55·0x0A·0xB2·0x00·0x43·0x55·0x0A·0xB3·0x00·0x42·0x55·0x0A·0xB4·0x00·0x41·0x55·0x0A·0xB5·0x00·0x40·0x55·0x0A·0xB6·0x00·0x3F·0x55·0x0A·0xB7·0x00·0x3E·0x55·0x0A·0xB8·0x00·0x3D·0x55·0x0A·0xB9·0x00·0x3C·0x55·0x0A·0xBA·0x00·0x3B·0x55·0x0A·0xBB·0x00·0x3A·0x55·0x0A·0xBC·0x00·0x39·0x55·0x0A·0xBD·0x00·0x38·0x55·0x0A·0xBE·0x00·0x37·0x55·0x0A·0xBF·0x00·0x36·0x55·0x0A·0xC0·0x00·0x35·0x55·0x0A·0xC1·0x00·0x34·0x55·0x0A·0xC2·0x00·0x33·0x55·0x0A·0xC3·0x00·0x32·0x55·0x0A·0xC4·0x00·0x31·0x55·0x0A·0xC5·0x00·0x30·0x55·0x0A·0xC6·0x00·0x2F·0x55·0x0A·0xC7·0x00·0x2E·0x55·0x0A·0xC8·0x00·0x2D·0x55·0x0A·0xC9·0x00·0x2C·0x55·0x0A·0xCA·0x00·0x2B·0x55·0x0A·0xCB·0x00·0x2A·0x55·0x0A·0xCC·0x00·0x29·0x55·0x0A·0xCD·0x00·0x28·0x55·0x0A·0xCE·0x00·0x27·0x55·0x0A·0xCF·0x00·0x26...

    0x55·0x09·0x4C·0xAA·0x55·0x09·0x4D·0xA9·0x55·0x09·0x1F·0xD7·0x55·0x09·0x4C·0xAA·0x55·0x09·0x4D·0xA9·0x55·0x09·0x1F·0xD7

    Energia library output:

    0x55·0x10·0xB7·0x77·0xAD·0x97·0x78·0x88·0xF6·0x54·0x73·0x9C·0xFF·0xFF·0xFF·0xFF·0xFF·0x07·0x88·0x88·0x88·0x88·0x88·0x88·0x84·0x21·0x08·0x42·0x10·0x80·0x80·0x80·0x80·0x00·0xE20x55·0x0C·0x00·0x00·0x00·0x00·0x00·0x00·0x00·0x00·0x00·0x00·0x00·0x00·0x00·0x00·0x00·0x00·0x00·0x00·0x00·0x00·0xAF·0xFF·0xFF·0x2D·0x68·0x36·0xFC·0x40·0x32·0x00·0x0A·0x12·0x40·0x7F·0x8C·0x00·0xEE·0x7C·0x0A·0x00·0x00·0x00·0x00·0x2B·0x55·0x0A·0x26·0x0F·0xC0·0x55·0x0E·0xAF·0xFF·0xFF·0x2D·0x68·0x36·0xFC·0x79·0x55·0x00·0x01·0xFE

    I’m not sure why these results differ, as I updated all the Energia library functions to use the settings exported from the GUI, which are as follows:
    ;GRID_USER_MEMSPACE
    00 (USER_DATA1),00
    01 (USER_DATA2),00
    02 (USER_DATA3),00
    03 (USER_DATA4),00
    04 (USER_DATA5),00
    05 (USER_DATA6),00
    06 (USER_DATA7),00
    07 (USER_DATA8),00
    08 (USER_DATA9),00
    09 (USER_DATA10),00
    0A (USER_DATA11),00
    0B (USER_DATA12),00
    0C (USER_DATA13),00
    0D (USER_DATA14),00
    0E (USER_DATA15),00
    0F (USER_DATA16),00
    10 (USER_DATA17),00
    11 (USER_DATA18),00
    12 (USER_DATA19),00
    13 (USER_DATA20),00
    14 (TVGAIN0),AF
    15 (TVGAIN1),FF
    16 (TVGAIN2),FF
    17 (TVGAIN3),2D
    18 (TVGAIN4),68
    19 (TVGAIN5),36
    1A (TVGAIN6),FC
    1B (INIT_GAIN),40
    1C (FREQUENCY),32
    1D (DEADTIME),00
    1E (PULSE_P1),0A
    1F (PULSE_P2),12
    20 (CURR_LIM_P1),40
    21 (CURR_LIM_P2),7F
    22 (REC_LENGTH),8C
    23 (FREQ_DIAG),00
    24 (SAT_FDIAG_TH),EE
    25 (FVOLT_DEC),7C
    26 (DECPL_TEMP),0A
    27 (DSP_SCALE),00
    28 (TEMP_TRIM),00
    29 (P1_GAIN_CTRL),00
    2A (P2_GAIN_CTRL),00
    2B (EE_CRC),5B
    40 (EE_CNTRL),00
    41 (BPF_A2_MSB),85
    42 (BPF_A2_LSB),8D
    43 (BPF_A3_MSB),F9
    44 (BPF_A3_LSB),A5
    45 (BPF_B1_MSB),03
    46 (BPF_B1_LSB),2D
    47 (LPF_A2_MSB),7E
    48 (LPF_A2_LSB),67
    49 (LPF_B1_MSB),00
    4A (LPF_B1_LSB),CD
    4B (TEST_MUX),00
    4C (DEV_STAT0),80
    4D (DEV_STAT1),00
    5F (P1_THR_0),B7
    60 (P1_THR_1),77
    61 (P1_THR_2),AD
    62 (P1_THR_3),97
    63 (P1_THR_4),78
    64 (P1_THR_5),88
    65 (P1_THR_6),F6
    66 (P1_THR_7),54
    67 (P1_THR_8),73
    68 (P1_THR_9),9C
    69 (P1_THR_10),FF
    6A (P1_THR_11),FF
    6B (P1_THR_12),FF
    6C (P1_THR_13),FF
    6D (P1_THR_14),FF
    6E (P1_THR_15),07
    6F (P2_THR_0),88
    70 (P2_THR_1),88
    71 (P2_THR_2),88
    72 (P2_THR_3),88
    73 (P2_THR_4),88
    74 (P2_THR_5),88
    75 (P2_THR_6),84
    76 (P2_THR_7),21
    77 (P2_THR_8),08
    78 (P2_THR_9),42
    79 (P2_THR_10),10
    7A (P2_THR_11),80
    7B (P2_THR_12),80
    7C (P2_THR_13),80
    7D (P2_THR_14),80
    7E (P2_THR_15),00
    7F (THR_CRC),E6
    EOF


    Currently, I am only issuing the commands for short-range burst and ultrasonic pull:
    0x55·0x04·0x01·0xFA
    0x55·0x06·0xF9

    Despite updating the settings from the GUI, the results are vastly different. Is there a specific reason why simply updating the registers from the GUI export does not reproduce the same behavior?



  • Hi Sahaj,

    Thank you for the additional data, I will need some time to go through what you have shared and will get back to you tomorrow.

    Best,

    ~Alicia