This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430F5172 I2C own adress

Other Parts Discussed in Thread: MSP430F5172

Hello,

i want to use the MSP430 as I2C slave, but the problem is the fixed own adress. We use a protocol, which uses the adress byte also for commands.

Control (Bit7-Bit4)

Adress(Bit3-Bit1)

The MSP430 only generates an interrupt if the received adress is equal to the own adress.(or 0x00). Have I the possibilty to react on every received byte?

Thanks.

  • Not that I know of. Using the address byte for commands is a violation of the I2C bus concept. It acutally means that one slave has one address for each 'command', or acts as a multiple-address slave. And that there may only be one slave on the whole bus (which doesn't qualify it to be a bus anymore), as there is no way to send the same command to different slaves.
    Thsi definitely isn't what I2C was meant (and designed) for.

    What is the problem with sending a dedicated slave address (or even '0') and then sendign the command as the first data byte?

    However, you may wire multiple I2C modules together. The 5438A has 4 USCI modules, so it could act as four different slaves on the same I2C bus.

  • Well, I know the I2C specificiation. But our protocol is based on the SMBus, which is used by every device in our production line. So the main problem isn't to implement the right I2C protocol in the mcu, but change it in the configuration devices. I know, that other MCU's(PIC, 8051) support adress masking and also the enhanced I2C unit of the MSP430, but I'm not able to find a compatible device to the MSP430F5172, which supports masking.

  • You can pick one of the MSPs with USI module.

    The USI module does not support UART operation, bu tit allows fine-tuned control (in other words, it suffers lack of convenience) for I2C and SPI mode.
    Here you receive the address as normal data byte and the software can decide whether to pick it up or not.

    However, none of the 5x family devices has an USI.

    The eUSCI module, as found in the FR57xx, supports four independent 'own' addresses.

    Normally, messages meant to be sent to no specific slave, would be sent using the general call address. I wonder why SMBus doesn't use this feature. Well, gone is gone. True for love as well as for backwards compatibility :)

    Remember, the MSP is specified for I2C compatibility, not for SMBus compatibility.

    If nothing else works, you can set up a software I2C slave using either P1/P2 with edge interrupt detect, or port pins with timer capture capability. It requires a tighter timing of your code, but still possible. And it gives you all the control you need.

    p.s.: the 'address masking' of 8051 and PICs is due to the reduced convenience those devices offer - they do not handle the address byte differently from any data byte. Just like the USI module. More control, but also more work to do in software.

**Attention** This is a public forum