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.

TMS320F2800137: Compressor_Motor_1_Run_Issue

Part Number: TMS320F2800137
Other Parts Discussed in Thread: C2000WARE, , SYSCONFIG

Tool/software: Code Composer Studio

 dear yanming,

Build Level 2 & 3:

We have set these parameter as per specification:

#if (USER_MOTOR1 == Voepl_ODU_compressor_motor) //added by Babaji Nemnar 18032023
#define USER_MOTOR1_TYPE MOTOR_TYPE_PM
#define USER_MOTOR1_NUM_POLE_PAIRS (3)
#define USER_MOTOR1_Rr_Ohm (0.0)

#define USER_MOTOR1_Rs_Ohm (0.838)
#define USER_MOTOR1_Ls_d_H (0.0085737)
#define USER_MOTOR1_Ls_q_H (0.01210875)
#define USER_MOTOR1_RATED_FLUX_VpHz (0.377903223) Note: this parameter is not present in the specification,Please guide how to set.

After Run the Code:

Copressor worked for 2 second & stop.Refer attachment expression window with queries.

Please guide. 

Compressor_motor_details.xlsx

  • Is the compressor running standalone without loading? Or in the air-conditioner? Build level 2 and 3 are only for hardware verification that is not used to run a motor with load.

    #define USER_MOTOR1_RATED_FLUX_VpHz (0.377903223) Note: this parameter is not present in the specification,Please guide how to set.

    As replied to you in the other threads you post. You need to set the correct motor parameters, or identify the motor parameters by using the example lab. 

  • Dear Yanming,

    Is the compressor running standalone without loading? : YES

     Build level 2 and 3 are only for hardware verification that is not used to run a motor with load.: in Fan motor connecting laod

    If we apply 230Vac  then fan motor is heating & immediately turn off,What is the problem ??

  • If we apply 230Vac  then fan motor is heating & immediately turn off,What is the problem ??

    Which build level? Did you follow the guide to change the related parameters if using build level 2 or 3? Are the motor parameters correct if using build level 4? Please post the user_mtr1.h and user_mtr2.h files, and provide some pictures for the connection and current waveforms with the detailed operation steps if possible. Thanks!

  • Dear Yanming,

    Which build level? :Build Level 4

    Did you follow the guide to change the related parameters if using build level 2 or 3?:Yes

    Are the motor parameters correct if using build level 4?:Yes ,these parameter as follow

    user_mtr1.h:

    if (USER_MOTOR1 == Voepl_ODU_Fan_motor) 
    #define USER_MOTOR1_TYPE MOTOR_TYPE_PM
    #define USER_MOTOR1_NUM_POLE_PAIRS (4)
    #define USER_MOTOR1_Rr_Ohm (0.0)

    #define USER_MOTOR1_Rs_Ohm (90)
    #define USER_MOTOR1_Ls_d_H (0.1758)
    #define USER_MOTOR1_Ls_q_H (0.1758)
    #define USER_MOTOR1_RATED_FLUX_VpHz (1.33)

    user_mtr2.h

    #if (USER_MOTOR1 == Voepl_ODU_compressor_motor) //added by Babaji Nemnar 18032023
    #define USER_MOTOR1_TYPE MOTOR_TYPE_PM
    #define USER_MOTOR1_NUM_POLE_PAIRS (3)
    #define USER_MOTOR1_Rr_Ohm (0.0)

    #define USER_MOTOR1_Rs_Ohm (0.838)
    #define USER_MOTOR1_Ls_d_H (0.0085737)
    #define USER_MOTOR1_Ls_q_H (0.01210875)
    #define USER_MOTOR1_RATED_FLUX_VpHz (0.377)

    provide some pictures for the connection :see attached image of fan connection

    Please suggest.

  • Dear Yanming,

    Which build level? :Build Level 4

    Did you follow the guide to change the related parameters if using build level 2 or 3?:Yes

    Are the motor parameters correct if using build level 4?:Yes ,these parameter as follow

    user_mtr2.h:

    if (USER_MOTOR2 == Voepl_ODU_Fan_motor) 
    #define USER_MOTOR1_TYPE MOTOR_TYPE_PM
    #define USER_MOTOR1_NUM_POLE_PAIRS (4)
    #define USER_MOTOR1_Rr_Ohm (0.0)

    #define USER_MOTOR1_Rs_Ohm (90)
    #define USER_MOTOR1_Ls_d_H (0.1758)
    #define USER_MOTOR1_Ls_q_H (0.1758)
    #define USER_MOTOR1_RATED_FLUX_VpHz (1.33)

    user_mtr1.h

    #if (USER_MOTOR1 == Voepl_ODU_compressor_motor) //added by Babaji Nemnar 18032023
    #define USER_MOTOR1_TYPE MOTOR_TYPE_PM
    #define USER_MOTOR1_NUM_POLE_PAIRS (3)
    #define USER_MOTOR1_Rr_Ohm (0.0)

    #define USER_MOTOR1_Rs_Ohm (0.838)
    #define USER_MOTOR1_Ls_d_H (0.0085737)
    #define USER_MOTOR1_Ls_q_H (0.01210875)
    #define USER_MOTOR1_RATED_FLUX_VpHz (0.377)

    provide some pictures for the connection :see attached image of fan connection

    Please suggest.

  • You may try to run a generic motor without load first, and use the example lab to identify the motor parameters directly.  And then run the motor with load to see what happens. 

    50~400W motor on Fan side.

    100~1500W motor on Compressor side.

    What input power supply is used to board? DC or AC? What voltage?

    Is the PFC enabled?

    Any bits are set in motorVars[0].faultMtrUse.all or motorVars[1].faultMtrUse.all?

    Running the motor on Fan or Compressor separately to check if there is still a fault?

    Don't connect anything to the J17 and J18.

  • Dear Yanming,

    50~400W motor on Fan side.:45w

    What input power supply is used to board? DC or AC? What voltage?:230VAC/50Hz

    Is the PFC enabled?:YES

    Any bits are set in motorVars[0].faultMtrUse.all or motorVars[1].faultMtrUse.all?:NO

    Running the motor on Fan or Compressor separately to check if there is still a fault?:Yes same fault occure

    Don't connect anything to the J17 and J18.:not connected

  • Dear Yanming,

    Any bits are set in motorVars[0].faultMtrUse.all or motorVars[1].faultMtrUse.all?:for this refer attachmentExpression_window.xlsx

    i m waiting for your valuable reply please hurry up...

  • Hi yanming,

    please solve above query ..i m waiting here...its very urgent to solve this issue please help us.

  • Seems like the over current fault is triggered? What motor is running on the compressor side (motorVars[0])? Any load is adding on the motor?

     Search the following code in sys_main.c file to see what setting is for these two variables.

    // false->enable motor identification, true->disable motor identification
    userParams[MTR_1].flag_bypassMotorId = true;
    userParams[MTR_2].flag_bypassMotorId = true;

    Can you provide any current waveform captured by the oscilloscope with a current probe?

  • Hi Yanmng,

    What motor is running on the compressor side (motorVars[0])? : BLDC motor 200-240VAC,50Hz,4035W,2.99A

    Any load is adding on the motor?:No Load

    / false->enable motor identification, true->disable motor identification
    userParams[MTR_1].flag_bypassMotorId = true;
    userParams[MTR_2].flag_bypassMotorId = true; : these flag already set.

    Below are the observation

    1.Fan motor initially not commuted smootly for 2-3 seconds and after 2-3 min its stops.

    2.compressor motor runs only for 5 seconds & then stops

    Note:1 we have connected fan blade to fan motor as a load 

             2.compressor motor only condesor coil is connected.

    Please suggest.

  • 1.Fan motor initially not commuted smootly for 2-3 seconds and after 2-3 min its stops.
    2.compressor motor runs only for 5 seconds & then stops

    Try another generic motor without adding the load and tune the identification variables as shown in the lab user's guide.

    Note:1 we have connected fan blade to fan motor as a load 

    As mentioned above, you need to tune the identification variables to spin the motor smoothly in the full identification process.

       2.compressor motor only condesor coil is connected.

    The compressor can't be identified on an A/C system. You need a standalone compressor to identify the motor parameters first.

    Can you provide any current waveform captured by the oscilloscope with a current probe?

    Any information about this?

  • Dear Yanming,

    For Motor 2(Fan Motor):

    if we used 17W BLDC Motor without load is running ok but only at the start of motor it take jerks,why this jerk occur??

    fan motor parameter as below:

    #if (USER_MOTOR2 == ODU_Fan_Motor)
    #define USER_MOTOR2_TYPE MOTOR_TYPE_PM
    #define USER_MOTOR2_NUM_POLE_PAIRS (4)
    #define USER_MOTOR2_Rr_Ohm (0.0)

    #define USER_MOTOR2_Rs_Ohm (150.0)//(90.0) //(2.62655902)
    #define USER_MOTOR2_Ls_d_H (0.215)// (0.1758)
    #define USER_MOTOR2_Ls_q_H (0.215)//(0.1758)
    #define USER_MOTOR2_RATED_FLUX_VpHz (0.8868)//(1.3300)

    #define USER_MOTOR2_MAGNETIZING_CURRENT_A (NULL)
    #define USER_MOTOR2_RES_EST_CURRENT_A (1.0f)
    #define USER_MOTOR2_IND_EST_CURRENT_A (-1.0f)// (-0.5f)
    #define USER_MOTOR2_MAX_CURRENT_A (3.82f)
    #define USER_MOTOR2_FLUX_EXC_FREQ_Hz (40.0f)
    #define USER_MOTOR2_NUM_ENC_SLOTS (2500.0)
    #define USER_MOTOR2_INERTIA_Kgm2 (3.100017e-5)

    #define USER_MOTOR2_RATED_VOLTAGE_V (200.0f)
    #define USER_MOTOR2_RATED_SPEED_KRPM (3.0f)

    #define USER_MOTOR2_FREQ_MIN_Hz (5.0f) // Hz
    #define USER_MOTOR2_FREQ_MAX_Hz (400.0f) // Hz

    #define USER_MOTOR2_FREQ_LOW_Hz (10.0f)// (5.0f) // Hz
    #define USER_MOTOR2_FREQ_HIGH_Hz (200.0f) // Hz
    #define USER_MOTOR2_VOLT_MIN_V (5.0f) // Volt
    #define USER_MOTOR2_VOLT_MAX_V (200.0f) // Volt

    #define USER_MOTOR2_ALIGN_CURRENT_A (1.0f) //
    #define USER_MOTOR2_STARTUP_CURRENT_A (1.0f) //
    #define USER_MOTOR2_OVER_CURRENT_A (3.6f) //(3.6f) //
    #define USER_MOTOR2_LOCK_CURRENT_A (1.0f) // 1.0A

    #define USER_MOTOR2_DELAY_FLYST_s (uint16_t)(0.5f * USER_M2_ISR_FREQ_Hz) // 0.5s
    #define USER_MOTOR2_SPEED_FLYST_Hz (3.0f)
    #define USER_MOTOR2_SPEED_START_Hz (20.0f) //
    #define USER_MOTOR2_SPEED_FORCE_Hz (30.0)

    #define USER_MOTOR2_ACCEL_START_Hzps (5.0f) //
    #define USER_MOTOR2_ACCEL_MAX_Hzps (10.0f) //

    // Only for eSMO
    #define USER_MOTOR2_KSLIDE_MAX (0.25f) // 2.0f
    #define USER_MOTOR2_KSLIDE_MIN (0.10f)

    #define USER_MOTOR2_PLL_KP_MAX (10.0f)
    #define USER_MOTOR2_PLL_KP_MIN (2.0f)
    #define USER_MOTOR2_PLL_KP_SF (5.0f)

    #define USER_MOTOR2_BEMF_THRESHOLD (0.5f)
    #define USER_MOTOR2_BEMF_KSLF_FC_Hz (300.0f)
    #define USER_MOTOR2_THETA_OFFSET_SF (1.0f) // 2.5f
    #define USER_MOTOR2_SPEED_LPF_FC_Hz (200.0f) // 100.0f

    For motor1(compressor motor):

    #if (USER_MOTOR1 == ODU_compressor_motor)
    #define USER_MOTOR1_TYPE MOTOR_TYPE_PM
    #define USER_MOTOR1_NUM_POLE_PAIRS (3)//(4)
    #define USER_MOTOR1_Rr_Ohm (0.0)

    #define USER_MOTOR1_Rs_Ohm (0.838)//(2.12655902)
    #define USER_MOTOR1_Ls_d_H (0.0085737)//(0.00860825367)
    #define USER_MOTOR1_Ls_q_H (0.01210875)//(0.00860825367)
    #define USER_MOTOR1_RATED_FLUX_VpHz (1.377903223)

    #define USER_MOTOR1_MAGNETIZING_CURRENT_A (NULL)
    #define USER_MOTOR1_RES_EST_CURRENT_A (1.0f) // A - 10~30% of rated current of the motor
    #define USER_MOTOR1_IND_EST_CURRENT_A (-1.0f) // (-0.5f) // A - 10~30% of rated current of the motor, just enough to enable rotation
    #define USER_MOTOR1_MAX_CURRENT_A (5.0f) // A - 30~150% of rated current of the motor
    #define USER_MOTOR1_FLUX_EXC_FREQ_Hz (20.0f)//(40.0f) // Hz - 10~30% of rated frequency of the motor
    #define USER_MOTOR1_NUM_ENC_SLOTS (2500.0)
    #define USER_MOTOR1_INERTIA_Kgm2 (2.6300e-4)

    #define USER_MOTOR1_RATED_VOLTAGE_V (200.0f)
    #define USER_MOTOR1_RATED_SPEED_KRPM (3.0f)

    #define USER_MOTOR1_FREQ_MIN_Hz (5.0f)
    #define USER_MOTOR1_FREQ_MAX_Hz (400.0f)

    #define USER_MOTOR1_FREQ_LOW_Hz (5.0f)
    #define USER_MOTOR1_FREQ_HIGH_Hz (200.0f)
    #define USER_MOTOR1_VOLT_MIN_V (10.0f)
    #define USER_MOTOR1_VOLT_MAX_V (200.0f)

    #define USER_MOTOR1_ALIGN_CURRENT_A (1.0f)
    #define USER_MOTOR1_STARTUP_CURRENT_A (1.0f)
    #define USER_MOTOR1_OVER_CURRENT_A (3.0)//(4.5f)
    #define USER_MOTOR1_LOCK_CURRENT_A (1.0f)

    #define USER_MOTOR1_SPEED_FLYST_Hz (3.0f)
    #define USER_MOTOR1_SPEED_START_Hz (20.0f)
    #define USER_MOTOR1_SPEED_FORCE_Hz (30.0f)

    #define USER_MOTOR1_ACCEL_START_Hzps (5.0f)
    #define USER_MOTOR1_ACCEL_MAX_Hzps (10.0f)

    // Only for eSMO
    #define USER_MOTOR1_KSLIDE_MAX (1.50f)
    #define USER_MOTOR1_KSLIDE_MIN (0.75f)

    #define USER_MOTOR1_PLL_KP_MAX (10.0f)
    #define USER_MOTOR1_PLL_KP_MIN (2.0f)
    #define USER_MOTOR1_PLL_KP_SF (5.0f)

    #define USER_MOTOR1_BEMF_THRESHOLD (0.5f)
    #define USER_MOTOR1_BEMF_KSLF_FC_Hz (300.0f)
    #define USER_MOTOR1_THETA_OFFSET_SF (1.0f)
    #define USER_MOTOR1_SPEED_LPF_FC_Hz (200.0f)

    // vibration compensation parameters
    #define USER_MOTOR1_VIBCOMPA_ALPHA (0.90f)
    #define USER_MOTOR1_VIBCOMPA_GAIN (1.0f)
    #define USER_MOTOR1_VIBCOMPA_INDEX_DELTA (5)

    Please suggest as early as possible.

  • if we used 17W BLDC Motor without load is running ok but only at the start of motor it take jerks,why this jerk occur??

    What do you mean "jerks"? Any current waveforms captured to show this? 

    You can try to tune the startup current as blow that could be a low value for your motor.

    #define USER_MOTOR2_ALIGN_CURRENT_A (1.0f) //
    #define USER_MOTOR2_STARTUP_CURRENT_A (1.0f) //

  • Dear Yanming,

    Any current waveforms captured to show this? :refer attached picture.

    You can try to tune the startup current as blow that could be a low value for your motor,

    #define USER_MOTOR2_ALIGN_CURRENT_A (1.0f) //
    #define USER_MOTOR2_STARTUP_CURRENT_A (1.0f) // This both parameter set(0.5f) low value but still motor not run smootly at initially.

     One more question is How to decrease Fan motor RPM in code please explain.

  • Any current waveforms captured to show this? :refer attached picture.

    What's the amplitude and frequency of the motor phase current? What's the target frequency and feedback frequency of the motor you monitored in the CCS debug window?

    Did you identify the motor parameters successfully on this board? Try to tune the identification variables below according to the motor....

     One more question is How to decrease Fan motor RPM in code please explain.

    What do you mean this? You can set the target speed by changing the value of the motorVars[0].speedRef_Hz or motorVars[1].speedRef_Hz as shown in the lab user's guide.

    Please take a look at the lab user's guide that has a detailed operation instruction about how to run this lab.

  • Comparison 17W & 45W Motor.xlsxDear Yanming,

    with 17W motor Set speed & feedback speed we are getting ok with RPM changed accourdingly But with 45W Motor feedback speed not same & RPM not vary accourdingly,attached comparison of setting of measurement of with 17W & 45W motor with same set parameter.

  • For all information:Motor 2 i.e Fan motor

    What's the amplitude and frequency of the motor phase current? :Pk-Pk Current :8.0A & frequency=18KHz ,also refer attachement

    What's the target frequency and feedback frequency of the motor you monitored in the CCS debug window?:Set freq=30Hz & Feedback freq=64Hz ,Also refer attachment.

    Did you identify the motor parameters successfully on this board? :Not Understood

    What do you mean this? You can set the target speed by changing the value of the motorVars[0].speedRef_Hz or motorVars[1].speedRef_Hz as shown in the lab user's guide.:where trying to changed the freq but it is not getting changed,refer attachment.

    Note: fig.3 & fig.4 for information.Phase_Current_&_Freq_wf.xlsx

  • What's the target frequency and feedback frequency of the motor you monitored in the CCS debug window?:Set freq=30Hz & Feedback freq=64Hz ,Also refer attachment.

    Seems like the motor parameters are not correct for FAST estimator. 

    Did you identify the motor parameters successfully on this board? :Not Understood

    Please take a look at the "3.3.4.1 Start CCS and Open Project" in the lab user's guide to identify the motor parameters, and then use the identified motor parameters to run the motor.

  • Dear Yanming,

    Please take a look at the "3.3.4.1 Start CCS and Open Project" in the lab user's guide to identify the motor parameters, and then use the identified motor parameters to run the motor: we will follow all steps as per But still problem not resolve???

    Also see all above attachments.

  • Dear Yanming,

    Fan motor Isuue resolved.

    Thank you so much for your big support & your valuable time.

    now i will check for compressor motor.

  • Glad to hear this. Let's know if have any further questions.

  • Dear yanming,

    we want to interface TIDM-02010E32 Board with Inverter Indoor Unit now??

  • we want to interface TIDM-02010E32 Board with Inverter Indoor Unit now??

    You have to add the communication functions by yourself. There is no example codes for this since we are difficult to know the specific communication protocol for the customer's HVAC system.

  • Dear yanming, 

    You have any communication function sample code for HVAC, If yes please send sample code. 

    In which or where to change code please guide

  • You may refer to the SCI example in C2000Ware as below.

    \ti\c2000\C2000Ware_<version>\driverlib\f280013x\examples\sci

  • Dear Yanming,

    In CCS Project Explore window ,C2000WARE_DLIB_ROOT,how to activate SCI.c & sci.h file ???

    Also please provide Guideline for communication ??

  • The "driverlib.lib" include these two files. You don't need to activate them.

    You just need to refer to the example to configure the SCI for communication, and add the communication protocol you used in the project.

  • Dear Yanming,

    Can I implement communication protocol in communication.c file ??

    Also Can i refer below:

    e2e.ti.com/.../4584956

  • Yes, you can add your code in this file, and refer to the example in C2000Ware or the link you mentioned above to configure the SCI in hal.c.

  • Dear Yanming,

    You Have any Protocol Document of Indoor & Outdoor Aircon Uart Communication, if yes Please send

  • Sorry. The protocol should be related to the specific Air-condition system. We don't have the Protocol Document can share with you.

  • Dear Yanming,

    we have implementing Communication protocol in that following error occur.

    Please check code & revert.

    //#############################################################################
    // $Copyright:
    // Copyright (C) 2017-2023 Texas Instruments Incorporated - http://www.ti.com/
    // Redistribution and use in source and binary forms, with or without
    // modification, are permitted provided that the following conditions
    // are met:
    //
    //   Redistributions of source code must retain the above copyright
    //   notice, this list of conditions and the following disclaimer.
    //
    //   Redistributions in binary form must reproduce the above copyright
    //   notice, this list of conditions and the following disclaimer in the
    //   documentation and/or other materials provided with the
    //   distribution.
    //
    //   Neither the name of Texas Instruments Incorporated nor the names of
    //   its contributors may be used to endorse or promote products derived
    //   from this software without specific prior written permission.
    //
    // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    // $
    //#############################################################################
    
    
    //! \file   /solutions/tidm_02010_dmpfc/common/source/sys_main.c
    //! \brief  This project is used to control two motor and pfc with one MCU
    //!         Support for dualmtrpfc board with F28002x/F28003x/F280013x
    //!
    
    //
    // include the related header files
    //
    #if defined(SYSCONFIG_EN)
    #include "user.h"
    #include "board.h"
    #endif  // SYSCONFIG_EN
    
    #include "sys_settings.h"
    #include "sys_main.h"
    #include "systems.h"
    #include "driverlib.h"
    #include "device.h"
    
    
    //
    //volatile SYSTEM_Vars_t systemVars = SYSTEM_VARS_INIT;
    volatile SYSTEM_Vars_t systemVars;
    #pragma DATA_SECTION(systemVars,"user_data");
    
    
    #if defined(EPWMDAC_MODE)
    HAL_PWMDACData_t pwmDACData;
    #pragma DATA_SECTION(pwmDACData,"user_data");
    #endif  // EPWMDAC_MODE
    
    #if defined(DAC128S_ENABLE)
    #if defined(DAC80504_SEL)
    DAC80504_Handle  dac128sHandle;       //!< the DAC80504 interface handle
    DAC80504_Obj     dac128s;             //!< the DAC80504 interface object
    #else   // DAC128S805
    DAC128S_Handle   dac128sHandle;        //!< the DAC128S interface handle
    DAC128S_Obj      dac128s;              //!< the DAC128S interface object
    #endif  // DAC128S805
    
    #pragma DATA_SECTION(dac128sHandle,"sys_data");
    #pragma DATA_SECTION(dac128s,"sys_data");
    
    //#define DACTEST_EN
    
    #if defined(DACTEST_EN)
    float32_t dacTestValue[4];
    #pragma DATA_SECTION(dacTestValue,"sys_data");
    #endif  // DACTEST
    #endif  // DAC128S_ENABLE
    
    
    uint16_t sDataC[12];
    uint16_t rDataC[12];
    uint16_t rDataPointC;
    
    __interrupt void scicTXFIFOISR(void);
    __interrupt void scicRXFIFOISR(void);
    
    // **************************************************************************
    // the functions
    
    void main(void)
    {
    
        // Clear memory for system and controller
        // The variables must be assigned to these sector if need to be cleared to zero
        HAL_clearDataRAM((void *)loadStart_est_data, (uint16_t)loadSize_est_data);
        HAL_clearDataRAM((void *)loadStart_user_data, (uint16_t)loadSize_user_data);
        HAL_clearDataRAM((void *)loadStart_sys_data, (uint16_t)loadSize_sys_data);
        HAL_clearDataRAM((void *)loadStart_foc_data, (uint16_t)loadSize_foc_data);
        HAL_clearDataRAM((void *)loadStart_pfc_data, (uint16_t)loadSize_pfc_data);
        HAL_clearDataRAM((void *)loadStart_motor_data, (uint16_t)loadSize_motor_data);
        HAL_clearDataRAM((void *)loadStart_dmaBuf_data, (uint16_t)loadSize_dmaBuf_data);
        HAL_clearDataRAM((void *)loadStart_vibc_data, (uint16_t)loadSize_vibc_data);
        HAL_clearDataRAM((void *)loadStart_sfra_data, (uint16_t)loadSize_sfra_data);
        HAL_clearDataRAM((void *)loadStart_datalog_data, (uint16_t)loadSize_datalog_data);
        HAL_clearDataRAM((void *)loadStart_dbgc_data, (uint16_t)loadSize_dbgc_data);
    
    #if defined(DMCPFC_REV3P2)
        systemVars.boardKit = BOARD_DMCPFC_REV3P2;      // DMCPFC_REV3P1 for F28002x/3x/13x-64pin
    #elif defined(DMCPFC_REV3P1)
        systemVars.boardKit = BOARD_DMCPFC_REV3P1;      // DMCPFC_REV3P1 for F28002x-64pin
    #elif defined(HVMTRPFC_REV1P1)
        systemVars.boardKit = BOARD_HVMTRPFC_REV1P1;    // HVMTRPFC_REV1P1 for F28002x
    #elif defined(BSXL8323RH_REVB)
        systemVars.boardKit = BOARD_BSXL8323RH_REVB;    // BSXL8323RH_REVA for F28002x
    #else
    #error Not select a right board for this project
    #endif
    
    #if defined(MOTOR1_FAST) && defined(MOTOR1_ESMO)
        systemVars.estType_M1 = EST_TYPE_FAST_ESMO;    // the estimator is FAST and ESMO
    #elif defined(MOTOR1_FAST)
        systemVars.estType_M1 = EST_TYPE_FAST;         // the estimator is only FAST
    #elif defined(MOTOR1_ESMO)
        systemVars.estType_M1 = EST_TYPE_ESMO;         // the estimator is only ESMO
    #else   // !MOTOR1_FAST & !MOTOR1_ESMO
    #error Not select a right estimator for motor 1 in this project
    #endif  // !MOTOR1_FAST & !MOTOR1_ESMO
    
    #if defined(MOTOR2_FAST) && defined(MOTOR2_ESMO)
        systemVars.estType_M2 = EST_TYPE_FAST_ESMO;     // the estimator is FAST and ESMO
    #elif defined(MOTOR2_FAST)
        systemVars.estType_M2 = EST_TYPE_FAST;          // the estimator is only FAST
    #elif defined(MOTOR2_ESMO)
        systemVars.estType_M2 = EST_TYPE_ESMO;          // the estimator is only ESMO
    #elif defined(MOTOR2_DISABLE)
        systemVars.estType_M2 = EST_TYPE_NO_OBSERVER;   // this motor is disable
    #else   //  !MOTOR2_FAST & !MOTOR2_ESMO
    #error Not select a right estimator for motor 2 in this project
    #endif  //  !MOTOR2_FAST & !MOTOR2_ESMO
    
    #if defined(MOTOR1_FAST) && defined(MOTOR1_ESMO) && \
        defined(MOTOR2_FAST) && defined(MOTOR2_ESMO) && defined(_F28002x)
    #error Limit to the RAM size for copy the program to run in RAM. FAST and ESMO
        can not on dual motor at the same. Only support one motor runs FAST and ESMO
        in parallel, and another motor run FAST or ESMO.
    #endif  //  MOTOR1_FAST & MOTOR1_ESMO & MOTOR2_FAST & MOTOR2_ESMO
    
    #if defined(MOTOR1_DCLINKSS)
        systemVars.currentSenseType_M1 = CURSEN_TYPE_SINGLE_SHUNT;
    #else
        systemVars.currentSenseType_M1 = CURSEN_TYPE_THREE_SHUNT;
    #endif  // Current Sense Type of Motor 1
    
        systemVars.currentSenseType_M2 = CURSEN_TYPE_THREE_SHUNT;
    
    
    
    // ** above codes are only for checking the settings, not occupy the memory
    
        // Initialize device clock and peripherals
        Device_init();                  // call the function in device.c
    
        // Disable pin locks and enable internal pullups.
        Device_initGPIO();              // call the function in device.c
    
        // Initializes PIE and clears PIE registers. Disables CPU interrupts.
        Interrupt_initModule();         // call the function in driverlib.lib
    
        // Initializes the PIE vector table with pointers to the shell Interrupt
        // Service Routines (ISR).
        Interrupt_initVectorTable();    // call the function in driverlib.lib
    
    // TODO: Identify
    #if !defined(_SIMPLE_FAST_LIB)
        // false->enable motor identification, true->disable motor identification
        userParams[MTR_1].flag_bypassMotorId = true;
        userParams[MTR_2].flag_bypassMotorId = true;
    #endif  // !(_SIMPLE_FAST_LIB)
    
    #if defined(SYSCONFIG_EN)
        // disable the ePWM module time base clock sync signal
        // to synchronize all of the PWMs
        SysCtl_disablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
    
        Board_init();
    
        // initialize the driver
        halHandle = HAL_init(&hal, sizeof(hal));
    
        // set the driver parameters
        HAL_setParams(halHandle);
    
        // set the control parameters for PFC
        initPFCCtrlParameters();
    
        // set the control parameters for motor 1
        initMotor1CtrlParameters();
    
        // set the control parameters for motor 2
        initMotor2CtrlParameters();
    
        // set the handle in hal for motors and pfc
        HAL_initMtrHandle(halHandle, halMtrHandle[MTR_1], halMtrHandle[MTR_2]);
        HAL_initPFCHandle(halHandle, halPFCHandle);
    
        // set PWM phase shift between motor and pfc
        HAL_setupPWMsPhaseShift(halHandle);
    
        // enable the ePWM module time base clock sync signal
        SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_TBCLKSYNC);
    #else   // !SYSCONFIG_EN
        // initialize the driver
        halHandle = HAL_init(&hal, sizeof(hal));
    
        // set the driver parameters
        HAL_setParams(halHandle);
    
        // set the control parameters for PFC
        initPFCCtrlParameters();
    
        // set the control parameters for motor 1
        initMotor1CtrlParameters();
    
        // set the control parameters for motor 2
        initMotor2CtrlParameters();
    
        // set the handle in hal for motors and pfc
        HAL_initMtrHandle(halHandle, halMtrHandle[MTR_1], halMtrHandle[MTR_2]);
        HAL_initPFCHandle(halHandle, halPFCHandle);
    
        // set PWM phase shift between motor and pfc
        HAL_setupPWMsPhaseShift(halHandle);
    
        // initialize the interrupt vector table
        HAL_initIntVectorTable(halHandle);
    
        // enable the ADC/PWM interrupts for control
        // enable interrupts to trig DMA
        HAL_enableCtrlInts(halHandle);
    #endif  // !SYSCONFIG_EN
    
        motorVars[MTR_1].speedRef_Hz = 30.0f;
        motorVars[MTR_2].speedRef_Hz = 30.0f;
    
        systemVars.speedComp_Hz = 60.0f;
        systemVars.speedFan_Hz = 50.0f;
    
     /*****************************************************************************************************************
      *
      *
      *
      *****************************************************************************************************************/
        IER = 0x0000;
        IFR = 0x0000;
    
        Interrupt_register(INT_SCIC_RX, scicRXFIFOISR);
        Interrupt_register(INT_SCIC_TX, scicTXFIFOISR);
    
        Interrupt_enable(INT_SCIC_RX);
        Interrupt_enable(INT_SCIC_TX);
    
        Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP9);
    
        EINT;
    
       /* while(1)
        {
            //  SCI_writeCharArray(SCIC_BASE, (uint16_t *)"sci communication interrupt mode\r\n", sizeof("sci communication interrupt mode\r\n"));
            //  DEVICE_DELAY_US(1000000);
        }
    
    
    __interrupt void sciaTXFIFOISR(void)
    {
       uint16_t i;
    
       SCI_writeCharArray(SCIC_BASE, sDataC, 2);
    
            //
            // Increment send data for next cycle
            //
            for(i = 0; i < 2; i++)
            {
                sDataC[i] = (sDataC[i] + 1) & 0x00FF;
            }
    
            SCI_clearInterruptStatus(SCIC_BASE, SCI_INT_TXFF);
    
            //
            // Issue PIE ACK
            //
            Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP9);
    }
    
    __interrupt void sciaRXFIFOISR(void)
    {
       uint16_t i;
    
            SCI_readCharArray(SCIC_BASE, rDataC, 2);
    
            //
            // Check received data
            //
            for(i = 0; i < 2; i++)
            {
                if(rDataC[i] != ((rDataPointC + i) & 0x00FF))
                {
                    //error();
                }
            }
    
            rDataPointC = (rDataPointC + 1) & 0x00FF;
    
            SCI_clearOverflowStatus(SCIC_BASE);
    
            SCI_clearInterruptStatus(SCIC_BASE, SCI_INT_RXFF);
    
            //
            // Issue PIE ack
            //
            Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP9);
    }  */
    
    #if !defined(HVMTRPFC_REV1P1)
    #if defined(EPWMDAC_MODE)
    #error Only HVMTRPFC_REV1P1 supports the EPWMDAC function.
    #endif  // EPWMDAC_MODE
    #else   // HVMTRPFC_REV1P1
    #if defined(EPWMDAC_MODE)
        // set DAC parameters
        pwmDACData.periodMax =
                PWMDAC_getPeriod(halHandle->pwmDACHandle[PWMDAC_NUMBER_1]);
    
    #if defined(PWMDAC_MOTOR) && defined(PWMDAC_PFC)
        pwmDACData.ptrData[0] = &adcDataPFC.IacBus;
        pwmDACData.ptrData[1] = &adcDataPFC.VacBus;
        pwmDACData.ptrData[2] = &angleFOCM1_rad;
        pwmDACData.ptrData[3] = &adcData[MTR_1].I_A.value[0];
    
        pwmDACData.offset[0] = 0.5f;
        pwmDACData.offset[1] = 0.5f;
        pwmDACData.offset[2] = 0.5f;
        pwmDACData.offset[3] = 0.5f;
    
        pwmDACData.gain[0] = 1.0f;
        pwmDACData.gain[1] = 1.0f;
        pwmDACData.gain[2] = 1.0f / MATH_TWO_PI;
        pwmDACData.gain[3] = 1.0f / USER_M1_ADC_FULL_SCALE_CURRENT_A;
    #elif defined(PWMDAC_MOTOR) && !defined(PWMDAC_PFC)
        pwmDACData.ptrData[0] = &angleESTM1_rad;
        pwmDACData.ptrData[1] = &adcData[MTR_1].I_A.value[0];
        pwmDACData.ptrData[2] = &adcData[MTR_1].V_V.value[0];
        pwmDACData.ptrData[3] = &angleFOCM1_rad;
    
        pwmDACData.offset[0] = 0.5f;
        pwmDACData.offset[1] = 0.5f;
        pwmDACData.offset[2] = 0.5f;
        pwmDACData.offset[3] = 0.5f;
    
        pwmDACData.gain[0] = 1.0f / MATH_TWO_PI;
        pwmDACData.gain[1] = 1.0f / USER_M1_ADC_FULL_SCALE_CURRENT_A;
        pwmDACData.gain[2] = 1.0f / USER_M1_ADC_FULL_SCALE_VOLTAGE_V;
        pwmDACData.gain[3] = 1.0f / MATH_TWO_PI;
    #elif defined(PWMDAC_PFC) && !defined(PWMDAC_MOTOR)
        pwmDACData.ptrData[0] = &adcDataPFC.IacBus;
        pwmDACData.ptrData[1] = &adcDataPFC.VacBus;
        pwmDACData.ptrData[2] = &pfcVars.IacRef;
        pwmDACData.ptrData[3] = &pfcVars.IacError;
    
        pwmDACData.offset[0] = 0.0f;
        pwmDACData.offset[1] = 0.0f;
        pwmDACData.offset[2] = 0.0f;
        pwmDACData.offset[3] = 0.0f;
    
        pwmDACData.gain[0] = 1.0f;
        pwmDACData.gain[1] = 1.0f;
        pwmDACData.gain[2] = 1.0f;
        pwmDACData.gain[3] = 1.0f;
    
    #elif !defined(PWMDAC_PFC) && !defined(PWMDAC_MOTOR)
        // No EPWMDAC supporting
    #else
    #error Only PWMDAC_PFC or PWMDAC_MOTOR can be supported at the same time
    #endif  // PWMDAC_PFC or PWMDAC_MOTOR
    #endif  // EPWMDAC_MODE
    #endif  // !HVMTRPFC_REV1P1
    
    #if defined(DATALOGF2_EN)
    //#warning No enough memory if use datalog, so may disable the VIB_COMP
        // Initialize Datalog
        datalogHandle = DATALOGIF_init(&datalog, sizeof(datalog));
        DATALOG_Obj *datalogObj = (DATALOG_Obj *)datalogHandle;
    
        HAL_setupDMAforDLOG(halHandle, 0, &datalogBuff1[0], &datalogBuff1[1]);
        HAL_setupDMAforDLOG(halHandle, 1, &datalogBuff2[0], &datalogBuff2[1]);
    
        // set datalog parameters
        datalogObj->iptr[0] = &angleFOCM1_rad;
        datalogObj->iptr[1] = &adcData[MTR_1].I_A.value[0];
    
    #endif // DATALOGF2_EN
    
    
    #if defined(DAC128S_ENABLE)
    #if defined(DAC80504_SEL)
        // initialize the DAC80504
        dac128sHandle = DAC80504_init(&dac128s);
    
    #if !defined(SYSCONFIG_EN)
        // setup SPI for DAC80504
        DAC80504_setupSPI(dac128sHandle);
    #else  // SYSCONFIG_EN
        SPI_setTxFifoTransmitDelay(DAC_SPI_BASE, 0x04);
        SPI_clearInterruptStatus(DAC_SPI_BASE, SPI_INT_TXFF);
    #endif  // SYSCONFIG_EN
    
        DAC80504_writeCommand(dac128sHandle);
    
    #else   // DAC128S805
        // initialize the DAC128S05
        dac128sHandle = DAC128S_init(&dac128s);
    
    #if !defined(SYSCONFIG_EN)
        // setup SPI for DAC128S05
        DAC128S_setupSPI(dac128sHandle);
    #else  // SYSCONFIG_EN
        SPI_setTxFifoTransmitDelay(DAC_SPI_BASE, 0x04);
        SPI_clearInterruptStatus(DAC_SPI_BASE, SPI_INT_TXFF);
    #endif  // SYSCONFIG_EN
    
        DAC128S_writeCommand(dac128sHandle);
    
    #endif  // DAC128S805
    
    
    
        // The following settings are for output the values of different variables
        // in each build level for debug. The User can select one of these groups in
        // different build level as commented note
    
    // DAC_LEVEL1_DACTEST
    // DAC_LEVEL4_DCLINK, DAC_LEVEL4_ALL,  DAC_LEVEL4_MOTORS
    // DAC_LEVEL4_VIBCOMP, DAC_LEVEL_TEST, DAC_LEVEL4_PFC
    // DAC_LEVEL2_MOTOR1_IS, DAC_LEVEL2_MOTOR1_VS, DAC_LEVEL3_MOTOR1_EST
    // DAC_LEVEL2_MOTOR2_IS, DAC_LEVEL2_MOTOR2_VS, DAC_LEVEL3_MOTOR2_EST
    // DAC_LEVEL4_MOTOR1_EST, DAC_LEVEL4_SMOM1, DAC_LEVEL4_FASTM1, DAC_LEVEL4_DSMOM1
    // DAC_LEVEL4_MOTOR2_EST, DAC_LEVEL4_SMOM2, DAC_LEVEL4_FASTM2, DAC_LEVEL4_DSMOM2
    
    #define DAC_LEVEL4_ALL        // define the DAC level
    
    #if defined(DAC_LEVEL4_DCLINK)
        // Using in build Level_4 to debug single shunt
        dac128s.ptrData[0] = &angleFOCM1_rad;           // CH_A
        dac128s.ptrData[1] = &adcData[0].I_A.value[0];  // CH_B
        dac128s.ptrData[2] = &adcData[0].I_A.value[1];  // CH_C
        dac128s.ptrData[3] = &adcData[0].I_A.value[2];        // CH_D
    
        dac128s.gain[0] = 4096.0f / MATH_TWO_PI;
        dac128s.gain[1] = 4096.0f * 2.0f / USER_M1_ADC_FULL_SCALE_CURRENT_A;
        dac128s.gain[2] = 4096.0f * 2.0f / USER_M1_ADC_FULL_SCALE_CURRENT_A;
        dac128s.gain[3] = 4096.0f * 2.0f / USER_M1_ADC_FULL_SCALE_CURRENT_A;
    
        dac128s.offset[0] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[1] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[2] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[3] = (uint16_t)(0.0f * 4096.0f);
    #elif defined(DAC_LEVEL4_PFC)
        // Using in build Level_4 to monitor the rotor angles of motor 1 and 2,
        // and the sensing AC current and voltage for PFC
        dac128s.ptrData[0] = &adcDataPFC.IacBus;    // CH_A
        dac128s.ptrData[1] = &adcDataPFC.VacBus;    // CH_B
        dac128s.ptrData[2] = &adcDataPFC.VdcBus;    // CH_C
        dac128s.ptrData[3] = &adcDataPFC.IacBus;    // CH_D
    
        dac128s.gain[0] = 4096.0f;
        dac128s.gain[1] = 4096.0f;
        dac128s.gain[2] = 4096.0f;
        dac128s.gain[3] = 4096.0f;
    
        dac128s.offset[0] = (uint16_t)(0.0f * 4096.0f);
        dac128s.offset[1] = (uint16_t)(0.0f * 4096.0f);
        dac128s.offset[2] = (uint16_t)(0.0f * 4096.0f);
        dac128s.offset[3] = (uint16_t)(0.0f * 4096.0f);
    #elif defined(DAC_LEVEL4_ALL)
        // Using in build Level_4 to monitor the rotor angles of motor 1 and 2,
        // and the sensing AC current and voltage for PFC
        dac128s.ptrData[0] = &adcDataPFC.IacBus;    // CH_A
        dac128s.ptrData[1] = &adcDataPFC.VacBus;    // CH_B
        dac128s.ptrData[2] = &angleFOCM1_rad;       // CH_C
        dac128s.ptrData[3] = &angleFOCM2_rad;       // CH_D
    
        dac128s.gain[0] = 4096.0f;
        dac128s.gain[1] = 4096.0f;
        dac128s.gain[2] = 4096.0f / MATH_TWO_PI;
        dac128s.gain[3] = 4096.0f / MATH_TWO_PI;
    
        dac128s.offset[0] = (uint16_t)(0.0f * 4096.0f);
        dac128s.offset[1] = (uint16_t)(0.0f * 4096.0f);
        dac128s.offset[2] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[3] = (uint16_t)(0.5f * 4096.0f);
    #elif defined(DAC_LEVEL2_MOTOR1_IS)
        // Using in build Level 2: Verify motor_1 current sensing signals
        dac128s.ptrData[0] = &angleFOCM1_rad;                 // CH_D
        dac128s.ptrData[1] = &adcData[0].I_A.value[0];        // CH_A
        dac128s.ptrData[2] = &adcData[0].I_A.value[1];        // CH_B
        dac128s.ptrData[3] = &adcData[0].I_A.value[2];        // CH_C
    
        dac128s.gain[0] = 4096.0f / MATH_TWO_PI;
        dac128s.gain[1] = 4096.0f * 1.0f / USER_M1_ADC_FULL_SCALE_CURRENT_A;
        dac128s.gain[2] = 4096.0f * 1.0f / USER_M1_ADC_FULL_SCALE_CURRENT_A;
        dac128s.gain[3] = 4096.0f * 1.0f / USER_M1_ADC_FULL_SCALE_CURRENT_A;
    
        dac128s.offset[0] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[1] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[2] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[3] = (uint16_t)(0.5f * 4096.0f);
    #elif defined(DAC_LEVEL2_MOTOR1_VS)
        // Using in build level 2: Verify motor_1 voltage sensing signals
        dac128s.ptrData[0] = &angleFOCM1_rad;                 // CH_A
        dac128s.ptrData[1] = &adcData[0].V_V.value[0];        // CH_B
        dac128s.ptrData[2] = &adcData[0].V_V.value[1];        // CH_C
        dac128s.ptrData[3] = &adcData[0].V_V.value[2];        // CH_D
    
        dac128s.gain[0] = 4096.0f / MATH_TWO_PI;
        dac128s.gain[1] = 4096.0f * 1.0f / USER_M1_ADC_FULL_SCALE_VOLTAGE_V;
        dac128s.gain[2] = 4096.0f * 1.0f / USER_M1_ADC_FULL_SCALE_VOLTAGE_V;
        dac128s.gain[3] = 4096.0f * 1.0f / USER_M1_ADC_FULL_SCALE_VOLTAGE_V;
    
        dac128s.offset[0] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[1] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[2] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[3] = (uint16_t)(0.5f * 4096.0f);
    #elif defined(DAC_LEVEL3_MOTOR1_EST)
        // Using in build Level 2 and 3: Verify motor_1 estimation angle
        dac128s.ptrData[0] = &angleGenM1_rad;                 // CH_A
        dac128s.ptrData[1] = &angleESTM1_rad;                 // CH_B
        dac128s.ptrData[2] = &adcData[0].I_A.value[0];        // CH_C
        dac128s.ptrData[3] = &adcData[0].V_V.value[0];        // CH_D
    
        dac128s.gain[0] = 4096.0f / MATH_TWO_PI;
        dac128s.gain[1] = 4096.0f / MATH_TWO_PI;
        dac128s.gain[2] = 4096.0f * 1.0f / USER_M1_ADC_FULL_SCALE_CURRENT_A;
        dac128s.gain[3] = 4096.0f * 1.0f / USER_M1_ADC_FULL_SCALE_VOLTAGE_V;
    
        dac128s.offset[0] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[1] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[2] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[3] = (uint16_t)(0.5f * 4096.0f);
    #elif defined(DAC_LEVEL2_MOTOR2_IS)
        // Using in build level 2: Verify motor_2 current sensing signals
        dac128s.ptrData[0] = &adcData[1].I_A.value[0];        // CH_A
        dac128s.ptrData[1] = &adcData[1].I_A.value[1];        // CH_B
        dac128s.ptrData[2] = &adcData[1].I_A.value[2];        // CH_C
        dac128s.ptrData[3] = &angleFOCM2_rad;                 // CH_D
    
        dac128s.gain[0] = 4096.0f * 1.0f / USER_M2_ADC_FULL_SCALE_CURRENT_A;
        dac128s.gain[1] = 4096.0f * 1.0f / USER_M2_ADC_FULL_SCALE_CURRENT_A;
        dac128s.gain[2] = 4096.0f * 1.0f / USER_M2_ADC_FULL_SCALE_CURRENT_A;
        dac128s.gain[3] = 4096.0f / MATH_TWO_PI;
    
        dac128s.offset[0] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[1] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[2] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[3] = (uint16_t)(0.5f * 4096.0f);
    #elif defined(DAC_LEVEL2_MOTOR2_VS)
        // Using in build level 2: Verify motor_2 voltage sensing signals
        dac128s.ptrData[0] = &angleFOCM2_rad;                 // CH_D
        dac128s.ptrData[1] = &adcData[1].V_V.value[0];        // CH_A
        dac128s.ptrData[2] = &adcData[1].V_V.value[1];        // CH_B
        dac128s.ptrData[3] = &adcData[1].V_V.value[2];        // CH_C
    
        dac128s.gain[0] = 4096.0f / MATH_TWO_PI;
        dac128s.gain[1] = 4096.0f * 1.0f / USER_M2_ADC_FULL_SCALE_VOLTAGE_V;
        dac128s.gain[2] = 4096.0f * 1.0f / USER_M2_ADC_FULL_SCALE_VOLTAGE_V;
        dac128s.gain[3] = 4096.0f * 1.0f / USER_M2_ADC_FULL_SCALE_VOLTAGE_V;
    
        dac128s.offset[0] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[1] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[2] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[3] = (uint16_t)(0.5f * 4096.0f);
    #elif defined(DAC_LEVEL3_MOTOR2_EST)
        // Using in build level 2 and 3: Verify motor_2 estimation angle
        dac128s.ptrData[0] = &angleGenM2_rad;                 // CH_A
        dac128s.ptrData[1] = &angleESTM2_rad;                 // CH_B
        dac128s.ptrData[2] = &adcData[1].I_A.value[0];        // CH_C
        dac128s.ptrData[3] = &adcData[1].V_V.value[0];        // CH_D
    
        dac128s.gain[0] = 4096.0f / MATH_TWO_PI;
        dac128s.gain[1] = 4096.0f / MATH_TWO_PI;
        dac128s.gain[2] = 4096.0f * 1.0f / USER_M2_ADC_FULL_SCALE_CURRENT_A;
        dac128s.gain[3] = 4096.0f * 1.0f / USER_M2_ADC_FULL_SCALE_VOLTAGE_V;
    
        dac128s.offset[0] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[1] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[2] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[3] = (uint16_t)(0.5f * 4096.0f);
    #elif defined(DAC_LEVEL4_MOTOR2_EST)
        // Using in build level 2 and 3: Verify motor_2 estimation angle
        dac128s.ptrData[0] = &angleESTM2_rad;                 // CH_A
        dac128s.ptrData[1] = &adcData[1].I_A.value[0];        // CH_B
        dac128s.ptrData[2] = &adcData[1].V_V.value[0];        // CH_C
        dac128s.ptrData[3] = &adcData[1].I_A.value[1];        // CH_D
    
        dac128s.gain[0] = 4096.0f / MATH_TWO_PI;
        dac128s.gain[1] = 4096.0f * 1.0f / USER_M2_ADC_FULL_SCALE_CURRENT_A;
        dac128s.gain[2] = 4096.0f * 1.0f / USER_M2_ADC_FULL_SCALE_VOLTAGE_V;
        dac128s.gain[3] = 4096.0f * 1.0f / USER_M2_ADC_FULL_SCALE_CURRENT_A;
    
        dac128s.offset[0] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[1] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[2] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[3] = (uint16_t)(0.5f * 4096.0f);
    #elif defined(DAC_LEVEL4_MOTORS)
        // Using in build level 3 and 4: Verify motor_1 & motor_2 closed-loop
        dac128s.ptrData[0] = &angleFOCM1_rad;                 // CH_A
        dac128s.ptrData[1] = &angleFOCM2_rad;                 // CH_B
        dac128s.ptrData[2] = &adcData[0].I_A.value[0];        // CH_C
        dac128s.ptrData[3] = &adcData[1].I_A.value[0];        // CH_D
    
        dac128s.gain[0] = 4096.0f / MATH_TWO_PI;
        dac128s.gain[1] = 4096.0f / MATH_TWO_PI;
        dac128s.gain[2] = 4096.0f * 1.0f / USER_M1_ADC_FULL_SCALE_CURRENT_A;
        dac128s.gain[3] = 4096.0f * 1.0f / USER_M2_ADC_FULL_SCALE_CURRENT_A;
    
        dac128s.offset[0] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[1] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[2] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[3] = (uint16_t)(0.5f * 4096.0f);
    #elif defined(DAC_LEVEL4_SMOM1)
        // Using in build level 2 and 3: Verify motor_2 estimation angle
        dac128s.ptrData[0] = &adcData[0].I_A.value[0];        // CH_A
        dac128s.ptrData[1] = &adcData[0].I_A.value[0];        // CH_B
        dac128s.ptrData[2] = &anglePLLM1_rad;                 // CH_C
    //    dac128s.ptrData[3] = &angleESTM1_rad;               // CH_D
        dac128s.ptrData[3] = &angleFOCM1_rad;                 // CH_D
    
        dac128s.gain[0] = 4096.0f * 1.0f / USER_M1_ADC_FULL_SCALE_CURRENT_A;
        dac128s.gain[1] = 4096.0f * 1.0f / USER_M1_ADC_FULL_SCALE_CURRENT_A;
        dac128s.gain[2] = 4096.0f / MATH_TWO_PI;
        dac128s.gain[3] = 4096.0f / MATH_TWO_PI;
    
        dac128s.offset[0] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[1] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[2] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[3] = (uint16_t)(0.5f * 4096.0f);
    #elif defined(DAC_LEVEL4_FASTM2)
        // Using in build level 2 and 3: Verify motor_2 estimation angle
        dac128s.ptrData[0] = &angleFOCM2_rad;                 // CH_A
        dac128s.ptrData[1] = &angleESTM2_rad;                 // CH_B
        dac128s.ptrData[2] = &adcData[1].I_A.value[0];        // CH_C
        dac128s.ptrData[3] = &adcData[1].I_A.value[1];        // CH_D
    
        dac128s.gain[0] = 4096.0f / MATH_TWO_PI;
        dac128s.gain[1] = 4096.0f / MATH_TWO_PI;
        dac128s.gain[2] = 4096.0f * 1.0f / USER_M2_ADC_FULL_SCALE_CURRENT_A;
        dac128s.gain[3] = 4096.0f * 1.0f / USER_M2_ADC_FULL_SCALE_CURRENT_A;
    
        dac128s.offset[0] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[1] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[2] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[3] = (uint16_t)(0.5f * 4096.0f);
    #elif defined(DAC_LEVEL4_SMOM2)
        // Using in build level 2 and 3: Verify motor_2 estimation angle
        dac128s.ptrData[0] = &angleFOCM2_rad;                 // CH_C
        dac128s.ptrData[1] = &anglePLLM2_rad;                 // CH_A
        dac128s.ptrData[2] = &adcData[1].I_A.value[0];        // CH_C
        dac128s.ptrData[3] = &adcData[1].I_A.value[1];        // CH_D
    
        dac128s.gain[0] = 4096.0f / MATH_TWO_PI;
        dac128s.gain[1] = 4096.0f / MATH_TWO_PI;
        dac128s.gain[2] = 4096.0f * 1.0f / USER_M2_ADC_FULL_SCALE_CURRENT_A;
        dac128s.gain[3] = 4096.0f * 1.0f / USER_M2_ADC_FULL_SCALE_CURRENT_A;
    
        dac128s.offset[0] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[1] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[2] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[3] = (uint16_t)(0.5f * 4096.0f);
    #elif defined(DAC_LEVEL4_DSMOM2)
        // Using in build level 2 and 3: Verify motor_2 estimation angle
        dac128s.ptrData[0] = &angleFOCM2_rad;                 // CH_C
        dac128s.ptrData[1] = &anglePLLM2_rad;                 // CH_A
        dac128s.ptrData[2] = &angleESTM2_rad;                 // CH_B
        dac128s.ptrData[3] = &adcData[1].I_A.value[0];        // CH_D
    
        dac128s.gain[0] = 4096.0f / MATH_TWO_PI;
        dac128s.gain[1] = 4096.0f / MATH_TWO_PI;
        dac128s.gain[2] = 4096.0f / MATH_TWO_PI;
        dac128s.gain[3] = 4096.0f * 1.0f / USER_M2_ADC_FULL_SCALE_CURRENT_A;
    
        dac128s.offset[0] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[1] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[2] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[3] = (uint16_t)(0.5f * 4096.0f);
    #elif defined(DAC_LEVEL4_VIBCOMP)
        // Using in build level 4: for vibration compensation debug
        dac128s.ptrData[0] = &vibComp.angleMechPoles_rad;                // CH_A
        dac128s.ptrData[1] = &angleFOCM1_rad;                       // CH_B
        dac128s.ptrData[2] = &vibComp.Iq_comp_A;                    // CH_C
        dac128s.ptrData[3] = &Idq_in_A[0].value[1];                 // CH_D
    
        dac128s.gain[0] = 4096.0f / MATH_TWO_PI / USER_MOTOR1_NUM_POLE_PAIRS;
        dac128s.gain[1] = 4096.0f / MATH_TWO_PI;
        dac128s.gain[2] = 4096.0f * 0.5f / USER_M1_ADC_FULL_SCALE_CURRENT_A;
        dac128s.gain[3] = 4096.0f * 0.5f / USER_M2_ADC_FULL_SCALE_CURRENT_A;
    
        dac128s.offset[0] = (uint16_t)(0.0f * 4096.0f);
        dac128s.offset[1] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[2] = (uint16_t)(0.5f * 4096.0f);
        dac128s.offset[3] = (uint16_t)(0.5f * 4096.0f);
    #elif defined(DAC_LEVEL_TEST) && defined(DACTEST_EN)
        // Using in build level 4: for vibration compensation debug
        dac128s.ptrData[0] = &dacTestValue[0];         // CH_A
        dac128s.ptrData[1] = &dacTestValue[1];         // CH_B
        dac128s.ptrData[2] = &dacTestValue[2];         // CH_C
        dac128s.ptrData[3] = &dacTestValue[3];         // CH_D
    
        dac128s.gain[0] = 4096.0f;
        dac128s.gain[1] = 4096.0f;
        dac128s.gain[2] = 4096.0f;
        dac128s.gain[3] = 4096.0f;
    
        dac128s.offset[0] = (uint16_t)(0.0f * 4096.0f);
        dac128s.offset[1] = (uint16_t)(0.0f * 4096.0f);
        dac128s.offset[2] = (uint16_t)(0.0f * 4096.0f);
        dac128s.offset[3] = (uint16_t)(0.0f * 4096.0f);
    #else
    #error Not assign the variables to the DAC object
    #endif  //DAC_LEVEL
    #endif  // DAC128S_ENABLE
    
    #if defined(SFRA_ENABLE) &&  (SFRA_TEST_TYPE == SFRA_TEST_PFC)
        // Plot GH & H plots using SFRA_GUI
        configureSFRA(SFRA_GUI_PLOT_GH_H, PFC_SAMPLING_FREQ_HZ);
    
        sfraTestLoop = SFRA_TEST_PFC_CURRENT;
    
        sfraCollectStart = false;       // disable SFRA data collection
    #endif  // SFRA_ENABLE && SFRA_TEST_PFC
    
    #if defined(SFRA_ENABLE) && (SFRA_TEST_TYPE == SFRA_TEST_MOTOR1)
        // Plot GH & H plots using SFRA_GUI, GH & CL plots using SFRA_GUI_MC
        configureSFRA(SFRA_GUI_PLOT_GH_H, USER_M1_SAMPLING_FREQ_Hz);
    
        sfraTestLoop = SFRA_TEST_MOTOR1_IQ;
    
        sfraCollectStart = false;       // disable SFRA data collection
    #endif  // SFRA_ENABLE && SFRA_TEST_MOTOR1
    
    #if defined(SFRA_ENABLE) && ( SFRA_TEST_TYPE == SFRA_TEST_MOTOR2)
        // Plot GH & H plots using SFRA_GUI, GH & CL plots using SFRA_GUI_MC
        configureSFRA(SFRA_GUI_PLOT_GH_H, MOTOR2_SAMPLING_FREQ_Hz);
    
        sfraTestLoop = SFRA_TEST_MOTOR2_IQ;
    
        sfraCollectStart = false;       // disable SFRA data collection
    #endif  // SFRA_ENABLE && SFRA_TEST_MOTOR2
    
        systemVars.flagEnableSystem = false;
    
    #if(PFC_BUILDLEVEL >= PFC_LEVEL_2)
        pfcVars.flagEnableOffsetCalc = false;
        motorVars[MTR_1].flagEnableOffsetCalc = true;
        motorVars[MTR_2].flagEnableOffsetCalc = true;
    #else
        pfcVars.flagEnableOffsetCalc = true;
        motorVars[MTR_1].flagEnableOffsetCalc = true;
        motorVars[MTR_2].flagEnableOffsetCalc = true;
    #endif  // PFC_BUILDLEVEL == PFC_LEVEL_1
    
        systemVars.powerRelayWaitTime_ms = POWER_RELAY_WAIT_TIME_ms;
        systemVars.timerBase_1ms = 0;
        systemVars.flagEnableExtCmd = false;
        systemVars.flagEnableSystem = false;
    
        // Waiting for enable system flag to be set
        while(systemVars.flagEnableSystem == false)
        {
            if(HAL_getCPUTimerStatus(halHandle, HAL_CPU_TIMER0) == true)
            {
                // read the ADC data with offsets
                HAL_readPFCADCData(&adcDataPFC);
    
                // convert dc bus voltage from pu to SI unit
                pfcVars.VdcBusLPF = pfcVars.VdcBusLPF +
                        (adcDataPFC.VdcBus - pfcVars.VdcBusLPF) * pfcVars.lpfVdcCoeff;
    
                pfcVars.VdcBusLPF_V = pfcVars.VdcBusLPF * USER_PFC_ADC_FULL_SCALE_DC_VOLTAGE_V;
    
            #if(PFC_BUILDLEVEL > PFC_LEVEL_4)
                if(pfcVars.VdcBusLPF_V >= POWER_RELAY_ON_VOLTAGE_V)
                {
                    systemVars.timerBase_1ms++;
                }
            #else
                systemVars.timerBase_1ms++;
            #endif
    
                if(systemVars.timerBase_1ms > systemVars.powerRelayWaitTime_ms)
                {
                    systemVars.flagEnableSystem = true;
                    systemVars.timerBase_1ms = 0;
    
                    // Turn on the power relay
                    HAL_turnOnPowerRelay(ACPOWER_RELAY_GPIO);
                    HAL_turnOnPowerRelay(ACPOWER_RELAY_GPIO);
    
                    // Turn on the FWV relay which is used for power relay
                    // on the new board for F280015x
                    HAL_turnOnPowerRelay(FOURWAY_RELAY_GPIO);
                    HAL_turnOnPowerRelay(FOURWAY_RELAY_GPIO);
                }
    
                HAL_clearCPUTimerFlag(halHandle, HAL_CPU_TIMER0);
            }
        }
    
        // Turn on the power relay
        HAL_turnOnPowerRelay(ACPOWER_RELAY_GPIO);
        HAL_turnOnPowerRelay(ACPOWER_RELAY_GPIO);
    
        systemVars.flagEnableSystem = false;
        systemVars.timerBase_1ms = 0;
        systemVars.powerRelayWaitTime_ms = OFFSET_CHECK_WAIT_TIME_ms;
    
        // Waiting for enable system flag to be set
        while(systemVars.flagEnableSystem == false)
        {
            if(HAL_getCPUTimerStatus(halHandle, HAL_CPU_TIMER0) == true)
            {
                systemVars.timerBase_1ms++;
    
                if(systemVars.timerBase_1ms > systemVars.powerRelayWaitTime_ms)
                {
                    systemVars.flagEnableSystem = true;
                    systemVars.timerBase_1ms = 0;
                }
    
                HAL_clearCPUTimerFlag(halHandle, HAL_CPU_TIMER0);
            }
        }
    
        systemVars.flagEnableSystem = true;
    
        // Turn on the power relay
        HAL_turnOnPowerRelay(ACPOWER_RELAY_GPIO);
    
    #ifndef PFC_DISABLE
        // run offset calibration for PFC
        runPFCOffsetsCalculation();
    #endif  // PFC_DISABLE
    
        // run offset calibration for motor 1
        runMotor1OffsetsCalculation();
    
    #ifndef MOTOR2_DISABLE
        // run offset calibration for motor 2
        runMotor2OffsetsCalculation();
    #endif  // !MOTOR2_DISABLE
    
        // enable global interrupts
        HAL_enableGlobalInts(halHandle);
    
        // enable debug interrupts
        HAL_enableDebugInt(halHandle);
    
        systemVars.flagEnableSystem = true;
    
        HAL_clearCPUTimerFlag(halHandle, HAL_CPU_TIMER0);
    
        motorVars[0].flagEnableRunAndIdentify = false;
        motorVars[1].flagEnableRunAndIdentify = false;
    
        while(systemVars.flagEnableSystem == true)
        {
            // loop while the enable system flag is true
    
            // 1ms time base
            if(HAL_getCPUTimerStatus(halHandle, HAL_CPU_TIMER0) == true)
            {
                systemVars.timerBase_1ms++;
    
                HAL_clearCPUTimerFlag(halHandle, HAL_CPU_TIMER0);
    
                SYS_processFault();
                SYS_updateCtrlState();
    
                switch(systemVars.timerBase_1ms)
                {
                    // 5ms time base
                    case 1:     // motor 1 protection check
                        calculateRMSData(MTR_1);
                        runMotorMonitor(MTR_1);
                        break;
    
                    case 2:     // motor 2 protection check
                    #if !defined(MOTOR2_DISABLE)    // single motor on high voltage kit
                        calculateRMSData(MTR_2);
                        runMotorMonitor(MTR_2);
                    #endif  // !MOTOR2_DISABLE
                        break;
    
                    case 3:     // pfc protection check
                    #if !defined(PFC_DISABLE)
                        runPFCMonitor();
                    #endif  // PFC_DISABLE
                        break;
    
                    case 4:     // calculate motor and pfc protection value
                    #if !defined(MOTOR1_DCLINKSS)
                        calcMotorOverCurrentThreshold(MTR_1);
                    #else   // MOTOR1_DCLINKSS
                        calcMotorDCLinkOverCurrentThreshold(MTR_1);
                    #endif  // MOTOR1_DCLINKSS
    
                        calcMotorOverCurrentThreshold(MTR_2);
    
                    #if !defined(PFC_DISABLE)
                        calcPFCOverCurrentThreshold();
                    #endif  // PFC_DISABLE
    
                    #if defined(MOTOR1_FWC)
                        updateFWCParams();
                    #endif  // MOTOR1_FWC
    
                    #if defined(MOTOR1_MTPA)
                        updateMTPAParams();
                    #endif  // MOTOR1_MTPA
                        break;
    
                    case 5:     // system control
                        systemVars.timerBase_1ms = 0;
                        systemVars.timerCnt_5ms++;
    
                        SYS_displayFault();     // 5ms
    
                    #if defined(MOTOR2_ESMO)
                        if(motorVars[MTR_2].motorState >= MOTOR_CTRL_RUN)
                        {
                            ESMO_updateFilterParams(esmoM2Handle);
                            ESMO_updatePLLParams(esmoM2Handle);
                        }
                    #endif  // MOTOR2_ESMO
    
                    #if defined(MOTOR1_ESMO)
                        if(motorVars[MTR_1].motorState >= MOTOR_CTRL_RUN)
                        {
                            ESMO_updateFilterParams(esmoM1Handle);
                            ESMO_updatePLLParams(esmoM1Handle);
                        }
                    #endif  // MOTOR2_ESMO
                        break;
    
                    default:
                        break;
                }
    
                #if defined(SFRA_ENABLE)
                // SFRA test
                SFRA_F32_runBackgroundTask(&sfra1);
                SFRA_GUI_runSerialHostComms(&sfra1);
                #endif  // SFRA_ENABLE
    
            }
    
            // run control for motor 1
            runMotor1Control();
    
        #if !defined(MOTOR2_DISABLE)
            // run control for motor 2
            runMotor2Control();
        #endif  // !MOTOR2_DISABLE
    
        #if !defined(PFC_DISABLE)
            // run control for PFC
            runPFCMainControl();
        #endif  // PFC_DISABLE
    
            if(systemVars.flagEnableExtCmd == true)
            {
                if(GPIO_readPin(TEST_SWITCH_GPIO) == 0)
                {
                    motorVars[MTR_2].flagEnableRunAndIdentify = true;
                    motorVars[MTR_2].speedRef_Hz = systemVars.speedFan_Hz;
                }
                else
                {
                    motorVars[MTR_2].flagEnableRunAndIdentify = false;
                }
            }
    
        } // end of while() loop
    
        // disable the PWM for stopping the motor 1
        HAL_disableMTRPWM(halMtrHandle[0]);
    
        // disable the PWM for stopping the motor 1
    #if !defined(MOTOR2_DISABLE)
        HAL_disableMTRPWM(halMtrHandle[1]);
    #endif  // !MOTOR2_DISABLE
    
    } // end of main() function
    
    //---------------babaji add---------------
    
    __interrupt void sciaTXFIFOISR(void)
    {
       uint16_t i;
    
       SCI_writeCharArray(SCIC_BASE, sDataC, 2);
    
            //
            // Increment send data for next cycle
            //
            for(i = 0; i < 2; i++)
            {
                sDataC[i] = (sDataC[i] + 1) & 0x00FF;
            }
    
            SCI_clearInterruptStatus(SCIC_BASE, SCI_INT_TXFF);
    
            //
            // Issue PIE ACK
            //
            Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP9);
    }
    
    __interrupt void sciaRXFIFOISR(void)
    {
       uint16_t i;
    
            SCI_readCharArray(SCIC_BASE, rDataC, 2);
    
            //
            // Check received data
            //
            for(i = 0; i < 2; i++)
            {
                if(rDataC[i] != ((rDataPointC + i) & 0x00FF))
                {
                    //error();
                }
            }
    
            rDataPointC = (rDataPointC + 1) & 0x00FF;
    
            SCI_clearOverflowStatus(SCIC_BASE);
    
            SCI_clearInterruptStatus(SCIC_BASE, SCI_INT_RXFF);
    
            //
            // Issue PIE ack
            //
            Interrupt_clearACKGroup(INTERRUPT_ACK_GROUP9);
    }
    
    //
    //-- end of this file ----------------------------------------------------------
    //
    

  • Let me ask Kevin to help you on this since he is working on supporting this project.

  • Hi Kevin, 

    Please resolve above error. 

  • Hi Babaj,

    The errors are because your function prototypes are named with scic and your function declarations are scia. Also, you have two function declarations in your file.

    I'd recommend writing and testing your SCI (UART) communication code outside of your system software project first (i.e. can utilize the C2000WARE project for development). After you've finished writing and testing the SCI code you can integrate it into your system software and perform further testing.

    I see you're using interrupts for your SCI code. Is this just because the example coder you are referencing used interrupts? Or do you prefer an interrupt based design over background / polling methods?

    Best,

    Kevin

  • Dear Kevin, 

    Thanks for your big support...

    I'd recommend writing and testing your SCI (UART) communication code outside of your system software project first (i.e. can utilize the C2000WARE project for development). After you've finished writing and testing the SCI code you can integrate it into your system software and perform further testing

    I will work as per your above suggestion

  • Hi Babaj,

    Great and best of luck with your development / testing. Let us know if you have any further questions.

    Best,

    Kevin

  • Dear Kevin,

    Please find the attached copy of IDU-ODU Communication protocol document.

    You have any sample similar code of IDU-ODU Communication  protocol ??? if yes please send sample code

    Communication Protocol between IDU Controller and ODU Drive V1.1.xls

    Or Any idea how to implement these ???

  • Hi Babaj,

    We don't have any example code that matches this protocol exactly. I can share a SCI / UART software framework and documentation with you that may help in implementing it however. It is a polling based SW framework that would operate in your background loop (i.e. it is not designed to be interrupt driven by default).

    Let me know if you think this would be helpful.

    Best,

    Kevin

  • I can share a SCI / UART software framework and documentation with you that may help in implementing it however.

    Please Share as early as possible.

  • Hi Babaji,

    I sent you a private E2E message with the software and documentation.

    Best,

    Kevin

  • Dear Kevin/yanming,

    I was prefered writing and testing of SCI (UART) communication code outside of our system software project first (i.e. i utilize the C2000WARE project for development). 

    But in this case MCU of TIDM Board & TTL converter get damaged.

    Please refer below attachment of block diagram of communication circuits.

    communication_connection_diagram.xlsx

    In this case i removed R11,R8 & C16 then connect as per above attachment but still mcu of TIDM Board & TTL got damaged.

    Please suggest as early as possible.

  • Please suggest as early as possible, 

    Because project is delay due to this above issue, please guide

  • Hi Kevin/yanming, 

    Any update.....! 

  • Hi Babaji,

    Sorry for the delay, I was out of office the last few days.

    But in this case MCU of TIDM Board & TTL converter get damaged.

    In what way was the MCU damaged? What device behavior are you now witnessing?

    During your testing, were you only supplying low voltage supply to the TIDM board? (i.e. not supplying high-voltage AC or DC supply). For your SCI / UART testing and development everything should be done in a low voltage system. You could even use a LaunchPad / ControlCard evaluation board for your testing purpose.

    Also just to check, your TTL converter is for interfacing with 3.3V IO devices, not 5V?

    Best,

    Kevin

  • Dear Kevin, 

    For TIDM BOARD, can I supply 5v to external power supply??? 

    Also can I connect TTL ground is connected to mcu ground?? 

  • Hi Babaji,

    For TIDM BOARD, can I supply 5v to external power supply??? 

    Yes, you can supply power to the different low voltage rails externally / separately. See below from the User's Guide.

    Also can I connect TTL ground is connected to mcu ground?? 

    Yes you can. How and where are you connecting the RX and TX signals on the board? On the R11 & R8 resistor pads or somewhere else?

    Best,

    Kevin

  • Dear Kevin,

    Thanks for your big support...

  • Hi Babaji,

    You're very welcome. Let us know if there's anything else we can help with.

    Best,

    Kevin