Re: [Tinyos-help] Porting c code with nc one

2011-09-10 Thread Sergio Valcarcel
Hi Malissa,

Depending on the platform you are using, your CPU may accept  float or even
double numbers. Also, depending on the architecture float computations might
be accelerated with dedicated hardware or not.
So the main points you have to verify is whether the extensively use of
float operations will decrease the overall performance of your system. Of
course, it is not the same to compute a numerical integration than to
average two numbers...

Another main point is the memory footprint. Float numbers typically could
use 4 bytes. So you must take care of how much available RAM you have for
your application.

A final concern is that you can not use network data types (i.e. nx_struct)
for communications since there is not defined a nx_float type.

The other option, instead of using floats, could be to convert to integer,
scaling as many decimals you want. For instance, 165.32 could be converted
to 16532 (remembering that it is multiplied by 1e2).

I hope it helps!
Sergio


On Sat, Sep 10, 2011 at 10:30 AM, Maissa Ben Jamaa  wrote:

> Hello sir,
>
> Please can I ask you a question: does using float number in a nc code for
> real compilation matter?
>
> Thank you
>
> Best regards,
> Maissa Ben Jamaa
>
>
> 2011/9/9 Maissa Ben Jamaa 
>
>> Hello sir,
>>
>> I am very thankful for your answer, I tried to do something similar to
>> blip code but I got the following error:
>> gcc: cannot specify -o with -c or -S and multiple languages.
>> Noting that I am now testing my code with Tossim.
>>
>> Best regards,
>> Maissa Ben Jamaa
>>
>>
>> 2011/9/8 Sergio Valcarcel 
>>
>>> Dear Maissa,
>>>
>>> Please, check this thread:
>>>
>>> http://www.mail-archive.com/tinyos-help@millennium.berkeley.edu/msg36375.html
>>>
>>> It is pretty straight forward, but do not hesitate to mail me if you need
>>> further help.
>>>
>>> Cheers!
>>> Sergio
>>>
>>>
>>> On Thu, Sep 8, 2011 at 5:12 PM, Maissa Ben Jamaa <
>>> maisa.benja...@gmail.com> wrote:
>>>
 Hello sir,

 I saw your interaction in tinyos help about porting c code with nc code.
 here is the link:
 http://www.mail-archive.com/tinyos-help@millennium.berkeley.edu/msg38966.html

 Please can you tell me the steps to follow in order to make this
 porting.

 Thanks.

 Best ragards,
 Maissa Ben Jamaa

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

Re: [Tinyos-help] Porting c code with nc one

2011-09-10 Thread Maissa Ben Jamaa
Hello,

Thank you.
I am using telosb mote, I think that it works well.

Best,
Maissa

2011/9/10 Sergio Valcarcel 

> Hi Malissa,
>
> Depending on the platform you are using, your CPU may accept  float or even
> double numbers. Also, depending on the architecture float computations might
> be accelerated with dedicated hardware or not.
> So the main points you have to verify is whether the extensively use of
> float operations will decrease the overall performance of your system. Of
> course, it is not the same to compute a numerical integration than to
> average two numbers...
>
> Another main point is the memory footprint. Float numbers typically could
> use 4 bytes. So you must take care of how much available RAM you have for
> your application.
>
> A final concern is that you can not use network data types (i.e. nx_struct)
> for communications since there is not defined a nx_float type.
>
> The other option, instead of using floats, could be to convert to integer,
> scaling as many decimals you want. For instance, 165.32 could be converted
> to 16532 (remembering that it is multiplied by 1e2).
>
> I hope it helps!
> Sergio
>
>
> On Sat, Sep 10, 2011 at 10:30 AM, Maissa Ben Jamaa <
> maisa.benja...@gmail.com> wrote:
>
>> Hello sir,
>>
>> Please can I ask you a question: does using float number in a nc code for
>> real compilation matter?
>>
>> Thank you
>>
>> Best regards,
>> Maissa Ben Jamaa
>>
>>
>> 2011/9/9 Maissa Ben Jamaa 
>>
>>> Hello sir,
>>>
>>> I am very thankful for your answer, I tried to do something similar to
>>> blip code but I got the following error:
>>> gcc: cannot specify -o with -c or -S and multiple languages.
>>> Noting that I am now testing my code with Tossim.
>>>
>>> Best regards,
>>> Maissa Ben Jamaa
>>>
>>>
>>> 2011/9/8 Sergio Valcarcel 
>>>
 Dear Maissa,

 Please, check this thread:

 http://www.mail-archive.com/tinyos-help@millennium.berkeley.edu/msg36375.html

 It is pretty straight forward, but do not hesitate to mail me if you
 need further help.

 Cheers!
 Sergio


 On Thu, Sep 8, 2011 at 5:12 PM, Maissa Ben Jamaa <
 maisa.benja...@gmail.com> wrote:

> Hello sir,
>
> I saw your interaction in tinyos help about porting c code with nc
> code.
> here is the link:
> http://www.mail-archive.com/tinyos-help@millennium.berkeley.edu/msg38966.html
>
> Please can you tell me the steps to follow in order to make this
> porting.
>
> Thanks.
>
> Best ragards,
> Maissa Ben Jamaa
>


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

Re: [Tinyos-help] Porting c code with nc one

2011-09-10 Thread Michael Schippling
I don't know of any micro-controller that has floating point
hardware support. Are there such? The telosb MSP chip doesn't
even have int multiply or divide instructions. The mica Atmega
has an 8-bit multiply but no divide.

With you, I always recommend fixed-point math.

MS

Sergio Valcarcel wrote:
> Hi Malissa,
> 
> Depending on the platform you are using, your CPU may accept  float or 
> even double numbers. Also, depending on the architecture float 
> computations might be accelerated with dedicated hardware or not. 
> So the main points you have to verify is whether the extensively use of 
> float operations will decrease the overall performance of your system. 
> Of course, it is not the same to compute a numerical integration than to 
> average two numbers... 
> 
> Another main point is the memory footprint. Float numbers typically 
> could use 4 bytes. So you must take care of how much available RAM you 
> have for your application.
> 
> A final concern is that you can not use network data types (i.e. 
> nx_struct) for communications since there is not defined a nx_float type.
> 
> The other option, instead of using floats, could be to convert to 
> integer, scaling as many decimals you want. For instance, 165.32 could 
> be converted to 16532 (remembering that it is multiplied by 1e2).
> 
> I hope it helps!
> Sergio
> 
> 
> On Sat, Sep 10, 2011 at 10:30 AM, Maissa Ben Jamaa 
> mailto:maisa.benja...@gmail.com>> wrote:
> 
> Hello sir,
> 
> Please can I ask you a question: does using float number in a nc
> code for real compilation matter?
> 
> Thank you
> 
> Best regards,
> Maissa Ben Jamaa
> 
> 
> 2011/9/9 Maissa Ben Jamaa  >
> 
> Hello sir,
> 
> I am very thankful for your answer, I tried to do something
> similar to blip code but I got the following error:
> gcc: cannot specify -o with -c or -S and multiple languages.
> Noting that I am now testing my code with Tossim.
> 
> Best regards,
> Maissa Ben Jamaa
> 
> 
> 2011/9/8 Sergio Valcarcel  >
> 
> Dear Maissa,
> 
> Please, check this thread:
> 
> http://www.mail-archive.com/tinyos-help@millennium.berkeley.edu/msg36375.html
> 
> It is pretty straight forward, but do not hesitate to mail
> me if you need further help.
> 
> Cheers!
> Sergio
> 
> 
> On Thu, Sep 8, 2011 at 5:12 PM, Maissa Ben Jamaa
> mailto:maisa.benja...@gmail.com>>
> wrote:
> 
> Hello sir,
> 
> I saw your interaction in tinyos help about porting c
> code with nc code.
> here is the
> link: 
> http://www.mail-archive.com/tinyos-help@millennium.berkeley.edu/msg38966.html
> 
> Please can you tell me the steps to follow in order to
> make this porting.
> 
> Thanks.
> 
> Best ragards,
> Maissa Ben Jamaa
> 
> 
> 
> 
> 
> 
> 
> 
> ___
> 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


Re: [Tinyos-help] Porting c code with nc one

2011-09-10 Thread Eric Decker
nx_float was added sometime in 2008.
http://mail.millennium.berkeley.edu/pipermail/tinyos-devel/2008-September/003431.html

But
you should follow Michael's advise.  The performance of integer math will be
significantly better.  Floating point is very expensive in terms of code
space and execution time on the msp430.

On Sat, Sep 10, 2011 at 7:21 AM, Sergio Valcarcel wrote:

> Hi Malissa,
>
> Depending on the platform you are using, your CPU may accept  float or even
> double numbers. Also, depending on the architecture float computations might
> be accelerated with dedicated hardware or not.
> So the main points you have to verify is whether the extensively use of
> float operations will decrease the overall performance of your system. Of
> course, it is not the same to compute a numerical integration than to
> average two numbers...
>
> Another main point is the memory footprint. Float numbers typically could
> use 4 bytes. So you must take care of how much available RAM you have for
> your application.
>
> A final concern is that you can not use network data types (i.e. nx_struct)
> for communications since there is not defined a nx_float type.
>
> The other option, instead of using floats, could be to convert to integer,
> scaling as many decimals you want. For instance, 165.32 could be converted
> to 16532 (remembering that it is multiplied by 1e2).
>
> I hope it helps!
> Sergio
>
>
> On Sat, Sep 10, 2011 at 10:30 AM, Maissa Ben Jamaa <
> maisa.benja...@gmail.com> wrote:
>
>> Hello sir,
>>
>> Please can I ask you a question: does using float number in a nc code for
>> real compilation matter?
>>
>> Thank you
>>
>> Best regards,
>> Maissa Ben Jamaa
>>
>>
>> 2011/9/9 Maissa Ben Jamaa 
>>
>>> Hello sir,
>>>
>>> I am very thankful for your answer, I tried to do something similar to
>>> blip code but I got the following error:
>>> gcc: cannot specify -o with -c or -S and multiple languages.
>>> Noting that I am now testing my code with Tossim.
>>>
>>> Best regards,
>>> Maissa Ben Jamaa
>>>
>>>
>>> 2011/9/8 Sergio Valcarcel 
>>>
 Dear Maissa,

 Please, check this thread:

 http://www.mail-archive.com/tinyos-help@millennium.berkeley.edu/msg36375.html

 It is pretty straight forward, but do not hesitate to mail me if you
 need further help.

 Cheers!
 Sergio


 On Thu, Sep 8, 2011 at 5:12 PM, Maissa Ben Jamaa <
 maisa.benja...@gmail.com> wrote:

> Hello sir,
>
> I saw your interaction in tinyos help about porting c code with nc
> code.
> here is the link:
> http://www.mail-archive.com/tinyos-help@millennium.berkeley.edu/msg38966.html
>
> Please can you tell me the steps to follow in order to make this
> porting.
>
> Thanks.
>
> Best ragards,
> Maissa Ben Jamaa
>


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



-- 
Eric B. Decker
Senior (over 50 :-) Researcher
___
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help