Hi,

I try to establish a communication between i-robot (command module) and
tmote sky.
In order to achieve this, I'm using UART0RX/TX pins on the tmote sky and an
emulator
for i-robot command module since the i-robot command module does not have
external
rx/tx ports. This emulator can be found at
http://createforums.irobot.com/irobotcreate/board/message?board.id=Create_projects&thread.id=669&jump=true
However, I can't make the whole thing work.

Following is what I'm doing at the tmote side: (It just tries to send a
dummy byte through uart0tx when
the user button is pressed.)

CountInputP.nc:


#define UBR_SMCLK_9600 0x006D
#define UMCTL_SMCLK_9600 0x44

module CountInputP {
  provides interface StdControl;
  uses {
    interface Leds;
      interface Button;
      interface SendMsg;
    interface HPLUSARTControl as UartControl;
  }
}
implementation {
  uint8_t m_count;
  uint8_t count;
  command result_t StdControl.init() {
    call Leds.init();
  atomic {
    TOSH_MAKE_UTXD0_OUTPUT();
    TOSH_SET_UTXD0_PIN();

    call UartControl.disableSPI();
    call UartControl.disableI2C();

    call UartControl.setModeUART_TX();
    call UartControl.setModeUART_RX();

    call UartControl.setClockSource(SSEL_2);
    call UartControl.setClockRate(UBR_SMCLK_9600, UMCTL_SMCLK_9600);

    call UartControl.enableTxIntr();
    call UartControl.enableRxIntr();
    } // atomic ends
    m_count = 0x12;
    count = 0;
    return SUCCESS;
  }

  command result_t StdControl.start() {
    call Button.enable();
    return SUCCESS;
  }

  command result_t StdControl.stop() {
    return SUCCESS;
  }

   async event void Button.pressed( uint32_t when ) {
    // Make any necessary UART changes
atomic {
    call UartControl.setClockSource(SSEL_2);
    call UartControl.setClockRate(UBR_SMCLK_9600, UMCTL_SMCLK_9600);

        call UartControl.setModeUART_TX();

    //enable interrupts
    call UartControl.enableRxIntr();
    call UartControl.enableTxIntr();


call UartControl.tx( m_count );   // <----- should send
}
    atomic {
      count++;
    }
    call Leds.set( count );
  }

  async event void Button.released( uint32_t when ) {
  }

.
.
.

}


Moreover, connecting to the command module would need TTL levels. I think
UART is already TTL. Or should
I do some work to make it TTL?

Finally, what am I doing wrong? Is there anyone who could establish a
connection between tmote sky and
i-Robot?

Any help would be appreciated.

Thanks.

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

Reply via email to