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.
Dear Sir,
We are using MSP430I2040 for the energy measurement.
The Energy measurement in debug windiw is 706164 and the same energy information is transferred to another device via UART...
For the energy value mentioned above the UART message is as follows :
packet->payload[4] = actEnergy[0] = 0xE3;
packet->payload[5] = actEnergy[1] = 0x83;
packet->payload[6] = actEnergy[2] = 0x02;
packet->payload[7] = actEnergy[3] = 0x00;
packet->payload[8] = actEnergy[4] = 0x00;
packet->payload[9] = actEnergy[5] = 0x00;
packet->payload[10] = actEnergy[6]= 0x00;
packet->payload[11] = actEnergy[7] =0x00;
For the Hex conversion of 706164 is ox000AC674. Let me know if any mistake in my understading.
Thanks and Regards,
Fakruddin Mulla
Hello Sir,
I am using the same software package from TI, EnergyMeasurementDesignCenter , and generated code from this.
But power values and packet message both are not matching.
Thanks and Regards,
Fakruddin Mulla
Hello Sir,
Thanks for your reply.
We are using EM_GUI to generate code. Here is the results we are observed while testing :
RMS voltage : 2287901(Debug window)
Hex RMS voltage : 0x0022E91D
UART Message : 55 AA 0A 04 80 01 01 1D E9 EE 00 7F 01
VRMS data : (LSB) 1D E9 EE 00 (MSB)
VRMS value = 228.79V
Which is matching the VRMS value showed in Debug window
RMS current : 372155 (Debug window)
Hex IRMS : 0x0005ADBB
UART Message : 55 AA 0A 04 81 01 01 BB AD 05 00 E2 00
IRMS data : (LSB) BB AD 05 00 (MSB)
IRMS value = 0.372155A
Which is matching the IRMS value showed in Debug window
Power Factor : 9999(Debug window)
Hex Conversion : 0x270F
UART Message : 55 AA 0A 04 84 01 01 0F 27 2C 01
PF data : (LSB) OF 27 (MSB)
PF value = 0.9999
Which is matching the PF value showed in Debug window
Frequency :4999(Debug window)
Hex Conversion: 0x1387
UART Message : 55 AA 0A 04 85 01 01 87 13 CA 00
PF data : (LSB) 87 13 (MSB)
Frequency value = 49.99Hz
Which is matching the Frequency value showed in Debug window
Active Energy :85136922 (Debug window)
Hex Conversion: 0x0513161A (Which is not matching with packet)
UART Message : 55 AA 0A 04 89 01 01 E3 83 02 00 00 00 00 00 F7 01
Active Energy data : (LSB) E3 83 02 00 00 00 00 00 (MSB)
Active Energy value = 164835 (which is not correct)
Which is not matching the Active energy value showed in Debug window
We are able to decode the VRMS,IRMS,PF,Frequency but the Active energy is not matching with the value shown in debug window.
Please clarify ?
Hello,
Unfortunately, I was not able to duplicate your error. In CCS, I put a breakpoint at the "Comm_writePacket(packet);" line inside the "CommandHandler_transmitActiveEnergy()" function in the 'emDCCommandHandlers.c' file.
Then, I manually changed "packet->payload[4] ... payload[11]" from "actEnergy[0] ... actEnergy[7]" to hex values such as 0x1A, 0x16, 0x13, 0x05, 0x00, 0x00, 0x00 and 0x00. After sending the MCU the ACTIVE command, I confirmed that the UART packet with the command byte for Active Energy (0x89) matched what I changed in the code. To read the UART packets, I used a terminal program called Serial Port Utility and sent over the ACTIVE command one byte at a time at 250kBaud. This triggers the MSP430i2041 to start sending the results to the terminal once a second.
Next, I undid my changes above and then manually changed the "activeEnergy" expression to "0x000000000513161A (Hex)" with the code halted at the same function. After running to the same breakpoint, I again confirmed that the UART packet matched the changed expression. Here are two screenshots demonstrating my findings.
Please use the default EMDC project for the MSP430i2041 (without any changes) to generate the source code and then program the device with this code. You should be able to duplicate my results. Perhaps there's an issue with your host MCU that's reading the data from the MSP430i2041.
Regards,
James
Hello Sir,
Thanks for your attention . The issue has been solved .
Regards,
Fakruddin
**Attention** This is a public forum