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.

SPI mode confusing in between LaunchpadXL and BoosterXL DRV8301

Other Parts Discussed in Thread: DRV8301, MOTORWARE

Between processor and driver board, there is SPI connection to set the registers in DRV8301 chip.

In lab05b GPIO is initialized at hal.c like this:

  // SPI-SIMO or OCTWn
  GPIO_setMode(obj->gpioHandle,GPIO_Number_16,GPIO_16_Mode_TZ2_NOT);

  // SPI-SOMI or FAULTn
  GPIO_setMode(obj->gpioHandle,GPIO_Number_17,GPIO_17_Mode_TZ3_NOT);

  // SPI-STE or SDI
  GPIO_setMode(obj->gpioHandle,GPIO_Number_19,GPIO_19_Mode_GeneralPurpose);


why pins are NOT configured as SPI like this ? :


  GPIO_16_Mode_SPISIMOA,           //!< Denotes a SPISIMOA function

  GPIO_17_Mode_SPISOMIA,           //!< Denotes a SPISOMIA function

  GPIO_19_Mode_SPISTEA_NOT,        //!< Denotes a SPISTEA_NOT function
 
 

How these pins can control SPI bus of DRV8301  when they are initialized  like so ?

  • I don't think you are looking at the correct file.

    from

    C:\ti\motorware\motorware_1_01_00_14\sw\modules\hal\boards\boostxldrv8301_revB\f28x\f2802x\src\hal.c

      // SPI_SDI if JP4 is soldered, No Connection if JP4 is not soldered
      GPIO_setMode(obj->gpioHandle,GPIO_Number_16,GPIO_16_Mode_SPISIMOA);

      // SPI_SDO if JP6 is soldered, No Connection if JP6 is not soldered
      GPIO_setMode(obj->gpioHandle,GPIO_Number_17,GPIO_17_Mode_SPISOMIA);

      // SPI_CLK
      GPIO_setMode(obj->gpioHandle,GPIO_Number_18,GPIO_18_Mode_SPICLKA);

      // SPI_SCS
      GPIO_setMode(obj->gpioHandle,GPIO_Number_19,GPIO_19_Mode_SPISTEA_NOT);

    or from

    C:\ti\motorware\motorware_1_01_00_14\sw\modules\hal\boards\boostxldrv8301_revB\f28x\f2806x\src\hal.c

      // SPIA SIMO
      GPIO_setMode(obj->gpioHandle,GPIO_Number_16,GPIO_16_Mode_SPISIMOA);

      // SPIA SOMI
      GPIO_setMode(obj->gpioHandle,GPIO_Number_17,GPIO_17_Mode_SPISOMIA);

      // SPIA CLK
      GPIO_setMode(obj->gpioHandle,GPIO_Number_18,GPIO_18_Mode_SPICLKA);

      // SPIA CS
      GPIO_setMode(obj->gpioHandle,GPIO_Number_19,GPIO_19_Mode_SPISTEA_NOT);