//****************************************************************************** // MSP430G2x21/G2x31 Demo - I2C Slave Receiver, single byte // // Description: I2C Slave communicates with I2C Master using // the USI Master data should increment from 0x00 with each transmitted byte // which is verified by the slave // LED off for address or data Ack; LED on for address or data NAck.d by the slave // ACLK = n/a, MCLK = SMCLK = Calibrated 1MHz // // ***THIS IS THE SLAVE CODE*** // // Slave Master // (msp430g2x21_usi_07.c) // MSP430G2x21/G2x31 MSP430G2x21/G2x31 // // /|\| XIN|/|\| XIN|// | | | | | | // |RST XOUT| |RST XOUT|// | | | | // LED LED // | SDA/P1.7|< -|P1.7/SDA | // | SCL/P1.6|< -|P1.6/SCL | // // Note: internal pull-ups are used in this example for SDA & SCL // // D Dang // Texas Instruments Inc // October 2010 // Built with CCS Version 4.2.0 and IAR Embedded Workbench Version: 5.10 //****************************************************************************** #include char MST_Data = 0; char SLV_Addr = 0x90; int I2C_State = 0; // Variable for received data // Address is 0x48