Hi All,
I am working on I2C multi master mode of MSP430. I checked with TI sample application but there is no any application which is demonstrate MSP430 as multi-master mode.
Can any body give me sample application which is demonstrate MSP430 in multi master mode? What care I should take when arbitration occur? I developed my application which is runs MSP430 in multi-master moder. In my application I am taking care of arbitration but it is some time hang when it read data from i2c slave.
My observation is that when arbitration occur my MSP430 become slave mode, so I am giving reset to I2C controller and set MSP as Master and giving STOP condition.
Here is the code for arbitration interrupt.
UCB0IFG &= ~UCALIFG;
UCB0CTL1 |= UCSWRST; // Enable SW reset
UCB0CTL0 = UCMST + UCMODE_3 + UCSYNC+ UCMM; // I2C Master, synchronous mode
UCB0I2COA = 0x24;
UCB0CTL1 = UCSSEL_2 + UCSWRST; // Use SMCLK, keep SW reset
UCB0BR0 = 12; // fSCL = SMCLK/12 = ~100kHz
UCB0BR1 = 0;
UCB0I2CSA = 0x09; // Slave Address is 048h
UCB0CTL1 &= ~UCSWRST; // Clear SW reset, resume operation
// __delay_cycles(20); // Delay required between transaction
UCB0CTL1 |= UCTXSTP;
__delay_cycles(30); // Delay required between transaction
What I am missing for I2C multi -Master mode of MSP430? Can any body help me? My ultimate goal is read/write on slave using MSP430 in multi-master mode.
Thanks & Regards
Hitesh Patel