Re: [avr-gcc-list] How to (efficeiently !!!) test a bit within amulti-by
Martijn van Balen
Re: [avr-gcc-list] How to (efficeiently !!!) test a bit within amulti-byte integer ?
Fri, 4 Nov 2005 16:34:29 +0100
I just remembered something that might be of use.
This is a quote from your first message:
>I just ran into a weird problem that I hardly
>I wrote a trivial routine that takes a 32bit unsigned int, which holds
>memory address, and shifts the lower 19 bits, out to a port pin (this
>feeds cascaded shift registers, that in turn drive the 19 address lines
>of a memory chip).
For a long time I always put address bit 0 on address
pin A0 of the memory, bit 1 on A1, etc. But this is not always needed! Especially
for a RAM device where you the AVR is the only one having access,
the address lines can be swapped as you like. The same holds for the
data lines. For ROM memory I have use this as well to enable better PCB routing
and just swapped the contents before flashing.
In your case if your reverse the order of A0-A18 to
A18-A0, you could start with outputting bit 0. I'm not sure if this results in
smaller/faster code in your case, but I found it a nice extra design parameter I could