[Top][All Lists]

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

Re: [avr-gcc-list] swap bits

From: Klaus Rudolph
Subject: Re: [avr-gcc-list] swap bits
Date: Tue, 21 Jan 2003 18:39:29 +0100

Volkmar Dierkes wrote:
I have another, but not really a good idea...perhaps :-)

> What do you mean with efficiently? bytes or time?
or IO-Pins?

Make port A output and port B input. Make a wirering
port A[0]->portB[7] ....
You need only two bytes flash for program + initialisation 
and waste no registers :-)

init:   ldi r16, 0xff
        out ddra, r16

        out porta, r16
        in r16, portb

4 words flash, and 4 cycles access time.
Thats really effectiv!

avr-gcc-list at http://avr1.org

reply via email to

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