smiles
Advanced Member level 4
hi ! I am quite new to assembly coding (using Pic16F877)
here is my program for display 'A' character on LCD screen and it wrong (simulate using Proteus)
Here is the diagram
and the write process diagram of LCD (LM018L) is here
**broken link removed**
Could you tell me what wrong with my code, thanks so much !
here is my program for display 'A' character on LCD screen and it wrong (simulate using Proteus)
Code:
list p=16f877a ; list directive to define processor
#include <p16f877a.inc> ; processor specific variable definitions
__CONFIG _CP_OFF & _WDT_OFF & _BODEN_OFF & _PWRTE_ON & _RC_OSC & _WRT_OFF & _LVP_ON & _CPD_OFF
;*******************************************************************
org 0x0000
goto Main
org 0x0005
Main
banksel TRISB
movlw 00h
movwf TRISB ;Set all PORTB pins to output
banksel TRISA
bsf ADCON1,1 ;Port A is digital I/O
bsf ADCON1,2 ;...
movlw 01h
movwf TRISA ;pin 0 is input, the rest is output
banksel PORTA
Main1
clrf PORTB
bsf PORTA,2 ;RS pin on
bsf PORTA,4 ;E pin on
bcf PORTA,3 ;R/W pin off
; banksel PORTB
movlw 41h
movwf PORTB ;"A" character
bcf PORTA,4 ;E pin off
bcf PORTA,2 ;RS pin off
bsf PORTA,3 ;R/W pin on
goto Main1
END
and the write process diagram of LCD (LM018L) is here
**broken link removed**
Could you tell me what wrong with my code, thanks so much !