Multi-channel datalogger / data organization

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello all,

I'm looking for advice on program structure. I'm working on an automotive project than includes quite a few different functions. As a result, there are many pieces of data I would like to be able to record, and they all come from different sub programs.

For example:
I have 6 ADC channels operating. Each channel has three pieces of data with it: the raw ADC value, the voltage, and the converted sensor data (there is a different type of sensor on each channel).

There are some process control functions going on with the sensor data as well. I would like to be able to log the output for these functions as well.

My question is this:
How should I arrange the data so it is easily accessible to the data logging program? I need to be able to tell the data logger I want to log certain items, and exclude others. Right now I'm considering using a large table of pointers in flash, each pointer to a specific item. I can then reference each item by its array index in the table when I tell the datalogger what I want to record.

Does anyone else have experience with this sort of thing, and how did you solve it?

For those who are interested, the app will be running on a 1281, with over 90% of the SRAM available for datalogging memory, so extremely conservative SRAM usage is not a requirement. Flash memory space is also not a concern.

Thanks in advance!

JeremyB.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You could include a SD memory card socket on the board connected to the SPI bus of the ATmege1281. Then, integrate one of the free DOS FAT16 file system modules into your system. Create a separate file to log data to from each one of the sensors. Create a new set of files each time the automobile is started so that you have separate file sets for each run and you also reduce the data loss if a file should become corrupted for some reason. When you are ready to analyze the data, pull the SD memory card out and plug it into your PC and work with the data files. You may need something like a USB to SD memory card adapter (usually $10-$20.)

Check out www.pumpkininc.com. They got started by developing a similar device. They developed a tiny RTOS and then built their data logging application around it. They then re-wrote the RTOS in C and now make it available for a variety of uC's as Salvo RTOS. I am using Salvo (on ATmega128) along with an approach similar to what I outlined above in my commercial 4-channel data logger. So far, so good.

Of course, they're are as many approaches to designing such a device as there are members of this forum! Do some searching in the forum, projects, etc. Take what works for your specific application and run with it. Good luck!

Tom