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/C2000WARE-MOTORCONTROL-SDK: sdk_f280049c

Part Number: C2000WARE-MOTORCONTROL-SDK

Tool/software: Code Composer Studio

Dear friends
the following is pwm gpio part of motorcontrolsdk for f280049c hal.c . My application is 3 phase pmsm motor and utilizes 3 half bridge classic inverter. In my hardware which is going to use F280049C control card, pin number 49 (gpio-00) is allocated to lower switch in leg. also pin number 51 (gpio-01) is allocated to upper switch. I have modified the code as following:

// EPWM1A
GPIO_setMasterCore(1, GPIO_CORE_CPU1);
GPIO_setPinConfig(GPIO_0_EPWM1A);
GPIO_setDirectionMode(1, GPIO_DIR_MODE_OUT);
GPIO_setPadConfig(1, GPIO_PIN_TYPE_STD);

// EPWM1B
GPIO_setMasterCore(0, GPIO_CORE_CPU1);
GPIO_setPinConfig(GPIO_1_EPWM1B);
GPIO_setDirectionMode(0, GPIO_DIR_MODE_OUT);
GPIO_setPadConfig(0, GPIO_PIN_TYPE_STD);

Yanming verified the GPIO modification, however said to to change the PWM handles in HAL_init(), and set up PWM register in HAL_setupPWMs() in hal.c also.

My question is, as I have considered the sequence of the phases in regards to motorcontrol default 

(GPIO 1&0 >>> phase A)

(GPIO 3&2 >>> phase B)

(GPIO 5&4 >>> phase C)

; Should I change the PWM handles in HAL_init(), and set up PWM register in HAL_setupPWMs() in hal.c also ci=onsidering I have allocated gpio sets according to default but with swapped upper and lower switches in the legs?

Thanks for your help

Regards

Mak

  • You don't need to change the HAL_init() for the PWM handle, but you have to change the PWM register in HAL_setupPWMs() and GPIO in HAL_setupGPIOs() in hal.c. Please refer to the TRM of F28004x to set up the PWM registers accordingly.