avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Using hardware multiplier on ATmega128L


From: David Gay
Subject: Re: [avr-gcc-list] Using hardware multiplier on ATmega128L
Date: Fri, 22 Oct 2004 09:05:42 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040124

Alessio Mattÿffffe8 wrote:
Hi all,
I'm working with "Wireless Sensor Networks" using the platform Crossbow MICA2 (www.xbow.com) + TinyOS (www.tinyos.net) In particular, inside the MICA2 sensor node there is an ATMEL Atmega128L microcontroller .... I want to use the hardware multiplier located inside Atmega128L microcontroller to improve the performances of my FFT algorithm under MICA2.
In particular I have this kind of instruction on my NeSC program (NeSC is a 
"dialect" of C language ...):
Wr = ((int32_t)c * (int32_t)real[k+n1] - (int32_t)s * (int32_t)imag[k+n1]) >> 15; where Wr,c,real[k+n1],s and imag[k+n1] are declared as int16_t variables. The problem is that the computation time of above multiply is very high ... and therefore (if possible !!!) I want to improve the performances ... On Internet I discover this document (http://www.atmel.com/dyn/resources/prod_documents/DOC1631.PDF) which describes the use of the hardware multiplier on AVR Microcontroller: the problem is that the 16-bit x 16-bit =32 bit operation is written using Assembly code, so I have to use Inline Asm inside my program and I have never used it before.

Good and bad news. The code you've written is already using the hardware multiply... (avr-gcc's 32-bit multiply routine for atmega128 uses the hardware multiply).

David Gay


reply via email to

[Prev in Thread] Current Thread [Next in Thread]