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.

MSP430F5437A: Interfacing with EEPROM M24M02-DWMN3TP/K via I2C interface

Part Number: MSP430F5437A


Tool/software:

Hi,

We are using MSP430F5437A. and interfaced with  EEPROM M24M02-DWMN3TP/K via I2C interface.

This EEPROM, takes 5 msec for page write. and it will be triggered after sending stop condition.

So once stop condition is given, it will start internal write cycle. and it takes maximum 5 msec.  

If I give 5 msec delay between I2C operations,  write/read operations is working successfully.

but we dont want to wait 5 msec. and we want to poll for ack flag as suggested by EEPROM data sheet. Could you please which flag to poll? we see only NACK flag. but no ACK flag available.

attaching screen shot of EEPROM suggested way

  • For ACK-polling, the notion is to send a zero-length (Write) transaction to the device, and see if a NACK (UCNACKIFG) results; an ACK is implied by the absence of a NACK indication.

    UCNACKIFG is cleared by a Start, so the tactic would be to issue a Start (UCTXSTT with UCTR=1) then, on receiving the TXIFG, issue a Stop (UCTXSTP) and check UCNACKIFG when the Stop completes. [Ref User Guide (SLAU208Q) Sec 38.3.4.2.1 Paragraph 4]

    Another tactic might be to code each EEPROM transaction to do some number of retries (say, up to 5ms), anticipating that there might be a Write in progress. (This resembles "write-behind" more than "Ack-polling" per se, but it accomplishes the same purpose.)

    Application Report SLAA208 (here) has an example of an ACK-polling function, though I think it works slightly differently from what I just described. (As I recall, that Report has ports for the F1 and F2 series, not the F5, but I think the USCIs work mostly the same.)

**Attention** This is a public forum