| ??? 02/11/08 12:59 Read: times |
#150556 - All that code reduces to: Responding to: ???'s previous message |
Carlos Junior:
It is a happy time to hear that your 4-bit initialize code works. The next step is to learn how to reduce the size of the code to a lesser amount while at the same time making it a lot more clear what is being sent out. Now whilst I cannot comment on the correctness of your code for for your particular display or for how you have your prototype wired up please review this.
;
ini_out:
acall ini_out1 ;output high nibble of a
swap a ;arrange for output of low nibble
ini_out1:
rlc a
mov p0.0,c
rlc a
mov p0.1,c
rlc a
mov p0.2,c
rlc a
mov p0.3,c
setb en
acall delay_5ms
clr en
ret
;
;
ini_lcd:
clr rs
clr en
;
mov a,#03h
acall ini_out
;
mov a,#03h
acall ini_out
;
mov a,#03h
acall ini_out
;
mov a,#02h
acall ini_out
;
mov a,#28h
acall ini_out
;
mov a,#0Ch
acall ini_out
;
mov a,#06h
acall ini_out
;
mov a,#06h
acall ini_out
;
mov a,#01h
acall ini_out
;
ret
Michael Karas |



