MSP430 I2C commands MSP430 I2C address: (hex)0x23, (decimal)35 ------------------------------------------ MSP430 command set index ------------------------ 0 - SET_RTC_PARAMS - setRTC() - Set Realtime Clock 1 - GET_RTC_PARAMS - getRTC() - Get Realtime Clock 2 - GET_IR_DATA - getIRData() - Get Infrared Data Array 3 - GET_IR_VALUE - getIRVal() - Get last Infrared Value 4 - GET_INPUT_STATE - getInputState() - Get the Input state of pins 5 - GET_EVENT - getEvent() - Get outstanding events 6 - SET_OUTPUT_STATE - setOutputState() - Set the Output state of pins Command (0): setRTC() - Set Realtime Clock ------------------------------------------ > I2C Write (9 bytes) [0] = 9 ; Message length [1] = 0 ; Command index [2] = year (LSB) ; ( in hex ) i.e. 2006 -> 0x2006 ( LSB=0x06 ) [3] = year (MSB) ; ( in hex ) i.e. 2006 -> 0x2006 ( MSB=0x20 ) [4] = month ; ( in hex ) i.e. Dec. -> 0x12 [5] = day ; ( in hex ) i.e. 31st -> 0x31 [6] = hour ; ( in hex ) i.e. 12 -> 0x12 [7] = minute ; ( in hex ) i.e. 30' -> 0x30 [8] = second ; ( in hex ) i.e 45" -> 0x45 > Wait 100 us. > Done. Command (1): getRTC() - Get Realtime Clock ------------------------------------------ > I2C Write (2 bytes) [0] = 2 ; Message length [1] = 1 ; Command index > Wait 100 us. > I2C Read (9 bytes) [0] = 9 ; Message length [1] = 1 ; Command index [2] = year (LSB) ; ( in hex ) i.e. 2006 -> 0x2006 ( LSB=0x06 ) [3] = year (MSB) ; ( in hex ) i.e. 2006 -> 0x2006 ( MSB=0x20 ) [4] = month ; ( in hex ) i.e. Dec. -> 0x12 [5] = day ; ( in hex ) i.e. 31st -> 0x31 [6] = hour ; ( in hex ) i.e. 12 -> 0x12 [7] = minute ; ( in hex ) i.e. 30' -> 0x30 [8] = second ; ( in hex ) i.e 45" -> 0x45 > Wait 100 us. > Done. Command (2): getIRData() - Get entire Infrared buffer ----------------------------------------------------- > I2C Write 2 bytes [0] = 2 ; Message length [1] = 2 ; Command index > Wait 100 us. > I2C Read [variable length] [0] = message length ; Message length [1] = 2 ; Command index [2] = 1st IR value (LSB) [3] = 1st IR value (MSB) [4] = 2nd IR value (LSB) [5] = 2nd IR value (MSB) [6] = 3rd IR value (LSB) [7] = 3rd IR value (MSB) ... > Wait 100 us. > Done. Command (3): getIRVal() - Get last Infrared value ------------------------------------------------- > I2C Write 2 bytes [0] = 2 ; Message length [1] = 3 ; Command index > Wait 100 us. > I2C Read 4 bytes [0] = 4 ; Message length [1] = 3 ; Command index [2] = IR value (LSB) [3] = IR value (MSB) > Wait 100 us. > Done. Command (4): getInputState() - Get port 2 and port 3 input state ---------------------------------------------------------------- > I2C Write 2 bytes [0] = 2 ; Message length [1] = 4 ; Command index > Wait 100 us. > I2C Read 4 bytes [0] = 4 ; Message length [1] = 4 ; Command index [2] = P2 state ; Bit 4: CF CD.2 ( 1: No Card )( 0: Card Found ) ; Bit 3: CF CD.1 ( 1: No Card )( 0: Card Found ) ; Bit 2: MS/Pro CD ( 1: No Card )( 0: Card Found ) ; Bit 1: SD/MMC CD ( 1: No Card )( 0: Card Found ) [3] = P3 state ; Bit 6: SD/MMC WP ( 1: WP on ) ( 0: WP off ) ; Bit 2: xD CD ( 1: No Card )( 0: Card Found ) ; Bit 1: SM CD ( 1: No Card )( 0: Card Found ) > Wait 100 us. > Done. Command (5): getEvent() - Get outstanding events ------------------------------------------------ > I2C Write 2 bytes [0] = 2 ; Message length [1] = 5 ; Command index > Wait 100 us. > I2C Read 4 bytes [0] = 3 ; Message length [1] = 5 ; Command index [2] = Events ; ( 1: State Change ) ; ( 2: IR Data ) > Wait 100 us. > Done. Command (6): setOutputState() - Set port 2 and port3 output state ----------------------------------------------------------------- > I2C Write 4 bytes [0] = 4 ; Message length [1] = 6 ; Command index [2] = P2 state ; All bits are ignored [3] = P3 state ; Bit 3: CF_PWR_ON ( 1: POWER ON ) ( 0: POWER OFF ) ; Bit 0: SM_CE ( 1: SM CE OFF )( 0: SM CE ON ) > Wait 100 us. > Done.