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 ; ==========================================================
|
485
|
23
|
|
24 IFDEF SPEED_16MHz
|
0
|
25 WAIT10US macro wait_temp
|
|
26 movlw wait_temp
|
|
27 call WAIT10USX
|
|
28 endm
|
485
|
29 ENDIF
|
|
30
|
|
31 IFDEF SPEED_32MHz
|
|
32 WAIT10US macro wait_temp
|
|
33 movlw wait_temp
|
|
34 call WAIT10USX
|
|
35 movlw wait_temp
|
|
36 call WAIT10USX
|
|
37 endm
|
|
38 ENDIF
|
0
|
39
|
|
40 WAIT10USX movwf wait_temp
|
|
41 goto JumpIn10us
|
|
42 WAIT10USX2 nop
|
|
43 nop
|
|
44 nop
|
|
45 nop
|
|
46 nop
|
|
47 nop
|
|
48 nop
|
|
49 nop
|
470
|
50 JumpIn10us:
|
0
|
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 nop
|
|
69 nop
|
|
70 nop
|
|
71 nop
|
|
72 nop
|
|
73 nop
|
|
74 nop
|
|
75 nop
|
|
76 nop
|
|
77 nop
|
|
78 nop
|
|
79 nop
|
|
80 decfsz wait_temp,1
|
|
81 goto WAIT10USX2
|
|
82 return
|
|
83 ; ==========================================================
|
|
84 ; WAIT 1 MILLISECOND - 16 MHZ
|
|
85 ; ==========================================================
|
485
|
86 IFDEF SPEED_16MHz
|
0
|
87 WAITMS macro waitms_temp
|
|
88 movlw waitms_temp
|
|
89 call WAITMSX
|
|
90 endm
|
485
|
91 ENDIF
|
|
92
|
|
93 IFDEF SPEED_32MHz
|
|
94 WAITMS macro waitms_temp
|
|
95 movlw waitms_temp
|
|
96 call WAITMSX
|
|
97 movlw waitms_temp
|
|
98 call WAITMSX
|
|
99 endm
|
|
100 ENDIF
|
|
101
|
0
|
102 WAITMSX movwf waitms_temp
|
|
103 goto JumpInMSX
|
|
104 WAITMSX2 nop
|
|
105 nop
|
|
106 nop
|
|
107 nop
|
|
108 nop
|
|
109 nop
|
|
110 nop
|
|
111 nop
|
470
|
112 JumpInMSX:
|
0
|
113 nop
|
|
114 nop
|
|
115 nop
|
|
116 nop
|
|
117 nop
|
|
118 nop
|
|
119 nop
|
|
120 nop
|
|
121 nop
|
|
122 nop
|
|
123 nop
|
|
124 nop
|
|
125 nop
|
|
126 nop
|
|
127 nop
|
|
128 nop
|
|
129 nop
|
|
130 nop
|
|
131 nop
|
|
132 nop
|
|
133 nop
|
|
134 nop
|
|
135 nop
|
|
136 nop
|
|
137 nop
|
|
138 nop
|
|
139 nop
|
|
140 nop
|
|
141 nop
|
|
142 nop
|
|
143 WAIT10US d'99'
|
|
144 decfsz waitms_temp,1
|
|
145 goto WAITMSX2
|
|
146 return |