Hi Ken,
Im a C user myself, so I can only think of 3 possible answers. . .
1. Try using a higher clock speed.
2. if you had :
mydata[0] = PIND;
mydata[1] = PIND;
mydata[2] = PIND;
.
.
.
mydata[255] = PIND;
all written out the hard way like that, it would be slightly faster,
because the "for" loop condition would not be checked every time, it
would of course occupy much more code space, and be considered
terrible programming.
I dont believe that assembler can do it much faster than option 2 tho.
3. Look around and see if there are any flash memory ICs that have 8
bit parallel data in, and a line that only need to be clocked to save
that data to the next address in memory, then read it out at your
leasure. (Dont personally know of any IC like this, maybe someone else
has used something like this ?)
Cheers
Hein B
Auckland, New Zealand.
--- In AVR-Chat@yahoogroups.com, "thekenhunt" <kenhunt@...> wrote:
>
> I have an application which needs to store 256 bytes of data. My
> current (C) solution is way too slow. Could anyone point me to the
> fastest way to go about reading a fixe number of bytes into an
> array/memory location using assembler? ie how can I replace the loop
> below most efficiently.
>
> char mydata[256];
> void myloop()
> {
> for(d=256;d;d--) mydata[d]=PIND;
> }
>
> many thanks
>
> Ken
>Message
Re: Help needed:- what's the quickest way to store 256 bytes of data?
2006-02-13 by kernels_nz
Attachments
- No local attachments were found for this message.