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/TMS320F28069F: TI 28069F code example lab issues with initiating DRV8302 driver.

Part Number: TMS320F28069F
Other Parts Discussed in Thread: MOTORWARE, DRV8302, DRV8301

Tool/software: Code Composer Studio

Hi,

I use CCS9.1 to load and run TI example code lab1b (for example), which is from motorware installtion like below:

C:\ti\motorware\motorware_1_01_00_18\sw\solutions\instaspin_foc\boards\boostxldrv8301_revB\f28x\f2806xF\projects\ccs\ lab1b 

On my board, I use 28069F and DRV8302 driver. in the lab1b (for example, or lab2a...), I found that when I run the code, the DRV8302 Engate setting high is not valid although I have modified the entrance code here. ( in original code, it is for DRV8301)

.....

//#ifdef DRV8301_SPI
// turn on the DRV8301 if present
HAL_enableDrv(halHandle);             //in my board, GPIO51 is as Engate, the code is modified accordingly.

// initialize the DRV8301 interface
HAL_setupDrvSpi(halHandle,&gDrvSpi8301Vars);
//#endif

......

GPIO_Number_41, //!< Denotes GPIO number 41
GPIO_Number_42, //!< Denotes GPIO number 42
GPIO_Number_43, //!< Denotes GPIO number 43
GPIO_Number_44, //!< Denotes GPIO number 44
GPIO_Number_50, //!< Denotes GPIO number 50
GPIO_Number_51=51, //!< Denotes GPIO number 51
GPIO_Number_52, //!< Denotes GPIO number 52
GPIO_Number_53, //!< Denotes GPIO number 53
GPIO_Number_54, //!< Denotes GPIO number 54
GPIO_Number_55, //!< Denotes GPIO number 55
GPIO_Number_56, //!< Denotes GPIO number 56
GPIO_Number_57, //!< Denotes GPIO number 57
GPIO_Number_58, //!< Denotes GPIO number 58
GPIO_numGpios
} GPIO_Number_e;

The above running is not valid for setting GPIO51 high;

but when I modified the code in the HAL_enableDrv(), the GPIO51 setting high is valid. like this:

void DRV8301_enable(DRV8301_Handle handle)
{
DRV8301_Obj *obj = (DRV8301_Obj *)handle;
static volatile uint16_t enableWaitTimeOut;
uint16_t n = 0;

// Enable the drv8301
//GPIO_setHigh(obj->gpioHandle,obj->gpioNumber);
GPIO_setHigh(obj->gpioHandle, GPIO_Number_51);        //DRV8302 EN_GATE high;

enableWaitTimeOut = 0;


// Make sure the Fault bit is not set during startup

........

}

My question is when the code:GPIO_setHigh(obj->gpioHandle,obj->gpioNumber); is not valid? why I only modify it as :GPIO_setHigh(obj->gpioHandle, GPIO_Number_51);   then GPIO51 is settin high successfully?

I have tried CCS8.0, CCS6.2, I got the same results as in CCS9.0.

Is that a bug in official code?

  • When you say the "code is modified accordingly" that means you've edited the call to DRV8301_setGpioNumber() in HAL_setupGate() to change the argument to 51?

    If you put a breakpoint in DRV8301_enable() and look at the value of obj->gpioNumber, does it say 51 or some other value?

    Whitney