|
Hi. The answer is: yes, with limitations. Since a floating value uses 4 bytes, and your collecting 600 samples from each of eight channels, you will need to store 19,200 bytes. There isn't enough storage for all this on the Atom40. However, you could use an offboard EEPROM, like the AT25256-10PC-2.7. This will hold 32kbytes of data. It talks to the processor using SPI, which can be done on the Atom using the SHIFTIN/SHIFTOUT commands. Read the manual on this, I believe they give an example.
As for averaging: collect the 600 samples, add them all up and divide the result by 600. Simple. Yes? No? You could keep a running average and use an array to track trends. This may save you from having to store all 600 samples. Create a variable to store the average, say, Avg_Var. Collect the first sample and store it in Avg_Var. After this, you collect a sample, add it to Avg_Var, divide by two, and store the result back to Avg_Var. At certain set points, say every 50th sample, you store the latest Avg_Var to an array, maybe storing the first sample as array(0), giving you a starting point for the trends. At the end you have 13 values in the array: the first, #1 (array(0)), sample# 50 (array(1)), number 100 (array(2)), etc., up to the last sample, number 600 (array(12). If the array is all you keep, you no longer need large storage, so can stay inside the Atom40 and leave off the EEPROM. If you MUST have all 600 samples, you need the EEPROM. The Atom40's internal EEPROM now determines the array size, thus the number of samples you can keep for later comparison.
So, it can be done, but you're limited by the available storage on the Atom40.
Later! kenjj
|