Suggestions for programming A/D data logger to SD card

Using ADC, DMA, event system in Xmega

bgoolsby
 
Avatar
 
Betreff:

Suggestions for programming A/D data logger to SD card

 · 
Gepostet: 15.07.2013 - 16:47 Uhr  ·  #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
Geschlecht:
Herkunft: Germany
Alter: 26
Homepage: e-lab.de
Beiträge: 5558
Dabei seit: 03 / 2002
Betreff:

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

 · 
Gepostet: 15.07.2013 - 18:15 Uhr  ·  #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
Geschlecht:
Herkunft: Belgrade, Serbia
Alter: 54
Homepage: rs.linkedin.com/in…
Beiträge: 653
Dabei seit: 07 / 2002
Betreff:

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

 · 
Gepostet: 15.07.2013 - 22:55 Uhr  ·  #3
bgoolsby
 
Avatar
 
Betreff:

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

 · 
Gepostet: 15.07.2013 - 23:46 Uhr  ·  #4
Gewählte Zitate für Mehrfachzitierung:   0

Registrierte in diesem Topic

Aktuell kein registrierter in diesem Bereich

Die Statistik zeigt, wer in den letzten 5 Minuten online war. Erneuerung alle 90 Sekunden.
MySQL Queries: 8 · Cache Hits: 14   76   90 · Page-Gen-Time: 0.012962s · Speichernutzung: 2 MB · GZIP: ein · Viewport: SMXL-HiDPI