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: UART EEPROM write and THRESHOLD write

Part Number: PGA460
Other Parts Discussed in Thread: ENERGIA

Hello -

I am using UART for my application and created three individual buffers


#define _checksum(f) ((uint8_t) ~(uint8_t)(f))
uint8_t Ult_unlockEeprom[] = {0x55, 0x0A, 0x40, 0x68, _checksum(0x0A)}
uint8_t Ult_setToProgramEeprom[] = {0x55, 0x0A, 0x69, _checksum(0x0A)}
uint8_t Ult_bulkEepromWrite[] ={…} //eeprom code too long for email

then I send these buffers all one right after another. Should this sequence work for issuing a bulk EEPROM write? What is the best method of testing if the EEPROM has been written to correctly?

I have tried multiple different sequences and have not been able to get any response back on the PGA460 yet. 

Another question is that are some of the commands from master-to-slave not require a checksum? If a checksum is done on EEPROM or Threshold write then the size of the checksum is too large to fit in the 8-bit checksum data field in the transmission line. 


Best,

Clint

  • Clint,

    We have received your question & will respond as soon as possible.
  • Clint,

    I will look into your code as above to check if it will work.

    Meanwhile please check Software User's Guide for PGA460 in the link below:
    www.ti.com/.../slaa730a.pdf
    This has example Energia codes for distance measurement, hope this helps with your coding.
  • I need to know what the exact sequence of commands (using UART-ASYNCRONOUS) and what values they contain in order to unlock, and write my configurations to the EEPROM so that I may issue a burst and listen command.

    Some additional information that may be helpful as well:
    • SCLK pin on PGA460 is pulled low with 10 [kOhm] resistor
    • IO pin on PGA460 is pulled high on GPIO pin and with physically with 10 [kOhm] resitor
    • Currently running BAUD at 9600 [bps] but will eventually be increasing to 19,200 [bps]
    • Thresholds are being written once every startup or system power cycle (must be done)

    Please let me know if you need any other information. Thank you in advance for your assistance.

    Best,

    Clint
  • Clint,

    Feedback on your additional details:
    • Yes, the SCLK pin should be pulled low by 10kOhm if unused.
    • The IO pin is not logic level; this is an automotive level pin that is internally pulled up to VPWR (6-28V). If not used, leave this pin floating. You could damage your MCUs GPIO by using a 10kOhm pull up.
    • UART baud rate supported up to 115.2k.
    • Yes, always write to the threshold upon stateup or power cycle to clear the THR_CRC_ERR.

    The most basic test to determine if your PGA460 circuit is operational, execute the following command sequence:
    (Note, these examples assume your device is using the factory settings at UART_ADDR=0, you are using a transformer driven transducer, and using UART to communicate.)
    1) Power-on device
    2) Master transmit a threshold bulk write command (CMD16): 0x{55 10 88 88 88 88 88 88 84 21 08 42 10 80 80 80 80 00 88 88 88 88 88 88 84 21 08 42 10 80 80 80 80 00 85}
    3) Master transmit a Preset 1 burst and listen command for 1 object (CMD 1): 0x{55 00 01 FE}
    4) Master waits the equivalent of Preset 1's record length time of 8.192ms (factory default time)
    5) Master requests slave to return the ultrasonic measurement results (CMD5): 0x{55 05}

    If you want to read the echo data dump profile instead of the ultrasonic measurement results, perform the following instead:
    1) Power-on device
    2) Master transmit a threshold bulk write command (CMD16): 0x{10 52 98 5B 00 A1 D0 90 87 4D 1C C3 FE 89 24 5A D7 6D AD B9 D1 95 D5 5D 7C 57 31 13 A7 D6 51 42 56 23}
    3) Master transmit a register write command (CMD10) to EE_CNTRL to set DATADUMP_EN=1: 0x{55 0A 40 80 35}
    4) Master transmit a Preset 1 burst and listen command for 1 object (CMD 1): 0x{55 00 01 FE}
    5) Master waits the equivalent of Preset 1's record length time of 8.192ms (factory default time)
    6) Master requests slave to return the 128 bytes of echo data dump results (CMD5): 0x{55 07}

    To update and program/burn the EEPROM values for power-cycle retention:
    1) Write to the EEPROM using CMD12 (EEPROM bulk write).
    2) Issue the EEPROM burn routine:
    To program the EEPROM, follow these steps:
    1. Send an EEPROM program command using UART or TCI with a unique unlock pattern on 4-bits.
    The program bit is set to 0 in register 0x40. The unlock passcode is 0x Dh.
    Assuming new UART_ADDR=b001, MCU transmitted UART 0x { 55 2A 40 69 2C }
    2. Immediately send the same UART or TCI command with the program bit set to 1.
    If any other command is issued after the unlock code (Step 1), the EEPROM program is initiated.
    Also, if the unlock command in Step 1 is not correct, the EEPROM is not programmed.
    The EEPROM is locked again automatically after each program command
    Assuming new UART_ADDR=b001, MCU transmitted UART 0x { 55 2A 40 68 2D }
    3) To check if the EEPROM was programmed successfully, the EE_PRGM_OK bit should read back '1'.
    Note: Programming the EEPROM is only necessary if you want to save the EEPROM values. The EEPROM values can be written to (EEPROM bulk write) and take effect immediately because the read/writes are actually taking place in the working register space.