Follow along with the video below to see how to install our site as a web app on your home screen.
Nota: This feature currently requires accessing the site using the built-in Safari browser.
; En la pantalla se visualizan varios mensajes, uno detrás de otro. Cada mensaje permanece
; durante 2 segundos. Entre mensaje y mensaje la pantalla se apaga durante unos 200 ms.
;
; ZONA DE DATOS **********************************************************************
LIST P=16F84A
INCLUDE <P16F84A.INC>
__CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _XT_OSC
CBLOCK 0x0C
ENDC
; ZONA DE CÓDIGOS ********************************************************************
ORG 0
Inicio
call LCD_Inicializa
Principal
movlw Mensaje0 ; Apunta al mensaje 0.
call Visualiza
movlw Mensaje1 ; Apunta al mensaje 1.
call Visualiza
movlw Mensaje2 ; Apunta al mensaje 2.
call Visualiza
movlw Mensaje3 ; Apunta a Menajazo número 3.
call Visualiza
movlw Mensaje4 ; Apunta al mensaje 4.
call Visualiza
movlw Mensaje5 ; Apunta al mensaje 5.
call Visualiza
movlw Mensaje6 ; Apunta al mensaje 6.
call Visualiza
call Retardo_5s ; Permanece apagada durante este tiempo.
goto Principal ; Repite la visualización de todos los mensajes.
;
; Subrutina "Visualiza" -----------------------------------------------------------------
;
Visualiza
call LCD_Mensaje
call Retardo_2s ; Visualiza el mensaje durante este tiempo.
call LCD_Borra ; Borra la pantalla y se mantiene así durante
call Retardo_200ms ; este tiempo.
return
;
; "Mensajes" ----------------------------------------------------------------------------
;
Mensajes
addwf PCL,F
Mensaje0 ; Posición inicial del mensaje 0.
DT "LCD 2x16", 0x00
Mensaje1 ; Posición inicial del mensaje 1.
DT "compatible con", 0x00
Mensaje2 ; Posición inicial del mensaje 2.
DT "HD44870.", 0x00
Mensaje3
DT "Este LCD está", 0x00
Mensaje4
DT "controlado con", 0x00
Mensaje5
DT "el PIC 16F84A", 0x00
Mensaje6
DT "25-03-2008", 0x00
INCLUDE <LCD_4BIT.INC>
INCLUDE <LCD_MENS.INC>
INCLUDE <RETARDOS.INC>
END
; Voy a cambiar la á por el 0xE1.
Mensaje3
DT "Este LCD está", 0x00
Mensaje3
DT "Este LCD est0xE1", 0x00
pic-man dijo:Meta, podrías probar mandando el caracter en ASCII, tal vez tu lo escribes 'á' en mplab, en vez de mandar el caracter mandalo con su equivalente en código ascii
á = 0xE1 = b'11100001'
é = 0xE9 = b'11101001'
í = 0xED = b'11101101'
ó = 0xF3 = b'11110011'
ú = 0xFA = b'11111010'
ahí está el equivalente en hexadecimal y en binario del código ascii, intenta mandando así el dato (en hexadecimal o binario, el que prefieras), debe funcionar porque así aparece en el datasheet del LCD.
; ZONA DE DATOS **********************************************************************
LIST P=16F84A
INCLUDE <P16F84A.INC>
__CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _XT_OSC
CBLOCK 0x0C
ENDC
; ZONA DE CÓDIGOS ********************************************************************
ORG 0
Inicio
call LCD_Inicializa
movlw 'E'
call LCD_Caracter
movlw 's'
call LCD_Caracter
movlw 't'
call LCD_Caracter
movlw b'11100001' ; Letra á.
call LCD_Caracter
sleep ; Entra en modo de bajo consumo.
INCLUDE <LCD_4BIT.INC> ; Subrutinas de control del módulo LCD.
INCLUDE <RETARDOS.INC> ; Subrutinas de retardo.
END ; Fin del programa.
; ZONA DE DATOS **********************************************************************
LIST P=16F84A
INCLUDE <P16F84A.INC>
__CONFIG _CP_OFF & _WDT_OFF & _PWRTE_ON & _XT_OSC
CBLOCK 0x0C
ENDC
; ZONA DE CÓDIGOS ********************************************************************
ORG 0
Inicio
call LCD_Inicializa
movlw 'E'
call LCD_Caracter
movlw 's'
call LCD_Caracter
movlw 't'
call LCD_Caracter
movlw b'11100001' ; Letra ä, quiero la á.
call LCD_Caracter
sleep ; Entra en modo de bajo consumo.
INCLUDE <LCD_4BIT.INC> ; Subrutinas de control del módulo LCD.
INCLUDE <RETARDOS.INC> ; Subrutinas de retardo.
END ; Fin del programa.
CGRAM_Escribe
addwf PCL,F
; Bateria al 0%, byte 0 de la CGRAM.
; ________
retlw b'00001110' ; | xxx |
retlw b'00001010' ; | x x |
retlw b'00010001' ; | x x|
retlw b'00010001' ; | x x|
retlw b'00010001' ; | x x|
retlw b'00010001' ; | x x|
retlw b'00010001' ; | x x|
retlw b'00011111' ; | xxxxx|
; --------