SysTick Abweichung

  • 1
  • 2
  • Page 2 of 2
pvs-deck
PowerUser
Avatar
Gender:
Age: 53
Homepage: pvs-deck.de
Posts: 1340
Registered: 02 / 2009
Subject:

Re: SysTick Abweichung

 · 
Posted: 28.03.2019 - 12:52  ·  #9
Quote by Merlin

You might want to take a look at my 'crude timers' with callbacks Crude timers. The code would need tweaking for your crystal, but the repetition would be very precise (not varying by much between successive callbacks). If you are using an oscillator accuracy would be poorer of course. Or maybe use OnSysTick?


Hello Merlin,
I take a look at your Crude Timers, thanks for the tip

Thorsten
golf
Benutzer
Avatar
Gender:
Location: Donauwörth
Age: 70
Posts: 250
Registered: 11 / 2009
Subject:

Re: SysTick Abweichung

 · 
Posted: 28.03.2019 - 17:18  ·  #10
Hallo Thorsten,
geht das nicht evtl besser mit einem normalen Timerinterrupt. Die 62 Mhz lassen allerdings keinen genauen Teilerwert zu. Aber der Takt des ATXmegas wird je eh nicht sehr genau sein.


interrupt TCD0_INTOVF; // counterzeit 1 sec
begin
SekBol := true; //
end;

// in der main

// Timer setzen für ca. 1 sec Overflow @62MHz
TCD0PERL:= $83; // PERL - Period Register L Bite 7..0
TCD0PERH:= $EC; // PERH - Period Register H 15..8
TCD0CTRLA:= $07; // 3..0 Clock.select Prescaler 03= Clk/4 04: clk/8 05: clk/64 06: clk/256 07 : clk/1024
TCD0INTCTRLA:= $02;

// mit TCD0CTRLA := $00; ist der Timer Off

in der loop:

if SekBol= true then
SekBol:= false;
.......
endif;

Golf
  • 1
  • 2
  • Page 2 of 2
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: 15 · Cache Hits: 14   51   65 · Page-Gen-Time: 0.017601s · Memory Usage: 2 MB · GZIP: on · Viewport: SMXL-HiDPI