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

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

Re: [avr-gcc-list] swap bits


From: Kang Tin LAI
Subject: Re: [avr-gcc-list] swap bits
Date: Thu, 23 Jan 2003 00:19:40 +0800
User-agent: Mozilla/5.0 (X11; U; Linux i586; en-US; rv:0.9.4.1) Gecko/20020508 Netscape6/6.2.3

May reduce the hardware port pin by using 4-bit nibble connection:
PA0 - PA7
PA1 - PA6
PA2 - PA5
PA3 - PA4
with few additional instructions to combine nibbles back to byte.

--
---
Kang Tin LAI <address@hidden>
-----

Klaus Rudolph wrote:

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

reverse_r16:
        out porta, r16
        in r16, portb

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

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





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



reply via email to

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