Hi All,

I am trying to use tinyos 2.x with telosb to communicate with PC using UART0.

I have tried different components Msp430Usart0C and Msp430Uart0C but I don't 
receive the same character sent from PC.

For example if I send 'a' from PC, I get '0x58 0x08 0x01 0x00' ie four 
characters on the PC. Even when the code explicitly sends 1 byte.

I have set baud rate on the PC to 57600. If I run the same code using 
Msp430Usart1C component, there is no problem.

Can anyone please point me to the problem in this code?

Following is the sample code I am trying to run.

configuration TestSerialAppC {}
implementation {
    components TestSerialC as App, MainC, LedsC;

    components new Msp430Usart0C() as usart0;

    App.Boot -> MainC;
    App.Leds -> LedsC;

    App.usart -> usart0;
    App.UsartResource -> usart0;
}

module TestSerialC {
    uses {
        interface HplMsp430Usart as usart;
        interface Boot;
        interface Resource as UsartResource;
        interface Leds;
    }
}

implementation {
    event void Boot.booted() {
        while (call UsartResource.request() != SUCCESS);
    }
    event void UsartResource.granted() {
        uint8_t data;
        call usart.setModeUart(&msp430_uart_default_config);
        call usart.enableUart();

        while (1) {
            call Leds.led1On();
            while (! call usart.isRxIntrPending());
            call Leds.led1Off();

            data = call usart.rx();
            call usart.clrRxIntr();

            call Leds.led0On();
            call usart.tx(data);

            while (! call usart.isTxEmpty());
            if (call usart.isTxIntrPending()) {
                call usart.clrTxIntr();
            }
            call Leds.led0Off();
        }
    }
}



Any help is appreciated. 
 
Vaibhav








       
____________________________________________________________________________________
Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for 
today's economy) at Yahoo! Games.
http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow  

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

Reply via email to