Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: [AVR-Chat] Array of Long

2009-03-06 by David VanHorn

On Fri, Mar 6, 2009 at 11:35 AM, Raymond Hurst <rhurst2@cox.net> wrote:
> You need to do something similar to this:

That's what I ended up with.
Even more fun, because I dispensed entirely with the output buffer,
and stuffed it into the T0 interrupt with almost everything else.

Processing the arrays is still taking more time than I'd like but I
cheated, processing the "A" array, then starting to send the bytes of
A while processing the B array.

    while (!(UCSRA & (1<< UDRE))) {};
UDR = (c >> 16);
//Debug_DDR	|= (1 << Debug_Pin);	// Output
//Debug_Port	|= (1 << Debug_Pin);	// High	
d = 0;
d = (d + pgm_read_word_near(Log_Table + Histogram_B[0]));
d = (d + pgm_read_word_near(Log_Table + Histogram_B[1]));
d = (d + pgm_read_word_near(Log_Table + Histogram_B[2]));
d = (d + pgm_read_word_near(Log_Table + Histogram_B[3]));
d = (d + pgm_read_word_near(Log_Table + Histogram_B[4]));
d = (d + pgm_read_word_near(Log_Table + Histogram_B[5]));
d = (d + pgm_read_word_near(Log_Table + Histogram_B[6]));
d = (d + pgm_read_word_near(Log_Table + Histogram_B[7]));
d = (d + pgm_read_word_near(Log_Table + Histogram_B[8]));
d = (d + pgm_read_word_near(Log_Table + Histogram_B[9]));
d = (d + pgm_read_word_near(Log_Table + Histogram_B[10]));
//Debug_Port &= ~(1 << Debug_Pin);			// Low

d is a long that stores the B array.
I might not need a long either, I may be able to prove that the ouput
will always fit in a word.

I'm processing nearly a seconds worth of 16 bit data from two sensors,
every millisecond.
:)

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.