thanks roman,

the problem was with the voltage levels. Since the telosb works on a Vcc=3V and 
the RS232 specifies a logic level of 5V
it needs a level shifter to convert the voltage levels from telosb to RS232. I 
used a switching transistor to convert the 
voltage levels.

 
 
Vaibhav
 



----- Original Message ----
From: Roman Lim <[EMAIL PROTECTED]>
To: Vaibhav Nagarnaik <[EMAIL PROTECTED]>
Cc: [email protected]
Sent: Monday, October 8, 2007 12:41:00 AM
Subject: Re: [Tinyos-help] Problem with communicating with PC using UART0 on 
telos ver.B for tinyos 2.x


do you use a levelshifter on your crossover cable? the voltage level
 for
pc communication is +/-5v if i remember it correctly.
in
http://tinyos.cvs.sourceforge.net/tinyos/tinyos-2.x-contrib/ethz/snpk/tos/lib/dsn/
you can find a working tos2 implementation of a uart0 communication
 with
tmote.

roman

Vaibhav Nagarnaik wrote:
> 
> 
>  Hi All,
> 
> Any ideas yet why I can't communicate using UART0 from telosb?
> 
> I have confirmed that the cross-over serial cable is good for
 communication 
> and that there is no other problem. Is it something to do with using
 some 
> kind of chip select for the multiplexed bus on UART0 and CC2420?
> 
> All I have got from the archives is a solution for tinyos 1.x to use 
> BusArbitration module. But I am using 2.x and I think using Resource 
> interface provided by Msp430Usart0C should be enough. Is this
 correct?
> 
> Any other people having similar troubles?
> 
> 
>  
> Vaibhav
> 
> ----- Original Message ----
> From: Kevin Klues <[EMAIL PROTECTED]>
> To: Vaibhav Nagarnaik <[EMAIL PROTECTED]>
> Cc: [email protected]
> Sent: Thursday, October 4, 2007 3:30:15 PM
> Subject: Re: [Tinyos-help] Problem with communicating with PC using
 UART0 on telos ver.B for tinyos 2.x
> 
> I'm actually surprised you see anything at all......
> You can't use USART0 to communicate with the PC because it isn't
> physically connected to the serial port on the telos -- there are no
> wires connecting USART0 to the USB controller to exchange data with
> the PC.
> 
> USART0 is attached to the radio, the flash, and the external
 connector
> pins, while USART1 is attached to the serial port.
> 
> As a side note......
> You should consider using something other than while() loops in the
> way that you do if you actually start implementing something
> substantial in TinyOS.  Because of the concurrency model that TinyOS
> uses, using while() loops to wait on a flag without really knowing
> what you are doing could cause your program to lock up and never
 break
> out of the loop.  Using a split-phase operation is preferred.  Just a
> word of caution for anyone considering doing this.
> 
> Kevin
> 
> On 10/4/07, Vaibhav Nagarnaik <[EMAIL PROTECTED]> wrote:
>> 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
>>





__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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

Reply via email to