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.

Linux/PGA460-Q1: PGA 460 -Q1 is Interfaced with ARDUINO UNO

Part Number: PGA460-Q1
Other Parts Discussed in Thread: PGA460, BOOSTXL-PGA460, ENERGIA, MSP-EXP430F5529LP

Tool/software: Linux

hello everyone

I had done pga460-Q1 with arduino. Now i am only able to read the reset values from pga460 using response commands but am not able to write eeprom and all threshold registers. I had triedto write using the appropriate commands but i can only read this below values what i attached to this post...

can anybody help me how to write..

  

Advance thanks

  • Hi Prapeep,
    What values are you transmitting for the EEPROM write? When you say "EEPROM write", are you trying to burn/program the EEPROM?

    If yes, to program the EEPROM, follow these steps (discussed in the PGA460 Software Development Guide):
    • Step 1. Send an EEPROM program command using UART or TCI with a unique unlock pattern of 4- bits. The program bit is set to 0 in the 0x40 register. The unlock passcode is 0xDh.
    • Step 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 sequence is aborted. 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. Example code of this is available in the PGA460 Software Development Guide on page 16 of 48.

    If no, and you are you trying to write to a single/bulk register(s), use the GUI's Interface Mode page to check your transmit values.
    For example, if you want to update the frequency value to 40kHz to a PGA460 with UART address 0, send: {0x55, 0x0A, 0x1C, 0x32, 0xA7}
    where
    •0x55 = sync byte
    •0x0A = UART address 0 and command 10 for Register write
    •0x1C = register named FREQUENCY
    •0x32 = value equating to 40kHz
    •0xA7 = checksum result

    Use the GUI's Interface Mode UART Terminal to enter the M-to-S Data Bytes in Hex as: 0A 1C 32 (notice there is no sync byte, since sync byte is not included in checksum calculation). When you click "Calculate and Append Checksum", you'll see a value of A7 appended to the same string. This represents the values required to update the Frequency register.
  • thank you Akeem Whitehead..

    Now am ok with eeprom read and write.

    But the present problem is if i use bulk read command either EEPROM or Threshold. I will get first 5 bytes randomly. After 5 bytes am reading exactly what i had wrote.

    Suppose If  i read those equivalent registers one by one, then only i will get correct values.

    I don't know what is the problem. Even i changed the baud rates its not working properly. 

    And also please help me out the steps to get ultrasonic measurement properly from step1? 

    Advance thanks....

  • Hi Pradeep,
    Is it possible that the first five random bytes you are reading are residual bytes from a previous command? You may need to flush or clear your serial buffer before reading data from the PGA460. After these five random bytes, does the for a EEPROM bulk read start at USER_DATA1 (addr 0x00) or USER_DATA6 (addr 0x05)?

    To clarify is you last question:
    "And also please help me out the steps to get ultrasonic measurement properly from step1?"
    asking how to read the ultrasonic measurement results from command 5?
    If so, the typical process is to send a burst+listen command, then wait the duration of the record length for that particular preset. Therefore, you may need to wait a minimum of 4.096ms, or a maximum of 65.536ms depending on your Time-of-flight and range requirement.
  • Hello akeem whitehead

    1. Is it possible that the first five random bytes you are reading are residual bytes from a previous command?

    No those are not any residual bytes. Those are not related to any registers.

    2. You may need to flush or clear your serial buffer before reading data from the PGA460.

    yes of course am flushing the serial buffer before every read command. And also i tried flush after command. But its not working.

    3. After these five random bytes, does the for a EEPROM bulk read start at USER_DATA1 (addr 0x00) or USER_DATA6 (addr 0x05)?

    No its start from Data7(addr 0x06) to P2_gain_control.

    4. asking how to read the ultrasonic measurement results from command 5?

    No its not from there. Its from all registers initialisation to till ultrasonic measurement result.

    Flow graph from initialisation to distance reading.

    My new question is

    What is the peak to peak voltage of BURST from OUTA and OUTB pins.

    Am only getting BURST Pulses below 500mv.

    What should i do now?

  • Pradeep,
    Are you using the BOOSTXL-PGA460 BoosterPack with the Arduino, or have you built your own PGA460 board? I highly recommend that you use the BOOSTXL-PGA460 for your initial evaluation.

    OUTA and OUTB are open-drain pins, meaning that they act as inputs to sink current to ground through internal FETs, and cannot source any current or voltage. You need to connect a transformer with a center-tap to the outer ends of the primary side, and connect VPWR to the primary's center-tap (up to 28V). OUTA and OUTB will also be referenced to VPWR when inactive.
    An example of this circuit is provided in the PGA460-Q1 datasheet (www.ti.com/.../pga460-q1.pdf) Figure 134. Transformer-Driven Method Schematic on page 101.

    I highly recommend that you watch the six-part video series discussing the PGA460-Q1 EVM+GUI (training.ti.com/ultrasonic-sensing-pga460-q1)
    Part 1.2 disucsses PGA460 ultrasonic sensing: EVM hardware, transducer, and driver selection to help provide a better understanding of the OUTA and OUTB pins.

    If you are seeking a flow graph showing the typical operation, refer to the PGA460 Software Development Guide (www.ti.com/.../slaa730) Figure 2. Detailed Software Sequence Flowchart.
  • Hi,
    could you share the code developed?
    I wish to make a final library version to upload on github for the whole community.
    I'm developing a 360° ultrasonic eye using several ceramic trasducers

    Thanks in advance
  • Alessio,
    The latest version of the PGA460 Energia Library and Code Example (Version 1.0.1) (Rev. A) is available at:
    www.ti.com/.../slac741

    This update includes several bug fixes and additional features (revision notes available in download).
  • OK thanks

    I supposed that was only a software for windows to make settings and so on.....

    On the contrary there is the Arduino library in one folder after the installation.

    The big issue is that everything is compilable for the Energia IDE under the MSP430 uC, not for the classic ATmega328p as Arduino is used to.

    How can I compile it for the UNO board?

    Alessio

  • Hi Alessio,
    The Energia IDE uses the same programming language/structure as the Arduino IDE. Actually, Enegria is a derivative of the Arduino IDE to allow the TI LaunchPad series to repurpose code originally developed for Arduino hardware. Therefore, the example library created for the BOOSTXL-PGA460 should also be able to compile+run on the ATmega328p (or MSP-EXP430F5529LP equivalent), assuming the same amount of memory, number of serial interfaces, and number of GPIOs are available.

    Have you tried to compile the code in Arduino's IDE? What is the outcome?
  • I will, as soon as I have a time slot I will do it.

    I keep you posted

    Thanks