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.
Hey there,
I'm using MSP-EXP430F5529LP and PGA460PSM-EVM. I did connection (the PGA460PSM-EVM's UART pins to the MSP-EXP430F5529LP (PGA460 TXD to MSP430 p3.4 and PGA460 RXD to MSP430 p3.3)) and uploaded " PGA460 Energia Library and Code Example (Version 1.0.9) (Rev. I)" code with Energia. Then, I opened serial port display (COM6) and system worked. But it wanted to set all settings from me on keyboard. I did some settings and it run but it gave always 0.35m distance. Never it saw correct distance and I don't know what I should. COM6 display as follows.
You can see my settings on this picture but I want to re-write for you can understand better:
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
I looked GetDistance.ino for this settings (Communication Mode, P1 and P2 Thresholds, Transducers Settings, TVG Range, Fixed TVG Level) But I don't know what should be others (Minimum distance, Run System Diagnotistics, Echo Data Dump, Burn/Save User EEPROM, Command Cycle Delay, Number of Objects to Detect, USART Address of PGA460)
Is this settings right? If not, can you say correct settings?
Measured distances as follows.
Without setting, at first, when I pressed "s", it did not take any measurements:
Later I tried again to entered "s", it worked good firstly but a few seconds later it stuck and measured 0.3m consistently:
I changed sensor's place, but measured distance didn't changed.How can I fix it? I will use PGA460 in my project and I need to run correct this module for understand better.
And I saw maximum 1.5m distance, I need 3m. In the code, it seems to be able to measure even more than 3 meters. How should I set this up or where am I wrong?
Hello,
The device comes with the PUI Audio transducer which is resonating at 40 Khz. The defaults settings from the GUI and the code should enable measurements unless
Have you changed the transducer ? If yes, what is the frequency you need to drive the transducer. Are you driving the traducer at that frequency ?
You mentioned it worked for a while ? Are the connection from the transducer to the EVM stable with no loose wire connections ?
If I had changed the sensor, I would have already said. The sensor has not been replaced. All the same. I want all settings for this system from you. When I wrote in paragraphs, I realized that I could not get answers to all my questions, and therefore I will write step bu step.
Hello,
In the examples directory there is a sample code GetDistance_G2553.ino you can find this as well if you get to "Install folder"/example/GetDistance_G2553/
Here is the code that works behind the scenes.
Serial.begin(baudRate); // initialize COM UART serial channel
delay(1000);
Serial.println("PGA460-Q1 'G2553 SPI Energia Demo for Ultrasonic Time-of-Flight");
Serial.println("-------------------------------------------------------------------------");
Serial.println("Instructions: Configure the EVM by entering a byte value between 0-9 or 'x' per request.");
Serial.println("--- Input can be entered as a single string to auto-increment/fill each request. E.g. 3410211000510");
//Serial.println("--- To skip the COM setup at any point, and use the hard-coded values from thereon, enter a value of 's'.");
//Serial.println("--- To reset the program, and re-prompt for user input, enter a value of 'q'.");
//Serial.println("--- To pause/resume the program when running, enter a value of 'p'.");
Using "s" uses the hard coded values. So default settings and values apply.
The system should be capable of measuring 1m. Its unclear why it measures for sometime and dissapears. Can you add more along the lines of what could have changed during the setup ? Did this occur again if you reset the module by unplugging it and using the default settings ?
If you change your transducer you should change the settings to reflect the driver frequency.
Firstly, I'm using GetDistance.ino code, not GetDistance_G2553.ino. I'm sorry about your answer because you didn't answer my questions clearly even though I wrote step by step.You didn't answer 1th and 2st questions.
I know already "s" is mean default settings. I asked you, what are these settings? I mean, Echo Data Bump=1 or 2 or 0, Run System Diagnotistics: 1 or 0?? Which is true? I desribed very clearly to you but I think you couldn't understand me at all.
I want to measure for 4meters. What should I do? What should I change in this project? I see it measure up to 11 meters in the code and the PGA460's datasheet. I see sensor measure up to 4 meters in the datasheet. Why is this measure up to 1 meters?
Hello,
I noticed that there is another thread you have started on the PGA460-Q1 and have requested ifnormation on the GetDistance_G2553.ino. Are you able to resolve this and get your hardware up and running ? https://e2e.ti.com/support/sensors/f/1023/t/919707
Arjun
These are different titles. I have question more than one and I seperated the topics. My question here was unanswered, I wish you answered the author here, not my other questions.
Hello,
Let me assign this thread to Akeem who is the owner of the code. he is going to reachout to you for any further questions. He may take sometime to respond as he is catching up with the rest of the threads.
Thanks for your patience.
Hi Lacin,
Since you have the MSP-EXP430F5529LP, I recommend that you use a different debug approach; let's start with the PGA460-Q1 EVM GUI ( www.ti.com/.../slac739 ) to optimize your device settings. The reason the Energia script isn't working for you is because you are selecting the device settings optimized for the Murata MA40M1S-R transducer, and not the PUI Audio UTR-1440K-TT-R. The Energia script has not yet incorporated pre-defined values for the PUI Audio transducer of the PGA460PSM-EVM, but I will show you how to import these settings little later in this post.
GUI steps:
The reason I recommend you start with the GUI is to help you visually the echo activity. Because the device offers many settings in terms of time varying gain, threshold mapping, and DSP filter coefficients and scaling, it is difficult to understand the root cause by only monitoring the serial port text output.
Keep you hardware connected as-is to run the PGA460PSM-EVM via UART through the MSP-EXP430F5529LP when using the GUI.
Import the following register map text file into the GUI's Memory Map as a good starting place for the PUI transducer.
;GRID_USER_MEMSPACE 00 (USER_DATA1),41 01 (USER_DATA2),11 02 (USER_DATA3),11 03 (USER_DATA4),10 04 (USER_DATA5),FF 05 (USER_DATA6),FF 06 (USER_DATA7),00 07 (USER_DATA8),00 08 (USER_DATA9),08 09 (USER_DATA10),20 0A (USER_DATA11),C6 0B (USER_DATA12),30 0C (USER_DATA13),38 0D (USER_DATA14),50 0E (USER_DATA15),80 0F (USER_DATA16),00 10 (USER_DATA17),00 11 (USER_DATA18),00 12 (USER_DATA19),00 13 (USER_DATA20),00 14 (TVGAIN0),9D 15 (TVGAIN1),EE 16 (TVGAIN2),EF 17 (TVGAIN3),2D 18 (TVGAIN4),B9 19 (TVGAIN5),EF 1A (TVGAIN6),DC 1B (INIT_GAIN),03 1C (FREQUENCY),32 1D (DEADTIME),80 1E (PULSE_P1),12 1F (PULSE_P2),12 20 (CURR_LIM_P1),72 21 (CURR_LIM_P2),32 22 (REC_LENGTH),09 23 (FREQ_DIAG),00 24 (SAT_FDIAG_TH),EE 25 (FVOLT_DEC),7C 26 (DECPL_TEMP),8F 27 (DSP_SCALE),00 28 (TEMP_TRIM),00 29 (P1_GAIN_CTRL),29 2A (P2_GAIN_CTRL),29 2B (EE_CRC),76 40 (EE_CNTRL),04 41 (BPF_A2_MSB),89 42 (BPF_A2_LSB),52 43 (BPF_A3_MSB),FC 44 (BPF_A3_LSB),CE 45 (BPF_B1_MSB),01 46 (BPF_B1_LSB),99 47 (LPF_A2_MSB),7F 48 (LPF_A2_LSB),33 49 (LPF_B1_MSB),00 4A (LPF_B1_LSB),67 4B (TEST_MUX),00 4C (DEV_STAT0),80 4D (DEV_STAT1),00 5F (P1_THR_0),41 60 (P1_THR_1),11 61 (P1_THR_2),11 62 (P1_THR_3),10 63 (P1_THR_4),FF 64 (P1_THR_5),FF 65 (P1_THR_6),00 66 (P1_THR_7),01 67 (P1_THR_8),F8 68 (P1_THR_9),20 69 (P1_THR_10),C6 6A (P1_THR_11),30 6B (P1_THR_12),38 6C (P1_THR_13),50 6D (P1_THR_14),80 6E (P1_THR_15),00 6F (P2_THR_0),41 70 (P2_THR_1),11 71 (P2_THR_2),11 72 (P2_THR_3),10 73 (P2_THR_4),FF 74 (P2_THR_5),FF 75 (P2_THR_6),00 76 (P2_THR_7),01 77 (P2_THR_8),F8 78 (P2_THR_9),20 79 (P2_THR_10),C6 7A (P2_THR_11),30 7B (P2_THR_12),38 7C (P2_THR_13),50 7D (P2_THR_14),80 7E (P2_THR_15),00 7F (THR_CRC),F9 EOF
This file is contains the register settings similar to what was used to capture PUI transducer data for the PGA460PSM-EVM Design Guide TIDA-060024.
What you will need to do next is optimize the device settings as demonstrated in the Ultrasonic Sensing with the PGA460-Q1 video series for your 4m requirement. Optimization includes settings the proper amount of pulses, driver current limit, record length, time varying gain level/time values, DSP filter coefficients, digital gain multipliers, and threshold level/time values (all of which is covered in the video series). Alternatively, view the PGA460 Ultrasonic Module Hardware and Software Optimization app report for an understanding of these settings. Once you have optimized your device settings, you can burn the EEPROM, and save/export a copy of the memory map register values to a text file.
Energia steps:
Now that you have an optimized register map for your EVM, you can go to Energia. The reason why you are seeing 0.3m constantly is most likely because the threshold was being triggered at some point during the decay. This false-positive will no longer occur singe you have already checked your newly optimized settings in the GUI.
The PGA460 has a maximum record length of 65ms, which is 11m in distance through air. You should have configured your preset record length in the GUI to detect up to 4m.
The Energia serial input descriptors you have questions about are as follows:
Note, if you have already programmed the PGA460 with the optimized register values using the GUI, you can skip all of these settings except the threshold. The threshold will always need to be updated because the threshold registers are the only registers not part of the EEPROM memory.
The strategy for optimizing any transducer should be the same: always use the GUI to easily modify, configure, and monitor the results before moving to Energia. It is much easier and faster to use the GUI, than to try and update the PGA460_USSC.cpp file every time you want to change and try a different register value. The Energia sketch should report the same distance value as what the GUI reports in the Ultrasonic Measurement Results table, so you shouldn't have any issues by the time you move to Energia.