TIDUCL0 January 2017
The register initialization for the DRV8323 is done by means of SPI communication. The SPI communication pins are connected to the ports of the MSP430.
See "drv8323.h" to assign and initialize the ports of MSP430 for SPI communication. The TIDA-00774 reference design uses port connections as given in Table 4.
DRV8323 PIN | MSP430G2553 PIN |
---|---|
SDO | PJ.0 |
SDI | PJ.1 |
SCLK | PJ.2 |
SCS | PJ.3 |
Modify the SPI GPIO settings as per the hardware mapping. For the TIDA-00774, the mapping is shown in the following code snippet.
#define CPU_FREQ_MHZ (25)
/*********************************************************************************
* SPI GPIO Settings (Modify according to hardware mapping)
********************************************************************************/
#define M1_SCLK_HIGH (PJOUT |= BIT2)
#define M1_SCLK_LOW (PJOUT &= ~BIT2)
#define M1_SDI_HIGH (PJOUT |= BIT1)
#define M1_SDI_LOW (PJOUT &= ~BIT1)
#define M1_SDO_LEVEL ((PJIN &= BIT0)?(1):(0))
#define M1_nSCS_HIGH (PJOUT |= BIT3)
#define M1_nSCS_LOW (PJOUT &= ~BIT3)