Xmega 128A1 Timer

OP #1224325
Lesenswert?

Ich möchte gern kontinuierlich die länge eines Externen Taktes im 
Hintergrund messen und das Ergebnis in per DMA in den RAM schreiben.
Das Blöde ist das der Timer bei Compare nicht zurückgesetzt wird und 
fröhlich weiterzählt. Wie gesagt ich wollte das ohne Interrupts und nur 
mit Events und DMA machen.
OP #1224550
Lesenswert?

Timer F1

Initialisiert ist er so:

         ldi temp,TC_CLKSEL_DIV1_gc
  sts TCF1_CTRLA,temp
  ldi temp, 0x10
  sts TCF1_CTRLB,temp
  ldi temp, 0x2A;
  sts TCF1_CTRLD,temp

  ldi temp,low(TCF1_CCA)
  sts DMA_CH2_SRCADDR0,temp  // Channel Source Address 0
  ldi temp,high(TCF1_CCA);
  sts DMA_CH2_SRCADDR1,temp   // Channel Source Address 1
  ldi temp,0x00
  sts DMA_CH2_SRCADDR2,temp   // Channel Source Address 2

  ldi temp,low(VorzeitL_G)
  sts DMA_CH2_DESTADDR0,temp  // Channel Destination Address 0
  ldi temp,high(VorzeitL_G)
  sts DMA_CH2_DESTADDR1,temp  // Channel Destination Address 1
  ldi temp,0x00
  sts DMA_CH2_DESTADDR2,temp  // Channel Destination Address 1

  ldi temp,0x55
  sts DMA_CH2_ADDRCTRL,temp
  ldi temp,0xA8
  sts DMA_CH2_TRIGSRC,temp
  ldi temp,0x02
  sts DMA_CH2_TRFCNT,temp
  ldi temp,0x00
  sts DMA_CH2_TRFCNT+1,temp


Mfg
René

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren