On Friday 15 December 2006 02:53 am, Matteo Andretto wrote:
> Quoting "R. Steve McKown" <[EMAIL PROTECTED]>:
> > If you want to post your code, I can take a look at it.
>
> The code is yours, I have changed only the salve address and add the
> address check reading three bit at a time with leds.

I just re-ran the code here on a pair of Crossbow motes (pretty much the same 
as TMote Sky's).  The only changes I've made to the slave code since 
originally posting it on 9/28/06 are superficial; a diff is attached.

I haven't seen your master mote code.  I've attached some snippets from my 
master test program in case it's useful.

I already said this, but it bears repeating with some more detail.  I think 
your best way forward is to inject some LED test code into slave/Msp320I2CP, 
event I2CInterrupts.fired().  The return from the call to HplI2C.getIV() in 
this event returns the I2C state change seen.  For example, you can add some 
code to turn on a LED if you receive I2CIV_STT, the start condition.  The 
start condition is seen regardless of the slave address (since of course the 
address has not yet been sent).  If you don't see a start condition, there's 
something wrong on the master mote or the I2C bus between them.  If you do, 
then you can look for other events, like one's own address.  See Ch 15.2.8 in 
the msp430 User's Guide, and the I2CIV_* definitions in the msp430-gcc 
include file, usart.h.

That's about all the help I can give right now.  I've got to get back to my 
paying job...  ;^)

All the best,
Steve
--- slavei2c/slave/Msp430I2CP.nc	2006-09-27 17:48:32.000000000 -0600
+++ /home/smckown/workspace/slavei2c/slave/Msp430I2CP.nc	2006-12-14 08:22:28.037004358 -0700
@@ -175,14 +175,14 @@
     
     switch( call HplI2C.getIV() ) {
       
-    case 0x04:
+    case I2CIV_NACK:
       if ( I2CDCTL & I2CBB )
 	call HplI2C.setStopBit();
       while( I2CDCTL & I2CBUSY );
       signalDone( FAIL );
       break;
       
-    case 0x08:
+    case I2CIV_ARDY:
       while( (I2CDCTL & I2CBUSY) ) {
 	if ( i++ >= TIMEOUT ) {
 	  signalDone( FAIL );
@@ -192,11 +192,11 @@
       signalDone( SUCCESS );
       break;
       
-    case 0x0A:
+    case I2CIV_RXRDY:
       nextRead();
       break;
       
-    case 0x0C:
+    case I2CIV_TXRDY:
       nextWrite();
       break;
       

Attachment: masteri2c.tar.gz
Description: application/tgz

_______________________________________________
Tinyos-help mailing list
Tinyos-help@Millennium.Berkeley.EDU
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to