Hy David,
I had the same problem with my TmoteSky. After debugging with JTAG I noticed
that the problem in DS2411.init() is the reset() function.

command result_t DS2411.init() // >= 6000us
  {
    int retry = 5;
    uint8_t id[8];

    bzero( m_id, 8 );
    call DS2411Pin.init();
    while( retry-- > 0 )
    {
      int crc = 0;
      if( reset() )
      {
        uint8_t* byte;

        write_byte(0x33); //read rom
        for( byte=id+7; byte!=id-1; byte-- )
          crc = crc8_byte( crc, *byte=read_byte() );

        if( crc == 0 )
        {
          memcpy( m_id, id, 8 );
          return SUCCESS;
        }
     }
    }


So I did a quick and dirty work-around:

command result_t DS2411.init() // >= 6000us
  {
    int retry = 5;
    uint8_t id[8];

    bzero( m_id, 8 );
    call DS2411Pin.init();
    while( retry-- > 0 )
    {
      int crc = 0;
      //if( reset() )
      reset();
      if(1)
      {
        uint8_t* byte;

        write_byte(0x33); //read rom
        for( byte=id+7; byte!=id-1; byte-- )
          crc = crc8_byte( crc, *byte=read_byte() );

        if( crc == 0 )
        {
          memcpy( m_id, id, 8 );
          return SUCCESS;
        }
     }
    }

I know this is really poor, but now it works for me. BTW I just needed the
component to clearly identify my motes via the serial ID, so I did no
further debugging.

Regards,
OLE


-----Ursprüngliche Nachricht-----
Von: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Im Auftrag von Joe
Polastre
Gesendet: Mittwoch, 18. Juli 2007 16:37
An: David Henry
Cc: [email protected]
Betreff: Re: [Tinyos-help] Getting SerialID from tmoteinvent

No, the DS2411 is identical on Tmote Invent.  The problem is probably
due to the timing in your contrib/ application.  The DS2411 driver
provided with Boomerang has the correct 1-wire timing.

-Joe

On 7/18/07, David Henry <[EMAIL PROTECTED]> wrote:
>
>
> In the absence of nodeid's in the tmote world, I need to get something
else
> so I tried getting Serial ID instead.
> The SerialIDSend application in the contrib tree seemed a good place to
> start.
> Trouble is that the DS2411.init() function hangs for ever.
> Could it be that the 1 wire pin is connected somewhere else on the
> tmoteinvent?
>
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


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

Reply via email to