Suggestions for programming A/D data logger to SD card

Using ADC, DMA, event system in Xmega

bgoolsby
 
Avatar
 
Subject:

Suggestions for programming A/D data logger to SD card

 · 
Posted: 15.07.2013 - 16:47  ·  #1
I need to create a data logger using an Xmega chip. It will be a small battery powered device to sample 4 channels of muscle EMG and record to an SD card. 4 channels * 1000 samples/second = 4000 words/sec = 8000 bytes/second. I want to use the FAT16 file system so I can remove the SD card and read it in a Windows computer.

Questions:
1) It seems the E-Lab compiler only supports GetADC(), which doesn't use interrupts or DMA, therefore I wonder if this will be fast enough for this application? I am also concerned that the GetADC sampling might not occur exactly every millisecond.

2) I think a better way to sample is to set up the Xmega event system, DMA, and A/D to trigger a scan of the 4 channels every millisecond. The DMA would send the samples to a RAM buffer; when the buffer fills I will write it to the SD card. If the DMA supports it, I would use two buffers in a ping-pong fashion so I can write one while the other fills.

Has anyone created similar code that sets up the event system, DMA, and A/D?
rh
Administrator
Avatar
Gender:
Location: Germany
Age: 24
Homepage: e-lab.de
Posts: 5558
Registered: 03 / 2002
Subject:

Re: Suggestions for programming A/D data logger to SD card

 · 
Posted: 15.07.2013 - 18:15  ·  #2
Hello Bill,

with 1msec AD ticks you need much computing power, so a 32..60MHz XMega is mandatory.
I don't have any experiences with the XMega DMA, but I think it can be useful.
Of course the GetADC of the system is not applicable here so a timer tick with 1msec can
do the job, eventually with the help of the DMA and, of course, double buffering.

rolf
Avra
Schreiberling
Avatar
Gender:
Location: Belgrade, Serbia
Age: 53
Homepage: rs.linkedin.com/in…
Posts: 653
Registered: 07 / 2002
Subject:

Re: Suggestions for programming A/D data logger to SD card

 · 
Posted: 15.07.2013 - 22:55  ·  #3
bgoolsby
 
Avatar
 
Subject:

Re: Suggestions for programming A/D data logger to SD card

 · 
Posted: 15.07.2013 - 23:46  ·  #4
Selected quotes for multi-quoting:   0

Registered users in this topic

Currently no registered users in this section

The statistic shows who was online during the last 5 minutes. Updated every 90 seconds.
MySQL Queries: 14 · Cache Hits: 14   75   89 · Page-Gen-Time: 0.017159s · Memory Usage: 2 MB · GZIP: on · Viewport: SMXL-HiDPI