Hi Andrey,
Thanks for your reply. I am still using Cygwin and have not switched yet
to Linux. But I guess that does not really matter, I have tried
everything possible, I have tried using the latest CVS (T-2.0.2) and
tried to increase the speed to 256Kbps but I have had no success at all.
Earlier I was trying to run TestNetwork application where I could manage
to go upto 56kbps using the Listen tool only but now I am trying to run
the TestSerial application, I get the following error for 256Kbps, I do
not understand why java cannot configure COM1, ANY IDEAS??????????????

$ java TestSerial OR java net.tinyos.tools.Listen
Error on [EMAIL PROTECTED]:256000: java.io.IOException: Could not configure
COM1: TOSC
omm JNI library runtime error: Error 87.
   The parameter is incorrect.
   in set_params.SetCommState

Regards,

Varun Jain

-----Original Message-----
From: Andrey Gursky [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 07, 2008 6:54 PM
To: Varun Jain
Subject: Re: [Tinyos-help] Increasing Baudrate for Atmega-128

Hi Varun!

> 
>   else if (PLATFORM_BAUDRATE == 115200UL)
>       m_byte_time = 33;  // 1 TMicor ~= 2.12 us, one byte = 69us ~= 33
>   else if (PLATFORM_BAUDRATE == 230400UL)
>       m_byte_time = 17;  // 1 TMicor ~= 2.12 us, one byte = 35us ~= 17
>   else if (PLATFORM_BAUDRATE == 256000UL)
>       m_byte_time = 15;  // 1 TMicor ~= 2.12 us, one byte = 31us ~= 15
> 

Good.

> AND in $TOSROOT/tos/platforms/micaz/hardware.h:
> 
> enum {
>   //PLATFORM_BAUDRATE = 19200L
>   //PLATFORM_BAUDRATE = 57600L
>   //PLATFORM_BAUDRATE = 115200L
>   PLATFORM_BAUDRATE = 230400L
>   //PLATFORM_BAUDRATE = 256000L
> };
> 

Do you work already in Linux?

> But it still doesn't work, I just recently found that there are some
> definitions in $TOSROOT/tos/chips/atm128/Atm128Uart.h , I believe we
> need to add something in here as well, what does this doe and how do
we
> set the following up, did you make any changes in this as well??
> 

 > /*
 >  * ATmega1128 UART baud register settings:
 >  *      ATM128_<baudRate>_BAUD_<cpuSpeed>
 >  */
 > enum {
 >   ATM128_19200_BAUD_4MHZ  = 12,
 >   ATM128_38400_BAUD_4MHZ  = 6,
 >   ATM128_57600_BAUD_4MHZ  = 3,
 >
 >....

No, I have not touch these definitions. They seem to be obsolete and no 
more used. Here it is a new function Atm128Calibrate.baudrareRegister() 
that do this work and as parameter it wants only PLATFORM_BAUDRATE.

It is strange things by you don't work. But what particularly? If you 
run the mote with increased speed and ...Listen or ...SerialForwarder 
does the synchronizing that means that there are no hardware problems 
with it. So I can assume you should test it with the application that 
you be sure successfully used on unchanged speed.


Regards,
Andrey



> 
> -----Original Message-----
> From: Andrey Gursky [mailto:[EMAIL PROTECTED] 
> Sent: Saturday, July 05, 2008 9:28 PM
> To: Varun Jain
> Subject: Re: [Tinyos-help] Increasing Baudrate for Atmega-128
> 
> Hi Varun!
> 
> I'm using m_byte_time = 16 (for 230400 in Linux). But in Cygwin I
think 
> it should be really 15 and the speed you supply to Listen or 
> SerialForwarder 256000.
> 
> You should be sure you can:
> 
> 1. add to the appropriate Atm128UartP.nc
> 
>      else if (PLATFORM_BAUDRATE == 256000UL)
>         m_byte_time = 15;  // 1 TMicor ~= 2.12 us, one byte = 31us ~=
15
> 
> 2. change in $TOSROOT/tos/platforms/(what you're using)/hardware.h
>     the declaration PLATFORM_BAUDRATE to 256000L (for cygwin)
>     after that the UART of the mote will work with this speed
> 
> 
> 
> 3. net.tinyos.tools.Listen -comm ...:256000
> 
> Than it should work.
> 
> I hope this helped. If not, write again.
> 
> Andrey
> 
> 
> 
> 
> Varun Jain wrote:
>> Hi Andrey,
>> I read that and i am already trying to do that in the Atm128UartP.nc
> file, can you tell me what is the 'm_byte_time' value that you have
used
> for 230400 baudrate??
>>  
>> Thanks,
>> Varun
>>
>> ________________________________
>>
>> From: Andrey Gursky [mailto:[EMAIL PROTECTED]
>> Sent: Wed 7/2/2008 5:04 PM
>> To: Varun Jain
>> Cc: tinyos-help@millennium.berkeley.edu
>> Subject: Re: [Tinyos-help] Increasing Baudrate for Atmega-128
>>
>>
>>
>> Hello Varun!
>>
>> In my answer to you
>>
>>
>
https://www.millennium.berkeley.edu/pipermail/tinyos-help/2008-July/0347
> 04.html
>> there was already a link to
>>
>>
>
http://mail.millennium.berkeley.edu/pipermail/tinyos-help/2008-June/0343
> 73.html
>> where the problem is solved.
>>
>> It is strange but the standard speed 256000 is not declared in the
>> tinyos implementation of serial communication. That's why I used
> 230400.
>>
>> Andrey
>>
>>
>> Varun Jain wrote:
>>> Hi,
>>> I am trying to increase the baudrate of the incoming packet for
motes
>>> with atmega-128 processor. I am adding code in  the implementation
>>> Atm128UartP.nc located at /tos/chips/atm128/Atm128UartP.nc as
> follows:
>>>
>>>
>>> else if (PLATFORM_BAUDRATE == 256000UL)
>>>
>>>       m_byte_time = 15;  // 1 TMicor ~= 2.12 us, one byte = 31us ~=
> 15
>>>
>>>
>>>
>>>
>>> $ java TestSerial -comm [EMAIL PROTECTED]:256000
>>>
>>> [EMAIL PROTECTED]:256000 died - exiting (java.io.IOException: Could not
>>> configure COM1
>>>
>>>  TOSComm JNI library runtime error: Error 87.
>>>
>>>   The parameter is incorrect.
>>>
>>>   in set_params.SetCommState)
>>>
>>>                
>>>
>>> I am running this in Windows(Cygwin).... Why cant it configure this
>>> baudrate?? How and where is it configured, is it done in
>>> /tools/tinyos/java/ ???
>>>
>>>
>>>
>>> Cheers,
>>>
>>>
>>>
>>> Varun
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>
------------------------------------------------------------------------
>>> _______________________________________________
>>> Tinyos-help mailing list
>>> Tinyos-help@millennium.berkeley.edu
>>>
>
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>>
>>
>>
> 
> 
> 


_______________________________________________
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to