28.11.2012 Views

Table of Contents - TG Drives

Table of Contents - TG Drives

Table of Contents - TG Drives

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

EXTENDED REGISTER GROUPS<br />

TMR, SYSTEM TIMERS<br />

Group Group<br />

No<br />

Description<br />

Tmr 8 System timers for timekeeping, etc.<br />

GENERAL<br />

Tmr, System timers<br />

The timer system is based on the cycle time <strong>of</strong> the DMC 2 s<strong>of</strong>tware. A crystal -<br />

controlled frequency (40 MHz) is divided down to a 1 kHz cycle using the CPU’s<br />

internal interrupt system. This 1 ms cycle time is then used for all timer functions.<br />

Due to crystal tolerances, 1 ms in one DMC 2 is not exactly the same as 1 ms in<br />

another DMC 2 . Time measurements must therefore be non-critical in application<br />

usage. To achieve simultaneous cycles in several DMC 2 ’s the 1 kHz clock can be<br />

synchronized between units.<br />

FUNCTION<br />

Tmr.Abs The timer system has one absolute measurement in the<br />

Tmr.Abs. This counter<br />

holds the number <strong>of</strong> cycles since the<br />

last power up (or reset). The timers are all 32 bit wide, except<br />

for the word wide Tmr.CycInt, which means that they will wrap<br />

around after 596.5 hours (24.9 days).<br />

Tmr.CycInt The Tmr.CycInt is intended<br />

to be used for generating a<br />

cyclical event (timer interrupt) within the application s<strong>of</strong>tware.<br />

The rest <strong>of</strong> the timers (Tmr.T0 through Tmr.T3) are free for<br />

application usage<br />

RELATED ITEMS<br />

Vector.CycInt System<br />

interrupt vector for timer interrupt.<br />

Int.SysMask<br />

Int.SysPend<br />

Ireturn sys 1 Return statement.<br />

EXAMPLE USAGE<br />

; Cyclical event<br />

CycEvent:<br />

Bit mask for system interrupts, bit 0 (bit value 1) enables the cyclical event.<br />

Bit mask for pending events, bit 0 (bit value 1) indicates the cyclical event.<br />

.<br />

Vector.CycInt , @CycEvent<br />

Tmr.CycInt , 100<br />

or Int.SysMask , 1<br />

.<br />

clr Tmr.T2<br />

wait Tmr.T2 > 186<br />

.<br />

Ireturn sys 1<br />

;pointer to service routine<br />

;100 ms event rate<br />

;enable the event<br />

;reset timer T2<br />

;wait here for 186 ms<br />

;return from event<br />

User's Manual 5.1 Inmotion Technologies AB<br />

Doc. No.9032 0027 01 (B), Rev. 11.07.2001<br />

93

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!