Other Parts Discussed in Thread: CC2642R
Hi,
i using EXP430FR2433 developement kit , i configured MSP430FR2433 as a slave and configured p1.2 as SDA and p1.3 as SCL and also i enabled the I2C interrupt to receive the data from master.......but I2C interrupt is not triggering even once also to receive the data. while connecting the SDA and SCL pin with master, the MSP430 EVK is pulling down the SDA line ....can you give a solution for this..?
In master side i receiving the error like "I2C bus is already in use"
The slave mode configuration in MSP430FR2433 code is below
/*----------------------------------------GPIO Config----------------------------------------*/
void GPIO_Config()
{
GPIO_setAsPeripheralModuleFunctionInputPin(
GPIO_PORT_P1,
MSP_I2C_SDA | MSP_I2C_SCL,
GPIO_PRIMARY_MODULE_FUNCTION
);
PM5CTL0 &= ~LOCKLPM5;
}
/*----------------------------------------Salve mode----------------------------------------*/
void set_i2c_slave_mode ()
{
param_i2c_slave .slaveAddress = SLAVE_ADDRESS; //SLAVE_ADDRESS = 0x44
param_i2c_slave .slaveAddressOffset = EUSCI_B_I2C_OWN_ADDRESS_OFFSET0; // EUSCI_B_I2C_OWN_ADDRESS_OFFSET0 = 0x00
param_i2c_slave .slaveOwnAddressEnable = EUSCI_B_I2C_OWN_ADDRESS_ENABLE; // EUSCI_B_I2C_OWN_ADDRESS_ENABLE = UCOAEN
EUSCI_B_I2C_initSlave_registers(EUSCI_B0_BASE, ¶m_i2c_slave );
//Enable I2C Module to start operations
EUSCI_B_I2C_enable(EUSCI_B0_BASE);
EUSCI_B_I2C_clearInterrupt(EUSCI_B0_BASE,
EUSCI_B_I2C_TRANSMIT_INTERRUPT0 |
EUSCI_B_I2C_RECEIVE_INTERRUPT0 |
EUSCI_B_I2C_CLOCK_LOW_TIMEOUT_INTERRUPT |
EUSCI_B_I2C_STOP_INTERRUPT
);
EUSCI_B_I2C_enableInterrupt(EUSCI_B0_BASE,
EUSCI_B_I2C_RECEIVE_INTERRUPT0 |
EUSCI_B_I2C_CLOCK_LOW_TIMEOUT_INTERRUPT |
EUSCI_B_I2C_STOP_INTERRUPT
);
UCB0CTLW1 |= UCCLTO_3; //(clk low timeout for approximately 34 ms)
}
/*----------------------------------------Interrupt----------------------------------------*/
#pragma vector=USCI_B0_VECTOR
__interrupt void USCIB0_ISR(void) // All Interrupts disabled inside ISR
{
}