Part Number: MSP430FR2633
Other Parts Discussed in Thread: MSP430F149, , MSP430FR2311
Hi,
I am using the MSP430FR2633 as the Slave device in REGISTER I2C mode. My host or master is MSP430F149 micro controller. This host do not have the seperate I2C module so we use the bit banging technique to create I2C mode.
According to the following example by TI, we need to send the [Slave address with write] + [COMMAND ID] + [SENSOR ID].
So my default write will be [0x0A] + [0x00] + [0x00].
But I could not receive the acknowledgment after I sent the [Slave address with write] which is [0x0A].
Example:
Sensor Packet Example: Getting Dominant Element and Using the Checksum
In this example, we will use the same sensor packet request as in the original example above, with two differences: we are going to extract the dominant element and we are going to read back the checksum as well to validate the transaction. To read the checksum, we just read an additional two bytes after the 6 bytes of the packet (8 bytes total). The checksum is 16 bits, lower byte first, and is calculated from byte 0 to byte 5 (the entire packet excluding the checksum itself). The data capture shown here was taken while a touch was present on element 2. This is to shown what data looks like when an actual touch is present.
void loop(void)
{
static uint8_t tx[16];
static uint8_t rx[16];
if (capture==true)
{
capture = false;
tx[0] = 0x00;
tx[1] = 0x00;
I2CMaster_writeBuffer(0x0A, &tx[0], 2);
I2CMaster_readBuffer(0x0A, &rx[0], 8);
if ((rx[5] & BIT0) && (rx[2] == 0x02))
{
// Element 2 is touched
P1OUT |= BIT0;
}
else
{
// Element 2 is not touched
P1OUT &= ~BIT0;
}
}
}


