LCD Pinouts and test code


Samsung lcd module  top - with ks0066 lcd driver , bottom with sed1278


Samsung lcd module top - with ks0066 lcd driver , bottom - with sed1278
 
	1	Gnd	
	2	Vdd	
	3	V5	
	4	RS
	5	R/_W
	6	E
	7	DB0
	8	DB1
	9	DB2
	10	DB3
	11	DB4
	12	DB5
	13	DB6
	14	DB7
					

Source code:


;------------------------------------------------------------
;     configure programmer
      LIST P=16F628;f=inhx8m
        #include "P16F628.INC"  ; Include header file
	__CONFIG	_PWRTE_ON  & _WDT_OFF & _HS_OSC & _BODEN_OFF & _LVP_OFF & _CP_OFF & _MCLRE_OFF
;http://www.module.ro
;------------------------------------------------------------
	cblock 0x20	; Beginn General Purpose-Register
;------------------------------------------------------------
	count1
	count2
	count3
	count4
	count5
;---------------------------------------
	endc
;------------------------------------------------------------
#DEFINE rs	PORTA,0
#DEFINE rw	PORTA,1 
#DEFINE en 	PORTA,2
;------------------------------------------------------------
	org	0x00
	goto	init
	org	0x04	
;
;************************************************************
init  
	clrf	PORTA
	clrf	PORTB
	movlw	0x07		; Turn comparators off and enable pins for I/O 
	movwf	CMCON	
	bcf	STATUS,RP1
	bsf	STATUS,RP0  ;switch to bank 1
	clrf	TRISB
	clrf	TRISA
	bcf	STATUS,RP0  ;switch back to bank 0

;************************************************************
ini_lcd
	call pause
	movlw	0x01
	call	lccmd
	movlw	0x02
	call	lccmd	
	movlw	0x0F
	call	lccmd
	movlw	0x38
	call	lccmd
;************************************************************
	movlw	0x31
	call	lcdta
	movlw	0x32
	call	lcdta
	movlw	0x33
	call	lcdta
	movlw	0x34
	call	lcdta
	movlw	0x35
	call	lcdta
	movlw	0x36
	call	lcdta
	movlw	0x37
	call	lcdta
	movlw	0x38
	call	lcdta

;************************************************************

	movlw	0xC0
	call	lccmd
;************************************************************

	movlw	0x38
	call	lcdta
	movlw	0x37
	call	lcdta
	movlw	0x36
	call	lcdta
	movlw	0x35
	call	lcdta
	movlw	0x34
	call	lcdta
	movlw	0x33
	call	lcdta
	movlw	0x32
	call	lcdta
	movlw	0x31
	call	lcdta
;************************************************************

StayHere	goto StayHere
;************************************************************
lcdta	bsf	rs
	nop
	bcf	rw
	nop
	movwf	PORTB
	nop
	bcf	en
	nop
	bsf	en
	nop
	bcf	en
	call	halta
	retlw	00

;************************************************************
lccmd	bcf	rs
	nop
	bcf	rw
	nop
	movwf	PORTB
	nop
	bcf	en
	nop
	bsf	en
	nop
	bcf	en
	call	halta
	retlw	00
;************************************************************
;************************************************************
;************************************************************
pause	movlw	0x07
	movwf	count3
d3	movlw	0xF0
	movwf	count1
d1	movlw	0xFA	  
	movwf	count2
d2	decfsz	count2,f	
	goto	d2		
	decfsz	count1,f	
	goto	d1		
	decfsz	count3,f    
	goto	d3          
	retlw	00
;************************************************************
halta	movlw	0xFF
	movwf	count2
g2	nop
	nop
	nop
	nop
	nop
	decfsz	count2,f	
	goto	g2		
	retlw	00
;************************************************************
;------------------------------------------------------------
	end
;============================================================


Back to my home page