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: energia debug

Part Number: PGA460
Other Parts Discussed in Thread: ENERGIA

Hello,

I want to use serial port communication with a PGA460, the program uses GetDistance, but it appeared error - did not receive measurement results!

I checked the library program of the PGA460 and found that there was a problem starting from the note which I marked yellow:

Please help to analyze.

Best regards

Kailyn 

  • Hi Kailyn ,

    Can you probe the RX pin of the PGA460 with a logic analyzer and verify that the microcontroller is sending the appropriate commands to the PGA460?  Can you also probe the TX pin of the PGA460 to check if the device is actually responding to the commands but the microcontroller is not picking it up?

    Regards,

    Mekre

  • Hi Mekre,

    Yes, he can pick up the value from the pullEchoDataDumpBulk, but couldn't read the value from printUltrasonicMeasResult.  And the OUTA  voltage is always 

    9V, the Pin1,2&3 voltage of transformer are all 9V, pin 4&6 is 0V. 

    Best regards

    Kailyn 

  • Hi Kailyn,

    From the schematic snippet, I noticed that the RXD and TXD pins are not connected to anything.  Are they using one-wire uart on the IO pin?  If so, do they have a one wire interface circuit, similar to the one below:

    Can they also try the following:

    • After the Serial1.write command in the code snippet they shared, can they verify that they see pulses on the OUTA/OUTB pins?
    • Can they tell me the register values, specifically the value of the EE_CNTRL register?
    • Before doing the printUltrasonicMeasResult function, can you confirm that they performed a burst and listen operation?
    • Please provide info on the settings they typed in the Energia console to configure the device (baud rate, thresholds, transducer settings, tvg range, tvg level, distance, and all the other settings selected from the console).

     

    Thank you,

    Mekre

  • Hello Mekre,

    OUTA/OUTB  has no pulse signal; OUTA is always high, and OUTB is always low. 

    EE_CNTRL=0x80.

    void loop() { // put your main code here, to run repeatedly
    // -+-+-+-+-+-+-+-+-+-+- PRESET 1 (SHORT RANGE) MEASUREMENT -+-+-+-+-+-+-+-+-+-+- //
    objectDetected = false; // Initialize object detected flag to false
    ussc.ultrasonicCmd(0,numOfObj); // run preset 1 (short distance) burst+listen for 1 obj
    ussc.pullUltrasonicMeasResult(demoMode); // Pull Ultrasonic Measurement Result
    for (byte i=0; i<numOfObj; i++)
    {
    // Log uUltrasonic Measurement Result: Obj1: 0=Distance(m), 1=Width, 2=Am、plitude; Obj2: 3=Distance(m), 4=Width, 5=Amplitude; etc.;
    distance = ussc.printUltrasonicMeasResult(0+(i*3));
    //width = ussc.printUltrasonicMeasResult(1+(i*3)); // only available for UART, OWU, and SPI
    //peak = ussc.printUltrasonicMeasResult(2+(i*3)); // only available for UART, OWU, and SPI

    delay(commandDelay);

    if (distance > minDistLim && distance < 11.2) // turn on DS1_LED if object is above minDistLim
    {
    ussc.toggleLEDs(HIGH,LOW,LOW);
    Serial.print("P1 Obj"); Serial.print(i+1); Serial.print(" Distance (m): "); Serial.println(distance);
    //Serial.print("P1 Obj"); Serial.print(i+1); Serial.print(" Width (us): "); Serial.println(width);
    //Serial.print("P1 Obj"); Serial.print(i+1); Serial.print(" Amplitude (dec): "); Serial.println(peak);
    objectDetected = true;
    }


    Communication Mode: 0=UART
    UART kBaud: 0=9.6
    P1 and P2 Thresholds: 1=%50
    Transducers Settings: 1=Murata MA40M1S-R
    TVG Range: 2=53-84dB
    Fixed TVG Level: 1=%50
    Minimum distance: 0.1m*BYTE (I wrote 1 for BYTE) => 0.1*1= 0.1m
    Run System Diagnotistics: 1=Yes
    Echo Data Dump: 1=P1BL
    Burn/Save User EEPROM: 1=Yes
    Command Cycle Delay: 100ms*BYTE (I wrote 1 for BYTE) => 100*1=100ms
    Number of Objects to Detect (1-8) = 1
    USART Address of PGA460 (0-7) = 0

    Best regards

    Kailyn

  • Hi Kailyn,

    Your last post has a different schematic than the original schematic. In the original schematic, there does not appear to be any connection to the RXD and TXD pin. The new schematic seems to copy one of our EVM schematics, which has connections to the RXD and TXD pins. Can you tell me the following:

    • Which is the correct schematic?
    • Is the customer using One Wire UART (OWU) using the IO pin on the PGA460, or are they using standard UART using the PGA460 RX and TX pins?
    • EE_CNTRL=0x80, which indicates that the datadump_en bit is set; however, this bit should be set for the transducer echo data dump command(command=7) instead of the ultrasonic measurement result command(command=5) that they are having issues with.

    Regards,

    Mekre

  • Hello Mekre,

    Thank you for your reply, and I have confirmed with the customer , the below schematic is correct.  And they are using RX and TX pin to communication.

    He could read the data of Echo Data Dump, but could't read  the data of Ultrasonic Measurement Results.

    So which register is about the Ultrasonic Measurement Results? 

    Best regards

    kailyn 

  • Hi Kailyn,

    To get the ultrasonic measurement result, you would need to send the command highlighted below instead of reading a specific register.

    However, before sending the highlighted command, you should make sure that the DATADUMP_EN bit shown below in the EE_CNTRL register is not set:

    Regards,

    Mekre

  • Hello Mekre,

    The customer tried the EVM board and could get back results from GetDistance,  but his own board couldn't.

    In addition, he sent 0X55 0X00 0X01 0XFE 0X55 0X05 0XFA with serial port, there is not any data back.  He wanted to send command with serial port, but he couldn't get any back data.

    Best regards

    Kailyn 

  • Hi Kailyn,

    Can they probe the RX and TX pins of the PGA460 with a logic analyzer, and then send me a screenshot of the logic analyzer data packet on these pins?  Also, what microcontroller are they using to communicate to the PGA460?

    Thank you,

    Mekre

  • Hello Mekre,

    Thank you for your reply.

    The customer has no logic analyzer and he tested with oscilloscope, and we could found that TXD has almost no signal and RXD has noise as below:

    Best regards

    Kailyn 

  • And the microcontroller he used is MSP460F5529.

    Best regards

    Kailyn 

  • Hi Kailyn,

    I would expect there to be a voltage on the RXD pin, but the waveforms do not show this present.  To verify that they are probing at the right location, can they try running the command that they mentioned works correctly to see if they observe something on the oscilloscope? 

    Thank you,

    Mekre