Ensamblador - No puedo crear caracter especial a partir de direccion 0x58

 
Vista:

No puedo crear caracter especial a partir de direccion 0x58

Publicado por Liliana (1 intervención) el 24/05/2024 05:48:35
Estoy intentando crear un cuarto caracter especial para un lcd 16x2, todo esta bien al usar las direcciones 0x40, 0x48 y 0x50, pero cuando intendo usar de la direccion 0x58 en adelante, ya no me imprime nada el lcd

__Config _WDT_OFF & _PWRTE_ON & _XT_OSC & _LVP_OFF & _CP_OFF
List P=16F877A
INCLUDE <P16F877A.INC>

CBLOCK 24h
Contador
Contador2
Contador3
Contador4
Contador5
Contador6
ENDC

org 0x00
goto Inicio
org 0x05

CGRAM org 0x40
CGRAM2 org 0x48
CGRAM3 org 0x50
CGRAM4 org 0x58

Inicio
BSF STATUS, RP0
BCF STATUS, RP1
CLRF TRISB
CLRF TRISC
BCF STATUS, RP0
CLRF PORTB
CLRF PORTC

;LCD
call Clear
call On
call FuncionSet

Loop
clrf Contador
clrf Contador2
clrf Contador3
clrf Contador4
clrf Contador5
clrf Contador6
Frase
movlw 'P'
call Dato
movlw 'r'
call Dato
movlw 'a'
call Dato
movlw 'c'
call Dato
movlw 't'
call Dato
movlw 'i'
call Dato
movlw 'c'
call Dato
movlw 'a'
call Dato
movlw ' '
call Dato
movlw '9'
call Dato

call Retardo_5seg
call Clear

movlw CGRAM
call Control
Fig1
movf Contador, 0
call Caracter
call Dato
incf Contador, 1
movlw d'8'
subwf Contador, 0
btfss STATUS, 2
goto Fig1

movlw CGRAM2
call Control
Fig2
movf Contador2, 0
call Caracter2
call Dato
incf Contador2, 1
movlw d'8'
subwf Contador2, 0
btfss STATUS, 2
goto Fig2

movlw CGRAM3
call Control
Fig3
movf Contador3, 0
call Caracter3
call Dato
incf Contador3, 1
movlw d'8'
subwf Contador3, 0
btfss STATUS, 2
goto Fig3

movlw CGRAM4
call Control
Fig4
movf Contador4, 0
call Caracter4
call Dato
incf Contador4, 1
movlw d'8'
subwf Contador4, 0
btfss STATUS, 2
goto Fig4

call Clear
movlw b'00000000'
call Dato
movlw b'00000001'
call Dato
movlw b'00000010'
call Dato

call Renglon2

movlw b'00000011'
call Dato

call Retardo_5seg
call Clear
goto Loop


Clear ;Limpia LCD
movlw b'00000001'
call Control
return
On
movlw b'00001100'
call Control
return
FuncionSet
movlw b'00111000'
call Control
return

Renglon2
movlw b'11000000'
call Control
return

Dato
bsf PORTC, 0
goto Enable
Control
bcf PORTC, 0
Enable
movwf PORTB
bsf PORTC, 1
call Retardo_2ms
call Retardo_2ms
call Retardo_200micros
bcf PORTC, 1
call Retardo_2ms
Return

Retardo_5seg
call Retardo_200ms
call Retardo_200ms
call Retardo_200ms
call Retardo_200ms
call Retardo_200ms
call Retardo_200ms
call Retardo_200ms
call Retardo_200ms
call Retardo_200ms
call Retardo_200ms
call Retardo_200ms
call Retardo_200ms
call Retardo_200ms
call Retardo_200ms
call Retardo_200ms
call Retardo_200ms
call Retardo_200ms
call Retardo_200ms
call Retardo_200ms
call Retardo_200ms
call Retardo_200ms
call Retardo_200ms
call Retardo_200ms
call Retardo_200ms
call Retardo_200ms
return

; CARACTER ESPECIAL 1
Caracter
addwf PCL, 1
retlw b'00000000'
retlw b'00000000'
retlw b'00000000'
retlw b'00000000'
retlw b'00000111'
retlw b'00001111'
retlw b'00010011'
retlw b'00000001'
return
; CARACTER ESPECIAL 2
Caracter2
addwf PCL, 1
retlw b'00000100'
retlw b'00001110'
retlw b'00001110'
retlw b'00001110'
retlw b'00000100'
retlw b'00010101'
retlw b'00011111'
retlw b'00011111'
return
; CARACTER ESPECIAL 3
Caracter3
addwf PCL, 1
retlw b'00000000'
retlw b'00000000'
retlw b'00000000'
retlw b'00000000'
retlw b'00011100'
retlw b'00011110'
retlw b'00011001'
retlw b'00010000'
return

; CARACTER ESPECIAL 4
Caracter4
addwf PCL, 1
retlw b'00000000'
retlw b'00000000'
retlw b'00001010'
retlw b'00010111'
retlw b'00011111'
retlw b'00001110'
retlw b'00000100'
retlw b'00000000'
return

INCLUDE <RETARDOS.INC>
End
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder