[Tinyos-help] Puzzled about I2C write

Axel Poigné axel.poigne at iais.fraunhofer.de
Mon Sep 1 09:48:16 PDT 2008


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20080901/6725aa27/attachment.htm 


More information about the Tinyos-help mailing list