MSP430F425: Calibrating the e-meter

Tool/software: TI C/C++ Compiler

HI,

I have to work on MSP430F425. My code in the TI TIDC299 software.

I tried to calibrate the meter but the texas instruments 430 calibrated mass

  Turn on red. So there is a communication error. I used a simple terminal to test communication uart which is configured in tidc449 I find that the communication is established correctly and there are messages that I received. I did not understand where the problem is. I think there is a communication between the graphical interface of TI GUI and the code tidc499 which allows to test the communication because there is no problem on the hardware side. I need help to know the instruction in the communication part which is dided to test the communication. Always the graphical interface turning red.emeter-communication.c

  • I think the problem in the function
    Int prepare_tx_message (int len)
    Is that this function ensures the communication test between the interface and the counter !!
      Help me please .
  • In reply to arfaoui aymen:

    Arfaoui,

    Are you configuring the COM port on your PC properly? You have to check Device Manager in Windows to find out which COM port the RS232-to-USB adapter is using. Then, you have to update the COM port number in the 'calibration-config.xml' file in "tidc299.zip" -> "emeter-software" -> "emeter-software" -> "GUI" folder. Also, I'm assuming that you're using one of our EVMs or a custom hardware that has the UART interface implemented properly.

    Regards,

    James

    MSP Customer Applications

  • In reply to James Evans:

    thank you James for reply,
    Yes i have configure com 6 and also i change the port in the xml file of GUI and i am sure the hardware communication is well established. Because I have tested its functionality by a simple terminal I think the problem software side for this I am looking for it is the responsible function has established the beginning of communication.

  • In reply to arfaoui aymen:

    If you are using a simple terminal program, you'll need to send commands to the i20xx device using the dlt645 protocol. I've found that the Serial Port Utility terminal software allows multi-byte packets required for this protocol to be generated. The GUI uses this protocol with the default communication code to pass data back and forth. Since you're using a simple terminal program, you're probably sending data byte-by-byte, which may not work correctly with the state machine in the code for the various commands. Perhaps you could use a logic analyzer to monitor what's being send over the UART interface as well.

    Although you are sure that your hardware is working, it may be good to try the original code on our EVM as a comparison. If you're already using an EVM, then this wouldn't apply.

    Regards,

    James

    MSP Customer Applications

  • In reply to James Evans:

    Hi JAMES,

    I think I can do an interface using MATLAB which allows to read and write data on the counter to calibrate the values ​​to avoid the standard screen format for the old interface is possible !!! I change my configuration uart for a simple communication of sending and receiving the problem is what possible to interfere MATLAB with MSP430F425 !! Is what a good idea !! Because I think the TIDC299 code uses an IEC1107 communication protole and the interface uses dlt645.

  • In reply to arfaoui aymen:

    Hello,

    You can use MATLAB to read and write data from/to the device, but you'll have to either change the existing protocol in the code according to the protocol that you've chosen or match the existing protocol. For the first option, this would require a substantial amount of work for you, but if the latter option won't work (e.g. commands don't do what you need them to do), it can be done.

    I'm sorry if I've misunderstood your question.

    Regards,

    James

    MSP Customer Applications

  • In reply to James Evans:

    James is what you can explain how to change protocol with MATLAB !! If you have any documents or a link that can help me !!!
    thank you very much
  • In reply to arfaoui aymen:

    Hello,

    Unfortunately, I don't have much experience with using MATLAB to interface with hardware, but I found some links that may be helpful (see below). Also, if you interested in keeping the DLT645 protocol as-is on the MSP430F425 and just want to use MATLAB to read the results, calibrate the device, etc., I would encourage you to post a question about how to do this in MATLAB's Community and Support website.

    If you would like to change the DLT645 protocol, this can be done but would involve extensive work. I don't have any specific references on how to do this, but if you have a specific UART-based protocol that you're required to use, you can modify the code to create the appropriate data packet (frame start notification, address, control bits, data, checksum, etc.) according to the specifications for that protocol. For example, you can read about the structure of the DLT645 protocol in Appendix A in the MSP430AFE253 Test Report for China State Grid Specification app note.

    Hopefully this helps.

    Regards,

    James

    MSP Customer Applications

  • In reply to James Evans:

    thank you james,
    i Have a problem when i transfer the data by uart the data receive in MATLAB interface is not the same i don't unserstund where is the problem ( baudrate of uart is not good configuration or the data in rs232 change the format)

    //UART CONFIGURATION
    UCTL0 = SWRST;
    P2DIR |= (BIT4);
    P2OUT &= ~(BIT4);

    P2SEL |= BIT4 + BIT5; // P2.5 UCA0RXD inputBIT4 +
    ME1 |= UTXE0 + URXE0; // Enable USART0 TXD/RXD
    UCTL0 = CHAR;
    UTCTL0 |= SSEL1; // UCLK = ACLK = 32.768kHz
    UBR00 = 0x69;
    UBR10 = 0x3;
    UMCTL0 = 0x03;
    UCTL0 &= ~SWRST; // Initialize USART state machine
    IE2 |= URXIE0 + UTXIE0; // Enable USART0 RX/TX interrupt



    // interruption de reception et de transmition
    #if defined(__MSP430__)
    /* Interrupt to accept IEC1107 messages. */
    ISR(USART0RX, serial_rx_interrupt0)
    {
    uint8_t ch;
    int i;
    int sum;

    ch = RXBUF0;


    IFG2 &= ~URXIFG0;

    }
    #endif


    /* Interrupt to send IEC1107 messages. */
    #if defined(__MSP430__)
    ISR(USART0TX, serial_tx_interrupt0)
    {


    TXBUF0 = rx_msg;



    IFG2 &= ~UTXIFG0;
    }
    #endif
  • In reply to arfaoui aymen:

    The UART of MSP430 work in ASCII!!! beacuse when i send a value i receive an other value!!!