Hi

I am trying to use the I2C bus to read and write an EEPROM but failed. It seems the write does not work. I went into the code and I am puzzled about the following piece of code in tos/chips/msp430/usart/ Msp430I2CP.


void nextWrite() {
    if ( ( m_pos == m_len - 1 ) && ( m_flags & I2C_STOP ) ) {
      call HplI2C.setStopBit();
    }
    else if ( m_pos == m_len ) {
      signalDone( SUCCESS );
      return;
    }
    call HplI2C.setData( m_buf[ m_pos++ ] );
  }

It seems that it never gets into the success branch: the stop bit is set but there is no further interrupt coming. If I understand the I2C correctly this makes sense since after writing all the bytes an acknowledge (hence interrupt) should be issued by the slave, and then the master should send the stop bit.

I wonder whether I am mistaken or if my EEPROM goes wrong. The EEPROM I use is a Microchip 24LC64 on a custom-build board (where MSP and CC2420 runs fine).

Axel
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to