Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/30/07 16:14
Read: times


 
#143761 - LCD and Serial Port Initialization
Responding to: ???'s previous message
This routine will properly initialize your LCD, providing your delay loops are correct. It works in the above mentioned simulator.

INIT_LCD:			; initialize LCD
       	MOV   	A,#56		;38H	FIRST
     	ACALL 	LCDCMD
        MOV   	A,#56		;38
        ACALL 	LCDCMD
        MOV   	A,#56		;38
        ACALL 	LCDCMD
        MOV   	A,#56		;38		;FOURTH
        ACALL 	LCDCMD
        MOV   	A,#15		;0F
        ACALL 	LCDCMD		;DISPLAY ON
        MOV   	A,#01
        ACALL 	LCDCMD		;CLEAR AND ON
        MOV   	A,#06
        ACALL 	LCDCMD
        MOV   	A,#15		;0FH
        ACALL 	LCDCMD		;DISPLAY ENABLE
        RET


Also after correcting the two delay loops, missing '#' the simulator only shows one occurance of the display 'TANKTRACKS' then goes to show 'MODE'

Your serial initialization does not initialize to 9600 baud unless you are using 11.059 MHz crystal and remove the double baud rate stuff.

SETSRL: MOV	TMOD,#20H	; TIMER 1 , AUTO RELOAD MODE
	MOV	SCON,#50H	; 8N1
	MOV	TH1,#0FDH	; 9600 BAUDS
;	MOV	A,PCON		; DOUBLE THE BAUD RATE
;	SETB	ACC.7
;	MOV	PCON,A
	SETB	TR1		; START TIMER T1
	RET


Jon


List of 5 messages in thread
TopicAuthorDate
help me in debugging asm code            01/01/70 00:00      
   too tough to read            01/01/70 00:00      
   Formatted and some comments            01/01/70 00:00      
      LCD and Serial Port Initialization            01/01/70 00:00      
         it\\\'s still very badly written            01/01/70 00:00      

Back to Subject List