Axel,
What version of TinyOS are you using? There was a thread about a year
ago about problems with the way I2C was implemented (check under my name),
if you're using 2.x. The new version (release) seems to have the fix
implemented.
Regards,
Kurt
----Original Message Follows----
From: Axel Poigné <[EMAIL PROTECTED]>
To: [email protected]
Subject: [Tinyos-help] Puzzled about I2C write
Date: Mon, 1 Sep 2008 18:48:16 +0200
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