-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLCD a Pedal 8BITS.lst
214 lines (210 loc) · 5.78 KB
/
LCD a Pedal 8BITS.lst
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
CCS PCM C Compiler, Version 5.008, 5967 17-mar.-18 16:05
Filename: C:\Users\LuisMiguel\Documents\GitHub\LCD-Paso-A-Paso\LCD a Pedal 8BITS.lst
ROM used: 130 words (2%)
Largest free fragment is 2048
RAM used: 5 (1%) at main() level
6 (2%) worst case
Stack used: 2 locations
Stack size: 8
*
0000: MOVLW 00
0001: MOVWF 0A
0002: GOTO 038
0003: NOP
.................... #include <16F887.h>
.................... //////// Standard Header file for the PIC16F887 device ////////////////
.................... #device PIC16F887
....................
.................... #list
....................
.................... #FUSES NOWDT, NOPUT, INTRC_IO, NOPROTECT, NOBROWNOUT, NOWRT
.................... #use delay (internal=8M)
0004: MOVLW 21
0005: MOVWF 04
0006: BCF 03.7
0007: MOVF 00,W
0008: BTFSC 03.2
0009: GOTO 017
000A: MOVLW 02
000B: MOVWF 78
000C: CLRF 77
000D: DECFSZ 77,F
000E: GOTO 00D
000F: DECFSZ 78,F
0010: GOTO 00C
0011: MOVLW 97
0012: MOVWF 77
0013: DECFSZ 77,F
0014: GOTO 013
0015: DECFSZ 00,F
0016: GOTO 00A
0017: RETURN
....................
.................... //Funcion pulso al pin E de la LCD
.................... void pulso(){
.................... output_high(pin_D1);
0018: BSF 03.5
0019: BCF 08.1
001A: BCF 03.5
001B: BSF 08.1
.................... delay_ms(100);
001C: MOVLW 64
001D: MOVWF 21
001E: CALL 004
....................
.................... output_low(pin_D1);
001F: BSF 03.5
0020: BCF 08.1
0021: BCF 03.5
0022: BCF 08.1
.................... delay_ms(100);
0023: MOVLW 64
0024: MOVWF 21
0025: CALL 004
0026: RETURN
.................... }
....................
.................... //funcion pulso con escritura incluido
.................... void escribe(){
.................... output_d(0x03);
0027: BSF 03.5
0028: CLRF 08
0029: MOVLW 03
002A: BCF 03.5
002B: MOVWF 08
.................... delay_ms(100);
002C: MOVLW 64
002D: MOVWF 21
002E: CALL 004
....................
.................... output_d(0x01);
002F: BSF 03.5
0030: CLRF 08
0031: MOVLW 01
0032: BCF 03.5
0033: MOVWF 08
.................... delay_ms(100);
0034: MOVLW 64
0035: MOVWF 21
0036: CALL 004
0037: RETURN
.................... }
....................
.................... void main(){
0038: MOVF 03,W
0039: ANDLW 1F
003A: MOVWF 03
003B: MOVLW 71
003C: BSF 03.5
003D: MOVWF 0F
003E: MOVF 0F,W
003F: BSF 03.6
0040: MOVF 09,W
0041: ANDLW C0
0042: MOVWF 09
0043: BCF 03.6
0044: BCF 1F.4
0045: BCF 1F.5
0046: MOVLW 00
0047: BSF 03.6
0048: MOVWF 08
0049: BCF 03.5
004A: CLRF 07
004B: CLRF 08
004C: CLRF 09
004D: BCF 03.7
.................... setup_oscillator(OSC_8MHZ|OSC_INTRC);
004E: MOVLW 71
004F: BSF 03.5
0050: BCF 03.6
0051: MOVWF 0F
0052: MOVF 0F,W
.................... //Establecemos puertos como salidas
.................... set_tris_b(0x00);
0053: MOVLW 00
0054: MOVWF 06
.................... set_tris_d(0x00);
0055: MOVWF 08
.................... //Limpiamos los puertos
.................... output_b(0x00);
0056: CLRF 06
0057: BCF 03.5
0058: CLRF 06
.................... output_d(0x00);
0059: BSF 03.5
005A: CLRF 08
005B: BCF 03.5
005C: CLRF 08
.................... //--------------------------------------------------------------------------
.................... //Incializamos la LCD Modo 8 bits
.................... output_b(0x3A);
005D: BSF 03.5
005E: CLRF 06
005F: MOVLW 3A
0060: BCF 03.5
0061: MOVWF 06
.................... delay_ms(100);
0062: MOVLW 64
0063: MOVWF 21
0064: CALL 004
....................
.................... pulso();
0065: CALL 018
.................... //--------------------------------------------------------------------------
....................
.................... output_b(0x0F);
0066: BSF 03.5
0067: CLRF 06
0068: MOVLW 0F
0069: BCF 03.5
006A: MOVWF 06
.................... delay_ms(100);
006B: MOVLW 64
006C: MOVWF 21
006D: CALL 004
....................
.................... pulso();
006E: CALL 018
.................... //--------------------------------------------------------------------------
.................... //Terrmina inicialización
.................... //Escribe U
....................
.................... output_b(0X55);
006F: BSF 03.5
0070: CLRF 06
0071: MOVLW 55
0072: BCF 03.5
0073: MOVWF 06
....................
.................... escribe();
0074: CALL 027
.................... //--------------------------------------------------------------------------
.................... //Escribe T
....................
.................... output_b(0X54);
0075: BSF 03.5
0076: CLRF 06
0077: MOVLW 54
0078: BCF 03.5
0079: MOVWF 06
....................
.................... escribe();
007A: CALL 027
.................... //--------------------------------------------------------------------------
.................... //Escribe P
.................... //output_c(0X05);
.................... output_b(0X50);
007B: BSF 03.5
007C: CLRF 06
007D: MOVLW 50
007E: BCF 03.5
007F: MOVWF 06
....................
.................... escribe();
0080: CALL 027
.................... //--------------------------------------------------------------------------
.................... }
0081: SLEEP
Configuration Fuses:
Word 1: 2CF4 INTRC_IO NOWDT NOPUT MCLR NOPROTECT NOCPD NOBROWNOUT IESO FCMEN NOLVP NODEBUG
Word 2: 3FFF BORV40 NOWRT