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.
Tool/software: WEBENCH® Design Tools
MSP430i2040 Embededd Metering EVM
Hello,
If you change the calibration factors in the 'metrology-calibration-template.h' file, you need to change SELECTED_STRUCT_CONFIGURATION in the 'metrology-template.h' file (on Line 150 for me). This is a flag in Flash that the metrology_init() function checks after startup in the 'metrology-setup.c' file. If this flag is not changed, the updated calibration factors in the 'metrology-calibration-template.h' file won't be loaded/used. You can change SELECTED_STRUCT_CONFIGURATION to any 8-bit number, such as 0xA9, 0xB2, 0xC4, 0xA5, etc. (just something different than previous value).
metrology-template.h (snippet)
#elif defined(i2040_SUBMETERING_EVM) #define NUM_PHASES 1 #define CONFIGURATION_SINGLE_PHASE #undef VOLTAGE_SIGNAL_IS_COMMON #undef NEUTRAL_MONITOR_SUPPORT #define SELECTED_STRUCT_CONFIGURATION 0xA8 #define PHASE_1_VOLTAGE_ADC_CHANNEL 0 #define PHASE_1_CURRENT_ADC_CHANNEL 1 #define LAST_CHANNEL 1 #undef NEUTRAL_CURRENT_ADC_CHANNEL #undef CURRENT_CHANNEL_PULSE_OUTPUT #undef UNUSED_ADC_CHANNEL #undef PHASE_2_VOLTAGE_ADC_CHANNEL //1 #undef PHASE_2_CURRENT_ADC_CHANNEL #undef PHASE_3_CURRENT_ADC_CHANNEL #undef TOTAL_ACTIVE_ENERGY_PULSES_PER_KW_HOUR #undef TOTAL_RESIDUAL_POWER_CUTOFF #undef TOTAL_REACTIVE_ENERGY_PULSES_PER_KVAR_HOUR #undef TOTAL_ACTIVE_ENERGY_SUPPORT #undef TOTAL_REACTIVE_ENERGY_SUPPORT #undef TOTAL_APPARENT_ENERGY_SUPPORT #define PHASE_1_DELAY_SPLIT 167 //#define NEUTRAL_DELAY_SPLIT 167 #endif
metrology-setup.c (snippet)
int metrology_init(void) { #if defined(__MSP430_HAS_ESP430E__) /* Make this compatible with devices containing the ESP module, by just turning it off. */ ESPCTL &= ~ESPEN; #endif /* There should always be a power scaling factor for the first current sensor channel of the first phase, whatever type of metrology is being built, and that factor should not be 0xFFFF. */ // if (cal_info->struct_state == 0xFFFF) // { // flash_memcpy((void *) cal_info, (const void *) &calibration_defaults, sizeof(calibration_defaults)); // flash_secure(); // } if(cal_info->struct_state != SELECTED_STRUCT_CONFIGURATION) { clear_calibration_data( ); flash_memcpy((void *) cal_info, (const void *) &calibration_defaults, sizeof(calibration_defaults)); flash_secure(); } #if defined(SAG_POWER_DOWN_SUPPORT) sag_power_down_control(); #endif metrology_state = 0; return 0; }
After making these changes in the code, you'll also need to rebuild the projects in the following order: (1) emter-toolkit-i2041 (2) emeter-metrology-i2041 3) emeter-metrology-i2041
Regards,
James
MSP Customer Applications
Thank you for the answer,
In my version I did not find the defines:
#define i2040_SUBMETERING_EVM
#define CONFIGURATION_SINGLE_PHASE
#define LAST_CHANNEL 1
Regards,
Rachamim
Hi James,
Subject : TEMPERATURE_SUPPORT
I'm trying to run "EnergyLibraryi2040TwoPhaseConfiguration-3.0" software on "MSP430i2040 Embededd Metering EVM" hardware.
I can not measure temperature.
It succeeds only with the software version : "Submeter i2040 8k_DC_THD_AUTO_OSR_IAR5.5_customer".
Please send me all the settings required to measure temperature (TEMPERATURE_SUPPORT).
I need a new version of "i2040-TWO-PHASE-CONFIGURATION" that includes all the settings to support temperature measurement.
Please check that it works well before you send me.
Regards,
Rachamim
Hello James,
This issue is very urgent
and i would appreciate your fast response in the manner.
Regards,
Rachamim
Hi James,
Another serious problem :
1. The "INFO" memory has been erase many times for no reason. (With "EnergyLibraryi2040TwoPhaseConfiguration-3.0" software).
This destroys the MSP430 component.
2. Why when "NEUTRAL_MONITOR_SUPPORT" is undefined (#undef NEUTRAL_MONITOR_SUPPORT)
No voltage and current measurements (no ADC interrupts).
Regards,
Rachamim
Hello Rachamim,
I apologize for the delayed response. I've been working on validating/testing the upcoming Energy Measurement Library and unfortunately haven't had much extra time.
First, I'll assume that you're referring to the ported code from the TIDM-TWOPHASEMETER-I2040 design that we shared with you to run on the EVM430-I2040S. Please confirm this so we're on the same page. Whenever you're referring to the original source code for the EVM430-I2040S or code from the TIDM-SERVER-PWR-MON design, please be very clear to point this out.
The ported code mentioned above was done quickly to allow active/reactive energy to be measured on the EVM430-I2040S and unfortunately was not thoroughly tested due to time constraints.
Regarding your INFO memory erasure, I've seen this happen when users reset or power cycle the EVM while the calibration factors are getting written to INFO memory. The process for updating the calibration factors in INFO memory happens in the following basic order: copy INFO segment contents into RAM, delete the INFO segment to ensure proper write, write back the INFO segment stored in RAM along with the updated calibration factors. If anything interrupts this process before the INFO memory gets written back from RAM, the device will not start up if the TLV has been erased (TLV is checked at startup in 'low_level_init.c'). For the i20xx devices, the minimum Flash memory segment that can be erased is 1KB, which is the total INFO memory for the i20xx devices.
I need to dig into the ported code to see what changes can be made to help mitigate the INFO memory from being erased. In the meantime, I would recommend backing up the entire Flash and INFO memory when you use a new device (and track which device the backup image is from since the TLV is device specific). This way, you can always recover it if this happens during development.
Regards,
James
MSP Customer Applications
Dear James ,
Thank you for your response !
First i would like to clarify that the issue i am facing is with the software :
TIDM-TWOPHASEMETER-I2040 that i am trying to run on hardware EVM430-I2040S
so please in your response refer only to this.
We intend to use this (TIDM-TWOPHASEMETER-I2040) software in our production , thus it is very important that it would work as intended.
the issues i am facing are :
1. using the TIDM-TWOPHASEMETER-I2040 with the EVM430-I2040S hardware , i cannot measure TEMPERATURE ( even though i used #defined SUPPORT_TEMPERATURE)
2. Why when i use #undef NEUTRAL_MONITOR_SUPPORT in the TIDM-TWOPHASEMETER-I2040 code ,
there are no voltage and current measurements ?
3. regarding the "erase INFO" issue , thank you for your response
but it is a very serious problem for us.
this issue happens in the TIDM-TWOPHASEMETER-I2040 version.
as you stated in your previous response :
if anything interrupts this process before the INFO memory gets written back from RAM, the device will not start up if the TLV has been erased (TLV is checked at startup in 'low_level_init.c').
Please fix this issue urgently .
looking forward to your fast response .
thank you.
**Attention** This is a public forum