45871763 lcd

195 views
133 views

Published on

microcontroller

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
195
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

45871763 lcd

  1. 1. ORG 0000H LJMP MAIN ORG 0030H RS EQU P3.5 RW EQU P3.4 EN EQU P3.7 ;initializationMAIN: MOV A,#038H ;first time LCALL COM MOV A,#038H ;second time LCALL COM MOV A,#038H ;third time LCALL COM MOV A,#038H ;fourth time LCALL COM MOV A,#00CH LCALL COM MOV A,#001H LCALL COM MOV A,#006H LCALL COM MOV A,#083H LCALL COM ;initialization End ;=========================================== MOV A,#D ;data to write on LCD LCALL DATAW LCALL DELAY MOV A,#A LCALL DATAW LCALL DELAY MOV A,#R LCALL DATAW LCALL DELAY MOV A,#E LCALL DATAW LCALL DELAY MOV A,# LCALL DATAW LCALL DELAY MOV A,#D LCALL DATAW LCALL DELAY MOV A,#E LCALL DATAW LCALL DELAY MOV A,#V LCALL DATAW LCALL DELAY MOV A,#I LCALL DATAW LCALL DELAY MOV A,#L LCALL DATAW LCALL DELAY ;=========================================== MOV A,#0C1H LCALL COM ;=========================================== MOV A,#A ;data to write on LCD LCALL DATAW
  2. 2. LCALL DELAY MOV A,#S LCALL DATAW LCALL DELAY MOV A,#I LCALL DATAW LCALL DELAY MOV A,#F LCALL DATAW LCALL DELAY MOV A,# LCALL DATAW LCALL DELAY MOV A,#A LCALL DATAW LCALL DELAY MOV A,#L LCALL DATAW LCALL DELAY MOV A,#I LCALL DATAW LCALL DELAY MOV A,# LCALL DATAW LCALL DELAY ;=========================================== MOV A,#R ;data to write on LCD LCALL DATAW LCALL DELAY MOV A,#A LCALL DATAW LCALL DELAY MOV A,#J LCALL DATAW LCALL DELAY MOV A,#P LCALL DATAW LCALL DELAY MOV A,#U LCALL DATAW LCALL DELAY MOV A,#T LCALL DATAW LCALL DELAY ;===========================================AGAIN: SJMP AGAIN ;endless loopCOM: MOV P1,A ;command write sequence CLR RS CLR RW SETB EN ;LCALL TEST CLR EN LCALL DELAY RETDATAW: MOV P1,A ;data write sequence SETB RS CLR RW SETB EN ;LCALL TEST CLR EN
  3. 3. LCALL DELAY RETDELAY: MOV R6,#50 ;simple delay routineHERE2: MOV R7,#255 ;for 0.0124S or 124MSHERE: DJNZ R7,HERE DJNZ R6,HERE2 RETTEST: JB P3.0,TESTTEST2: JNB P3.0,TEST2 RET END

×