How to interface a Nokia 7110 lcd with a PIC16F84A microcontroller


nokia 7110 lcd pinouts, circuit schematic and test code library

Nokia 7110 lcd use a SED1565 driver


Source code it is available for download. Nokia 7110 lcd pinouts can be found here.

Nokia 7110 lcd library:

;sedlib.inc
;====== LCD_Nokia 7110 library ====================27/11/03==
;	cod P313032901  / driver SED1565
;	rb6,rb7     sclock,sdata
;	ra0,ra1,ra2,ra3	d/C,Reset,Vccmd,SCE
;	internal clock
;	standard crystal 4.000 MHz XT - 1us pe instructiune
;	Program realizat de Ing. Bergthaller Iulian 
;	 http://www.module.ro
;------------------------------------------------------------
;------------------------------------------------------------
count1	equ	0x0C
count2	equ	0x0D
count3	equ	0x0E
count4	equ	0x0F
afisaj	equ	0x10
linie		equ	0x11
#DEFINE sclk	PORTB,6
#DEFINE sdta	PORTB,7
#DEFINE dorc	PORTA,0
#DEFINE rset	PORTA,1
#DEFINE enab	PORTA,3
;------------------------------------------------------------
lcd_ini
	call	halte
	call	lcres	; reset
	movlw	0xA6	; lcd in normal mode (0xA7 pt. negativ)
	call	lccmd
	movlw	0xA3	; bias
	call	lccmd
	movlw	0xA1	; select DRAM for reverse display (0xA0 for normal)
	call	lccmd
	movlw	0xC0	; direction
	call	lccmd
	movlw	0x22	;  V5 voltage set
	call	lccmd
	movlw	0x81	; electric volume - double byte command
	call	lccmd
	movlw	0x2E	;  
	call	lccmd
	movlw	0x2F	; booster mode & voltage regulator & follow  all on
	call	lccmd
	movlw	0xE3	; nop
	call	lccmd
	movlw	0x40	; set start address
	call	lccmd
	movlw	0xAF	; lcd on (0xAE pt. lcd off)
	call	lccmd
	movlw	0xA5	; lcd all on
	call	lccmd
	call	halte
	call	halte
	movlw	0xA4	; lcd normal
	call	lccmd
;------------------------------------------------------------
lcdta	bsf	dorc
	bcf	enab	; chip is activ
	call	varsa
	bsf	enab
	retlw	00
;------------------------------------------------------------
lccmd	bcf	dorc
	bcf	enab	
	call	varsa
	bsf	enab
	retlw	00
;------------------------------------------------------------
lcres	bsf	enab
	call	halte
	bsf	rset	;reset
	call	halte
	retlw	00
;------------------------------------------------------------
varsa	movwf	afisaj
	movlw	0x08	
	movwf	count4
vbit	bcf	sclk
	bcf	sdta
	btfsc	afisaj,7
	bsf	sdta
	bsf	sclk
	rlf	afisaj,F
	decfsz	count4,F
	goto	vbit
	retlw	00
;------------------------------------------------------------
cbild	movlw	0xB0
	movwf	linie	;  linie address
	movlw	0x09	; last line it is from page 9-th  
	movwf	count3
cline	movf	linie,0
	call	lccmd
	movlw	0x11	; only 96 from 132 columns are connected to lcd driver 18+96+18= 132
	call	lccmd
	movlw	0x02	; 18 columns  in left&right of lcd driver are  not connected
	call	lccmd
	bcf	sdta
	movlw	0x60	; 96 columns
	movwf	count1
c1	movlw	0x08	; 8 bits wide page
	movwf	count2
	bsf	dorc
	bcf	enab 
c2	bcf	sclk
	bsf	sclk
	decfsz	count2,F	
	goto	c2
	bsf	enab 		
	decfsz	count1,F	
	goto 	c1
	incf	linie,F
	decfsz	count3,F
	goto	cline	
    	retlw	00
;------------------------------------------------------------
halte	movlw	0x07
	movwf	count3
d3	movlw	0x32
	movwf	count1
d1	movlw	0xF0	  
	movwf	count2
d2	decfsz	count2,F	
	goto	d2		
	decfsz	count1,F	
	goto	d1		
	decfsz	count3,F    
	goto	d3          
	retlw	00
;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
usaex	bsf	STATUS,RP0  ;switch to bank 1
	movlw	0x00	; PORTA set to out/inputs
	movwf	TRISA
	bcf	STATUS,RP0  ;switch back to bank 0
	return
;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
usbex	bsf	STATUS,RP0  ;switch to bank 1
	movlw	0x00	; PORTB set to out/inputs
	movwf	TRISB
	bcf	STATUS,RP0  ;switch back to bank 0
	return

Nokia 7110 lcd test programm:

;main.asm
;=======LCD_Nokia 7110 =================================28/11/03==
;	driver SED1565
;	internal clock
;	standard crystal 4.000 MHz XT - 1us pe instructiune
;	www.module.ro
;------------------------------------------------------------
;	configure programmer
	list	p=16f84;f=inhx8m
	__CONFIG       _CP_OFF & _PWRTE_ON & _WDT_OFF & _XT_OSC
;------------------------------------------------------------
;------------------------------------------------------------
 	org	0x00
	goto	init
	org	0x04
;------------------------------------------------------------
	#INCLUDE P16F84.INC
	#INCLUDE sedlib.INC
;------------------------------------------------------------
init 	call	usaex
	call	usbex
	movlw	0x00
	movwf	PORTA
	movwf	PORTB
;------------------------------------------------------------
	call	lcd_ini
	call	cbild
	movlw	0xB0	; write on first line
	call	lccmd	
	movlw	0x13	; (18+33+30+33+18= 132)
	call	lccmd
	movlw	0x03	; write begin with the 33-rd columns (33+18) 
	call	lccmd
	movlw	0x7F	;E
	call	lcdta
	movlw	0x49
	call	lcdta
	movlw	0x49
	call	lcdta
	movlw	0x49
	call	lcdta
	movlw	0x49
	call	lcdta
	movlw	0x00
	call	lcdta
	movlw	0x7F	;P
	call	lcdta
	movlw	0x09
	call	lcdta
	movlw	0x09	
	call	lcdta
	movlw	0x09
	call	lcdta
	movlw	0x06
	call	lcdta
	movlw	0x00
	call	lcdta
	movlw	0x26	;S
	call	lcdta
	movlw	0x49
	call	lcdta
	movlw	0x49
	call	lcdta
	movlw	0x49
	call	lcdta
	movlw	0x32
	call	lcdta
	movlw	0x00
	call	lcdta
	movlw	0x3E	;O
	call	lcdta
	movlw	0x41
	call	lcdta
	movlw	0x41
	call	lcdta
	movlw	0x41
	call	lcdta
	movlw	0x3E
	call	lcdta
	movlw	0x00
	call	lcdta
	movlw	0x7F	;N
	call	lcdta
	movlw	0x06
	call	lcdta
	movlw	0x08
	call	lcdta
	movlw	0x30
	call	lcdta
	movlw	0x7F
	call	lcdta
	movlw	0x00
	call	lcdta
	sleep
;------------------------------------------------------------
	end
;============================================================



More info about lcd pinouts from:

Subscribe to my RSS Feed.


Back to my home page
Last updated December, 2003
© Copyright 2003 Bergthaller Iulian-Alexandru