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.

PGA460PSM-EVM: Use registerreaad to read the value of the register and the return value is always 0

Part Number: PGA460PSM-EVM
Other Parts Discussed in Thread: PGA460, ENERGIA

Hi team,

One of our customer's issues, I'm forwarding it below, could you please provide some troubleshooting suggestions

The communication for the PGA460 is in USART mode. Power is good. The customer is using the official registerread and registerwrite. However, the register value is read with registerreaad and the return value is always 0.

Also, when he use Getdistance to extract the test results through the serial port, send a drive command and the transducer does not respond.

Energia code are as follows

void setup() {
// put your setup code here, to run once:
//initPGA460();
Serial.begin(9600);
ussc.initBoostXLPGA460(3,128,0);
ussc.registerWrite(0x1E, 0x01);
Serial.print(ussc.registerRead(0x1E),HEX);}

Best Regards,

Amy Luo

  • Hello Amy,

    Thanks for posting to the sensing forum! Has the customer probed the USART communication lines to ensure that their MCU is sending data out to the device?

    Best,

    Isaac

  • Hi Isaac,

    Thank you for your response. The following is customer feedback:
    I think there should be no problem with the communication, because the EDD can be received using the UART interface, but there is no distance. The transducer does not correspond. Is it because the address is out of order? Is there any way to clear it to 0?

    Best Regards,

    Amy

  • Sorry for pushed, any update on here?

  • Hello Amy,

    Sorry for the delay, for some reason I didn’t get a notification on this thread. I am not sure what the customer meant by EDD can be received? Or the transducer does not correspond. 

    Typically if you send a measurement command and the device did not obtain anything the result is typically not zero but instead the max value based on the measurement time. If the customer confirmed that the device communicates did they ensure to write all the threshold registers on the device before attempting to make a measurement?

    Best,

    Isaac

  • Hi Isaac,

    Thank you for your help, the customer has reported that the above issue has been resolved.

    But he asked a new question:

    Register 1F is written to 0x32, but after power down.The register value changes to 10 again. Is there any way to keep it after power down?

    Best Regards,

    Amy

  • Hello Amy,

    Glad to hear that was resolved.

    Yes there is a way to keep the value written to register 0x1F, since the register is part of the EEPROM memory (non-volatile memory) it can be conserved between power cycles.

    At power up the PGA460 loads all the EEPROM values 0h-2Bh onto the device settings, if the customer wants a default value to be different they would need to program the value they wish to be loaded into EEPROM. Here is a snippet from the datasheet on how to program the EEPROM:

    I hope this helps!

    Best,

    Isaac

  • Hi Isaac,

    Sorry to bother you, but the customer asked the following code question. Could you please give your comments:

    Here's what I wrote according to the datasheet, but the register value still disappears after the power down. Where is the error

    Best Regards,

    Amy

  • Hello Amy,

    Thanks for the info. I believe the customer issue is that they are not doing a bulk write to EEPROM. This can be done using command 12 if they are communicating through UART.

    The customer needs to write the EEPROM registers in order for them to be burned into EEPROM and be available at power cycles. If they are just writing a register normally and not to the EEPROM registers then the customer is not updating the value that is being burned to EEPROM.

    There is an example of this in the PGA460_USSC.cpp code of the Energia Example Code. The name of the function is defaultPGA460.

    Best,

    Isaac