
Open information
DESCRIPTION
9 (69)
Uppgjord (även faktaansvarig om annan) -
Prepared (also subject responsible if other)
Nr
-
No.
KL/ECS/SMK Magnus Lindahl
MRS3000 Programmers reference manual
Dokansv/Godk -
Doc respons/Approved
Kontr
-
Checked
Datum
-
Date
Rev
File
KL/ECS/S/MK
1997-04-16 A
LZB 119 1661
PROG.DOC
TIMER CONCEPT, USED BY ALL TIMERS
All timers have two timebases (can't be modified), one low and one high.
The most significant bit of the timer value is used to determine which timebase is to be used. If the most
significant bit of the timer value is cleared, the low timebase is used, if it is set the high timebase is
used.
The timers, except the tone receiver and transmitter timers, have a range of [0..127] times the chosen
timebase.
The tone receiver and transmitter timers have a range of [0..2500] ms.
The resolution of the timers is +/- timebase.
The internally used timer resolution is 250
µ
s, thus a timebase which is lower than this (for programming
convenience) results in rounding the calculated time to nearest 250
µ
s.
The accuracy of the timers is
±
250
µ
s, independent of timebase.
To calculate what to put in the byte:
a)
Divide wanted time by low timebase (usually 1 ms)
b)
If value is less than 128, use it as it is,
c)
Otherwise divide wanted time by high timebase.
Use the divided value, which must NOT exceed 127, + 80h
(To indicate that the high timebase is used).
Example 1:
Wanted time 70 ms, timebase = 1 ms/10 ms.
70/1 = 70, the value 70 is less than 128:
use 70 = 46h.
Example 2:
Wanted time 45s, timebase = 100 ms/1 s.
45000/100 = 450, which is greater than 127:
use 45 + 128 = 2Dh + 80h = ADh.
Example 3:
Wanted time 1.2s, timebase = 1 ms/10 ms.
1200/1 = 1200 which is greater than 127:
use 1200/10 + 128 = 120 + 128 = 78h + 80h = F8h.
(Which is close to maximum time with this timebase)
Example 4:
Wanted time 400 us, timebase = 100
µ
s/1 ms.
400/100 = 4, which is less than 128, use 4 = 04h.
But internally used resolution is 250
µ
s, so in reality the time will be set to 500
µ
s.
Содержание MRS3000
Страница 143: ......
Страница 144: ......
Страница 145: ......
Страница 146: ......
Страница 147: ......
Страница 148: ......
Страница 149: ......
Страница 150: ......
Страница 151: ......
Страница 152: ......
Страница 153: ......
Страница 154: ......
Страница 155: ......
Страница 156: ......
Страница 157: ......
Страница 159: ......