0
|
1 ; OSTC - diving computer code
|
|
2 ; Copyright (C) 2008 HeinrichsWeikamp GbR
|
|
3 ; This program is free software: you can redistribute it and/or modify
|
|
4 ; it under the terms of the GNU General Public License as published by
|
|
5 ; the Free Software Foundation, either version 3 of the License, or
|
|
6 ; (at your option) any later version.
|
|
7 ; This program is distributed in the hope that it will be useful,
|
|
8 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
9 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
10 ; GNU General Public License for more details.
|
|
11 ; You should have received a copy of the GNU General Public License
|
|
12 ; along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
13 ; Wait routines
|
|
14 ; written by: chsw, info@heinrichsweikamp.com
|
|
15 ; written: 01/31/04
|
|
16 ; last updated: 11/05/07
|
|
17 ; known bugs:
|
|
18 ; ToDo:
|
|
19
|
|
20 ; ==========================================================
|
|
21 ; WAIT 10 MICROSECONDS - 16 MHZ
|
|
22 ; ==========================================================
|
|
23 WAIT10US macro wait_temp
|
|
24 movlw wait_temp
|
|
25 call WAIT10USX
|
|
26 endm
|
|
27
|
|
28 WAIT10USX movwf wait_temp
|
|
29 goto JumpIn10us
|
|
30 WAIT10USX2 nop
|
|
31 nop
|
|
32 nop
|
|
33 nop
|
|
34 nop
|
|
35 nop
|
|
36 nop
|
|
37 nop
|
470
|
38 JumpIn10us:
|
0
|
39 nop
|
|
40 nop
|
|
41 nop
|
|
42 nop
|
|
43 nop
|
|
44 nop
|
|
45 nop
|
|
46 nop
|
|
47 nop
|
|
48 nop
|
|
49 nop
|
|
50 nop
|
|
51 nop
|
|
52 nop
|
|
53 nop
|
|
54 nop
|
|
55 nop
|
|
56 nop
|
|
57 nop
|
|
58 nop
|
|
59 nop
|
|
60 nop
|
|
61 nop
|
|
62 nop
|
|
63 nop
|
|
64 nop
|
|
65 nop
|
|
66 nop
|
|
67 nop
|
|
68 decfsz wait_temp,1
|
|
69 goto WAIT10USX2
|
|
70 return
|
|
71 ; ==========================================================
|
|
72 ; WAIT 1 MILLISECOND - 16 MHZ
|
|
73 ; ==========================================================
|
|
74 WAITMS macro waitms_temp
|
|
75 movlw waitms_temp
|
|
76 call WAITMSX
|
|
77 endm
|
|
78 WAITMSX movwf waitms_temp
|
|
79 goto JumpInMSX
|
|
80 WAITMSX2 nop
|
|
81 nop
|
|
82 nop
|
|
83 nop
|
|
84 nop
|
|
85 nop
|
|
86 nop
|
|
87 nop
|
470
|
88 JumpInMSX:
|
0
|
89 nop
|
|
90 nop
|
|
91 nop
|
|
92 nop
|
|
93 nop
|
|
94 nop
|
|
95 nop
|
|
96 nop
|
|
97 nop
|
|
98 nop
|
|
99 nop
|
|
100 nop
|
|
101 nop
|
|
102 nop
|
|
103 nop
|
|
104 nop
|
|
105 nop
|
|
106 nop
|
|
107 nop
|
|
108 nop
|
|
109 nop
|
|
110 nop
|
|
111 nop
|
|
112 nop
|
|
113 nop
|
|
114 nop
|
|
115 nop
|
|
116 nop
|
|
117 nop
|
|
118 nop
|
|
119 WAIT10US d'99'
|
|
120 decfsz waitms_temp,1
|
|
121 goto WAITMSX2
|
|
122 return |