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.

CCS: XM3 Controller Example Code

Tool/software: Code Composer Studio

Hello,

I am going through an example code for the XM3 3-phase Inverter (CRD300DA12E-XM3) and I am not sure why two lines are being used to obtain the currents or voltages in the main program. I am posting two lines from the example below. Any explanation will be appreciated. Thank you.

VoltageMsgData[0] = (int16_t)getVoltageA()>>8; //Vsense-A
VoltageMsgData[1] = (int16_t)getVoltageA();

  • Taohid,

    I have reached out to Wolfspeed as we did not provide this SW, to provide an accurate reply. 

    -Manish 

  • Taohid,

    In this software example the inverter is running as open-loop sine-PWM and the analog signals are polled once per second for CAN feedback using a software triggered SOC on all the ADC channels.

    After the SOC has been triggered the feedback signals for current, temperature, and voltage are calculated and placed into a CAN packet to be transmitted.

    (int16_t)getVoltageA() returns a 16 bit integer value for the voltage on sense input A.

    These particular two lines put the upper 8 bits and lower 8 bits into the array that is the packet for the voltage feedback because the CAN module operates on 8 bits only. 

    VoltageMsgData[0] = (int16_t)getVoltageA()>>8; //Vsense-A
    VoltageMsgData[1] = (int16_t)getVoltageA();

    -Matthew