BSF and BCF should be ok to use. But let’s try something differently.
Instead of the same routine to write to the LCD, we will use two separate routines, one for commands and another for characters.
Edit: I am rusty with PIC ASM code, so maybe someone else can see if my code is correct.
Instead of the same routine to write to the LCD, we will use two separate routines, one for commands and another for characters.
Edit: I am rusty with PIC ASM code, so maybe someone else can see if my code is correct.
Code:
; pass command in CMD
SEND_CMD
MOVLF 0x00
MOVWF PORTA
MOVLF CMD
MOVWF PORTB
CALL DELAY_3
MOVLF 0x02
MOVWF PORTA
CALL DELAY_3
MOVLF 0x00
MOVWF PORTA
RETURN
;pass character in CHAR
SEND_CHAR
MOVLF 0x01
MOVWF PORTA
MOVLF CHAR
MOVWF PORTB
CALL DELAY_3
MOVLF 0x03
MOVWF PORTA
CALL DELAY_3
MOVLF 0x01
MOVWF PORTA
RETURN
