annotate code_part1/OSTC_code_asm_part1/wait.asm @ 485:e83f883c96b2

quick fix for wrong wait routines
author heinrichsweikamp
date Sat, 15 Oct 2011 13:45:15 +0200
parents 42acd9316f7a
children c7b663939737
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1 ; OSTC - diving computer code
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
2 ; Copyright (C) 2008 HeinrichsWeikamp GbR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
3 ; This program is free software: you can redistribute it and/or modify
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
4 ; it under the terms of the GNU General Public License as published by
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
5 ; the Free Software Foundation, either version 3 of the License, or
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
6 ; (at your option) any later version.
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
7 ; This program is distributed in the hope that it will be useful,
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
8 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
9 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
10 ; GNU General Public License for more details.
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
11 ; You should have received a copy of the GNU General Public License
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
12 ; along with this program. If not, see <http://www.gnu.org/licenses/>.
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
13 ; Wait routines
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
14 ; written by: chsw, info@heinrichsweikamp.com
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
15 ; written: 01/31/04
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
16 ; last updated: 11/05/07
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
17 ; known bugs:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
18 ; ToDo:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
19
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
20 ; ==========================================================
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
21 ; WAIT 10 MICROSECONDS - 16 MHZ
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
22 ; ==========================================================
485
e83f883c96b2 quick fix for wrong wait routines
heinrichsweikamp
parents: 470
diff changeset
23
e83f883c96b2 quick fix for wrong wait routines
heinrichsweikamp
parents: 470
diff changeset
24 IFDEF SPEED_16MHz
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
25 WAIT10US macro wait_temp
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
26 movlw wait_temp
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
27 call WAIT10USX
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
28 endm
485
e83f883c96b2 quick fix for wrong wait routines
heinrichsweikamp
parents: 470
diff changeset
29 ENDIF
e83f883c96b2 quick fix for wrong wait routines
heinrichsweikamp
parents: 470
diff changeset
30
e83f883c96b2 quick fix for wrong wait routines
heinrichsweikamp
parents: 470
diff changeset
31 IFDEF SPEED_32MHz
e83f883c96b2 quick fix for wrong wait routines
heinrichsweikamp
parents: 470
diff changeset
32 WAIT10US macro wait_temp
e83f883c96b2 quick fix for wrong wait routines
heinrichsweikamp
parents: 470
diff changeset
33 movlw wait_temp
e83f883c96b2 quick fix for wrong wait routines
heinrichsweikamp
parents: 470
diff changeset
34 call WAIT10USX
e83f883c96b2 quick fix for wrong wait routines
heinrichsweikamp
parents: 470
diff changeset
35 movlw wait_temp
e83f883c96b2 quick fix for wrong wait routines
heinrichsweikamp
parents: 470
diff changeset
36 call WAIT10USX
e83f883c96b2 quick fix for wrong wait routines
heinrichsweikamp
parents: 470
diff changeset
37 endm
e83f883c96b2 quick fix for wrong wait routines
heinrichsweikamp
parents: 470
diff changeset
38 ENDIF
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
39
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
40 WAIT10USX movwf wait_temp
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
41 goto JumpIn10us
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
42 WAIT10USX2 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
43 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
44 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
45 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
46 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
47 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
48 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
49 nop
470
42acd9316f7a fine-tune waits for 16MHz
heinrichsweikamp
parents: 0
diff changeset
50 JumpIn10us:
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
51 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
52 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
53 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
54 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
55 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
56 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
57 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
58 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
59 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
60 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
61 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
62 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
63 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
64 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
65 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
66 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
67 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
68 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
69 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
70 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
71 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
72 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
73 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
74 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
75 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
76 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
77 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
78 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
79 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
80 decfsz wait_temp,1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
81 goto WAIT10USX2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
82 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
83 ; ==========================================================
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
84 ; WAIT 1 MILLISECOND - 16 MHZ
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
85 ; ==========================================================
485
e83f883c96b2 quick fix for wrong wait routines
heinrichsweikamp
parents: 470
diff changeset
86 IFDEF SPEED_16MHz
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
87 WAITMS macro waitms_temp
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
88 movlw waitms_temp
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
89 call WAITMSX
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
90 endm
485
e83f883c96b2 quick fix for wrong wait routines
heinrichsweikamp
parents: 470
diff changeset
91 ENDIF
e83f883c96b2 quick fix for wrong wait routines
heinrichsweikamp
parents: 470
diff changeset
92
e83f883c96b2 quick fix for wrong wait routines
heinrichsweikamp
parents: 470
diff changeset
93 IFDEF SPEED_32MHz
e83f883c96b2 quick fix for wrong wait routines
heinrichsweikamp
parents: 470
diff changeset
94 WAITMS macro waitms_temp
e83f883c96b2 quick fix for wrong wait routines
heinrichsweikamp
parents: 470
diff changeset
95 movlw waitms_temp
e83f883c96b2 quick fix for wrong wait routines
heinrichsweikamp
parents: 470
diff changeset
96 call WAITMSX
e83f883c96b2 quick fix for wrong wait routines
heinrichsweikamp
parents: 470
diff changeset
97 movlw waitms_temp
e83f883c96b2 quick fix for wrong wait routines
heinrichsweikamp
parents: 470
diff changeset
98 call WAITMSX
e83f883c96b2 quick fix for wrong wait routines
heinrichsweikamp
parents: 470
diff changeset
99 endm
e83f883c96b2 quick fix for wrong wait routines
heinrichsweikamp
parents: 470
diff changeset
100 ENDIF
e83f883c96b2 quick fix for wrong wait routines
heinrichsweikamp
parents: 470
diff changeset
101
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
102 WAITMSX movwf waitms_temp
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
103 goto JumpInMSX
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
104 WAITMSX2 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
105 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
106 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
107 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
108 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
109 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
110 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
111 nop
470
42acd9316f7a fine-tune waits for 16MHz
heinrichsweikamp
parents: 0
diff changeset
112 JumpInMSX:
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
113 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
114 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
115 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
116 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
117 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
118 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
119 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
120 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
121 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
122 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
123 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
124 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
125 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
126 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
127 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
128 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
129 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
130 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
131 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
132 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
133 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
134 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
135 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
136 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
137 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
138 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
139 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
140 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
141 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
142 nop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
143 WAIT10US d'99'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
144 decfsz waitms_temp,1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
145 goto WAITMSX2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
146 return