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.

display settings with modified software

Part Number: MSP430FR6047

I am developing an ultrasonic flow sensor and modulated the software.

Because I only want the information of the current flow values, I deleted the statemachine and the button-handling in the code. Only the function lcd_statemachine_displayFlowRate() remains. I set it in HMI_PostAlgorithm_Update after the heartbeat toggle.
My program works but when I disconnect the chip from the power source and reconnect it, the display stays empty. Only the lights start to shine. I debuged the program and found out that in this case, the process hangs in an interrupt: commonTimerWaitEvent in ussSwLibCommonTimer.c
When I comment (or delete) the while-loop in commonTimerWaitEvent the program runs in various functions but my display stays empty.

I always have to reflash the code that the display shows the flowrate.

Do you have an Idea how to fix this?

Best regards,
Kathrin

  • Hi Kathrin,

    Kathrin Honermann said:
    Only the lights start to shine.

    What does that mean, with reference to the SW? Are you referring to LEDs blinking on the board?

    Kathrin Honermann said:
    the process hangs in an interrupt: commonTimerWaitEvent in ussSwLibCommonTimer.c

    What does "hangs" mean here? The application library is no longer generating flow measurements? I think the commonTimerWaitEvent is used in lot of the functions in the library. 

    If you focus on just the lcd_statemachine_displayFlowRate(), is it setting displayData_ptr correctly and going through lcd_statemachine_writeLCD()?

    Srinivas

  • Hi Srinivas,

    "Only the lights start to shine": LED D101, D201 and LED3 (if no water is in the sensor) are on, LED D202 is blinking 3x and than turns off.

    "The process hangs in an interrupt":  I meant with "hanging" that when I paused the program with the debug-tool it was always in the routine commonTimerWaitEvent. Now I debugged more properly and set some breakpoints. The process goes through HMI_PostAlgorithm_Update and lcd_statemachine_displayFlowRate. I am not shure if it does the firsttime-routine because I need some time to reconnect.

    When I click "Step Over" (in many parts of the code, eg. when the programm is at HMI_PostMeasurement_Update() in USSLibGUIApp_Engine) I always get to USSLIB_HAL_TIMER_INT. I am sorry that I can not give you very proper information with the process and interrupt behaviour.

    When I open the USS-GUI I am able to connect it to the device but I don't get any values. I am not able to request an update and I get an error message: error 22 The output frequency of the HSPLL is invalid

    I hope, these informations help more.

    I also have a new question. I would like to measure the volumeFlowRate in l/min instead of l/h. I already achieved to change the unit on the display but in the USS it still calculates in l/h. I did not find the proper place in the code where finally the flow rate is calibrated before sending it to the USS. I would like to leave all calculations as they are and just calculate /60 if possible.
    In addition to that it would be great when it is possible for me to calibrate the flowmeter with the USS as usual but typing in the flow rate in l/min. How is it possible to adapt the code for my case of use?

    And sometimes the USS shows the error "Time between measurements is greater than UPS0 to UPS1 Gap". I found out that I can handle this error by changing the numbers of pulses and the UPS0 to UPS1 Gap. Is there a rule in which proportion these two values should be to not generate the error? How does the program use these two parameters exactly? Does it calculate the average of the results from all pulses to calculate one flow rate in the time of the UPS0 to UPS1 Gap or does it calculate after every pulse and just shows the actual result once each UPS0 to UPS1 Gap?

    Kind regards,

    Kathrin

  • Hi Kathrin,

    Can you please check if inside lcd_statemachine_displayFlowRate(), when you step through, is it setting displayData_ptr correctly and going through lcd_statemachine_writeLCD()? Are these pointers and data set as expected based on the data?

    Kathrin Honermann said:
    I did not find the proper place in the code where finally the flow rate is calibrated before sending it to the USS.

    In HMI_PostAlgorithm_Update(), you will see the following lines of code that sets the data to be sent to the USS Design Center GUI:

    DC_User_Params->plot_dtof = ((double) alg_results_float.deltaTOF);
    DC_User_Params->plot_abs_ups = alg_results_float.totalTOF_UPS;
    DC_User_Params->plot_abs_dns = alg_results_float.totalTOF_DNS;
    DC_User_Params->plot_vol_flow_rate = alg_results_float.volumeFlowRate;

    You can do the multiplication by (float) (1/60) on the DC_User_Params->plot_vol_flow_rate if you just want to modify what is reported to the GUI.

    Kathrin Honermann said:

    In addition to that it would be great when it is possible for me to calibrate the flowmeter with the USS as usual but typing in the flow rate in l/min. How is it possible to adapt the code for my case of use?

    You can just enter the values in LPM. I think that should work.

    Kathrin Honermann said:
    sometimes the USS shows the error "Time between measurements is greater than UPS0 to UPS1 Gap".

    You need to make sure this value is greater than the time for the full measurement. Usually, even 100 ms, which is equivalent to 10 measurements/secon, should be sufficient to ensure that you do not get this error. What value are you using for this setting?

    Kathrin Honermann said:
    Is there a rule in which proportion these two values should be to not generate the error? How does the program use these two parameters exactly?

    You can look at Figure 31 . Profile of Current Consumption During Duration of Measurement of the TI Design for ultrasonic water flow meter (https://www.ti.com/tool/TIDM-02005) -> https://www.ti.com/lit/pdf/tidues5. It gives a timing diagram. You need to make sure the "Time between measurements is greater than UPS0 to UPS1 Gap" is more than the time taken for all the steps shown in that diagram.

    Kathrin Honermann said:
    Does it calculate the average of the results from all pulses to calculate one flow rate in the time of the UPS0 to UPS1 Gap or does it calculate after every pulse and just shows the actual result once each UPS0 to UPS1 Gap?

    It calculates just once based on all the pulses.

    Srinivas

  • Hi Srinivas,

    sorry for responding late. I have some exams to write and did not have enough time to step through all your points.
    Thank you for all these informations so far. I will fully respond as soon as possible.

    Kathrin

  • Hi Srinivas,

    now I got the time to step through your answers.

    Thank you for the informations about the calibration in lpmin. It should work now.

    „Can you please check if inside lcd_statemachine_displayFlowRate(), when you step through, is it setting displayData_ptr correctly and going through lcd_statemachine_writeLCD()? Are these pointers and data set as expected based on the data?“
    I set a breakpoint in lcd_statemachine_displayFlowRate() at displayData_ptr->character[5] = 'L' and at lcd_statemachine_writeLCD. When I step through these points the first time, all works correctly. When I disconnect and reconnect the board and let it again run to any of my breakpoint and click Step Over or Step Into, I get to the interrupt USSLIB_HAL_TIMER_INT. Only when I klick Step Out I get to the next „normal“ code. At least the code reaches the breakpoints but it seems that it does not execute the lcd_statemachine_writeLCD because it does not reach any breakpoint that I set in lcd_statemachine_writeLCD.

     

    My actual settings in the USS are:

    Number of pulses = 25
    PS and DNS Gap = 3,000
    UPS0 to UPS1 Gap = 1,000

    and advanced: 

    Do I understand you right that my UPS0 to UPS1 Gap has to be greater than what I calculated for the whole time of the period shown in the diagram? I calculated 987,531 ms for my cycle time. So it should be ok but close to the maximum.
    For the calculation I just changed the value for the Upstream/Downstream Gap of the diagram to the 3us that I sat in the USS.

    Kind regards,

    Kathrin

  • Hi Kathrin,

    Kathrin Honermann said:
    but it seems that it does not execute the lcd_statemachine_writeLCD because it does not reach any breakpoint that I set in lcd_statemachine_writeLCD.

    Can you see the state of the g_lcd_statemachine.current_state? It is possible that that state has gone to "sleep"  (LCD_STATEMACHINE_sleepLCD)?

    Kathrin Honermann said:

    My actual settings in the USS are:

    Number of pulses = 25
    PS and DNS Gap = 3,000
    UPS0 to UPS1 Gap = 1,000

    For these settings, you should not be getting that error "Time between measurements is greater than UPS0 to UPS1 Gap". 

    Kathrin Honermann said:
    Do I understand you right that my UPS0 to UPS1 Gap has to be greater than what I calculated for the whole time of the period shown in the diagram?

    Actually, you do not have to count that Sleep (LPM3) 985 ms. Your settings are ok. I am not sure why you are getting that error. One possibility is that it is not finding any ADC signal when it hits that error. Do you know if that is happening?

    Srinivas

  • Hi Srinivas,

    I deleted LCD_STATEMACHINE_sleepLCD and the current_state because my display just has one state. But now I searched for functions that turn off the LCD and found out where the display is turned off and corrected the bug.

    The UPS-error likely appeared with errors that no signal was detected. I often had an empty pipe. So this should be the problem and I will ignore further errors in this case.

    Thanks for your help.

    Kathrin

**Attention** This is a public forum