Part Number: MSP432P4111
Hi,
Kindly find the schematic
from the schematic, we use UCB3SOMI & UCB3SIMO for both "SPI" & "I2C"
"SPI" initializing code:
void SPI2_Init(void)
{
P10->SEL0 |= BIT1 | BIT2 | BIT3; // Set P10.1 - SCK, P10.2 - SDO, P10.3 - SDI
EUSCI_B3->CTLW0 |= EUSCI_B_CTLW0_SWRST; // Put eUSCI state machine in reset
EUSCI_B3->CTLW0 |= EUSCI_B_CTLW0_MST;
EUSCI_B3->CTLW0 |= EUSCI_B_CTLW0_SYNC;
EUSCI_B3->CTLW0 |= EUSCI_B_CTLW0_MSB;
EUSCI_B3->CTLW0 |= EUSCI_B_CTLW0_CKPL
EUSCI_B3->CTLW0 |= EUSCI_B_CTLW0_SSEL__ACLK;
EUSCI_B3->BRW = 0x01; // /2,fBitClock = fBRCLK/(UCBRx+1).
EUSCI_B3->CTLW0 &= ~EUSCI_B_CTLW0_SWRST;// Initialize USCI state machine
EUSCI_B3->IE |= EUSCI_B_IE_TXIE; // Enable TX interrupt
__enable_irq(); // Enable global interrupt
I2C initializing code:
void I2C_init(void)
{
MAP_I2C_initMaster(EUSCI_B3_BASE, &i2cConfig);
EUSCI_B_I2C_setSlaveAddress(EUSCI_B3_BASE,
0x55);
MAP_I2C_disableModule(EUSCI_B3_BASE);
MAP_I2C_enableModule(EUSCI_B3_BASE);
}
here SPI gets initialized first and data gets transmitted when I2C initialization takes place both SPI and I2C protocols stop working, whereas when they are in the separate project they work fine,
While in SPI protocol when clock polarity is set to zero, I2C works but SPI stops transmitting