//****************************************************************************** // MSP430G2x21/G2x31 Demo - I2C Master Transmitter, single byte // // Description: I2C Master communicates with I2C Slave using // the USI Master data is sent and increments 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 // ACLK = n/a, MCLK = SMCLK = Calibrated 1MHz // // ***THIS IS THE MASTER CODE*** // // Slave Master // (msp430g2x21_usi_08.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 transmitted data // Address is 0x48