please dont rip this site

PIC Microcontroler LCD IO routine

Graphic LCD driver for LPH 7366-1 (used in Nokia 5110 Phone)

by Bergthaller C Iulian

Pic interface to graphic LCD module LPH 7366-1 used in Nokia 5110 Phone.

;=======LCD_Nokia nse1,nse3,nsm1 / Version 1.0====================21/12/02==
;	cod LPH7366-1 / driver PCD8544
;	rb6,rb7     sclock,sdata
;	ra0,ra1,ra2,ra3	d/C,Reset,Vccmd,SCE
;     internal clock
;     standard crystal 4.000 MHz XT - 1us pe instructiune/pe aproape
;	Program realizat de Ing. Bergthaller Iulian-Alexandru 
;------------------------------------------------------------
	list	p=16f84A;f=inhx8m
_CP_OFF	equ	H'3FFF'	      ;code protect off
_PWRTE_ON	equ	H'3FFF' 		;Power on timer on
_WDT_OFF	equ	H'3FFB'		;watch dog timer off
_XT_OSC		equ	H'3FFD'	;crystal oscillator
	__CONFIG       _CP_OFF & _PWRTE_ON & _WDT_OFF & _XT_OSC
;------------------------------------------------------------
;      cpu init
porta	      equ	05
portb	      equ	06
count1	equ	0C
count2	equ	0D
count3	equ	0E
afisaj	equ	0F
#DEFINE sclk	portb,6
#DEFINE sdta	portb,7
#DEFINE dorc	porta,0
#DEFINE rset	porta,1
#DEFINE tens	porta,2
#DEFINE enab	porta,3
;------------------------------------------------------------
;      bit init
w	equ	0
;------------------------------------------------------------
	org	0
;
;------------------------------------------------------------
init   
	movlw   0
	tris    portb ; set portb as output
      movwf   portb ; all ouput low
	movlw   0
	tris    porta ; set portb as output
      movwf   porta ; all ouput low
start	call pause
	bsf	dorc
	bsf	enab
	bsf	tens ;activare tensiune
	call lcres	;resetare cca. 250ms
	movlw 21H	;set extins 
	movwf afisaj
	call	lccmd
	movlw .197	;Vop 
	movwf afisaj
	call	lccmd
	movlw 13H	;bias
	movwf afisaj
	call	lccmd
	movlw 20H	;afisare orizontala
	movwf afisaj
	call	lccmd
	movlw 09H	;mod control all on 
	movwf afisaj
	call	cbild	;resetare DDRAM
	call	lccmd
	call	pause
	movlw 08H	;mod control blank 
	movwf afisaj
	call	lccmd
	call	pause
	movlw 0CH	;mod control normal 
	movwf afisaj
	call	lccmd
	movlw 40H	;x ini 
	movwf afisaj
	call	lccmd
	movlw 80H	;y ini
	movwf afisaj
	call	lccmd
adata	movlw 1FH	;date
	movwf afisaj
	call	lcdta
	movlw 05H	;date
	movwf afisaj
	call	lcdta
	movlw 07H	;date
	movwf afisaj
	call	lcdta
	goto adata
lcdta	bsf	dorc
	bcf	enab ;activare chip si start date
	call	varsa
	bsf	enab
	retlw	00
lccmd	bcf	dorc
	bcf	enab ;activare chip si start date
	call	varsa
	bsf	enab
	retlw	00
lcres	bcf	rset ;resetare
	call	pause
	bsf	rset ;dezactivare reset
	retlw	00
varsa	bcf	sclk
	btfsc afisaj,7	;bit0(MSB)
	bsf	sdta
	btfss afisaj,7
	bcf	sdta
	call halta
	bsf	sclk
	call halta
	bcf	sclk
	btfsc afisaj,6	;bit1
	bsf	sdta
	btfss afisaj,6
	bcf	sdta
	call halta
	bsf	sclk
	call halta
	bcf	sclk
	btfsc afisaj,5	;bit2
	bsf	sdta
	btfss afisaj,5
	bcf	sdta
	call halta
	bsf	sclk
	call halta
	bcf	sclk
	btfsc afisaj,4	;bit3
	bsf	sdta
	btfss afisaj,4
	bcf	sdta
	call halta
	bsf	sclk
	call halta
	bcf	sclk
	btfsc afisaj,3	;bit4
	bsf	sdta
	btfss afisaj,3
	bcf	sdta
	call halta
	bsf	sclk
	call halta
	bcf	sclk
	btfsc afisaj,2	;bit5
	bsf	sdta
	btfss afisaj,2
	bcf	sdta
	call halta
	bsf	sclk
	call halta
	bcf	sclk
	btfsc afisaj,1	;bit6
	bsf	sdta
	btfss afisaj,1
	bcf	sdta
	call halta
	bsf	sclk
	call halta
	bcf	sclk
	btfsc afisaj,0	;bit7(LSB)
	bsf	sdta
	btfss afisaj,0
	bcf	sdta
	call halta
	bsf	sclk
	call halta
	bcf	sclk
	retlw	00
cbild	bcf	sdta
	movlw   .6
	movwf   count3
c3	movlw   .84
	movwf   count1
c1	movlw   .8  
	movwf   count2
	bsf	dorc
	bcf	enab 
c2	bcf	sclk
	nop
	nop
	bsf	sclk
	decfsz  count2	
	goto 	c2
	bsf	enab 		
	decfsz  count1	
	goto 	c1		
	decfsz  count3    
	goto  c3          
	retlw 	00
pause	movlw   .7
	movwf   count3
d3	movlw   .50
	movwf   count1
d1	movlw   .250	  
	movwf   count2
d2	decfsz  count2	
	goto 	d2		
	decfsz  count1	
	goto 	d1		
	decfsz  count3    
	goto  d3          
	retlw 	00
halta	movlw   20H	
	movwf   count1
g1	movlw   40H
	movwf   count2 
g2	decfsz  count2	
	goto 	g2		
	decfsz  count1	
	goto 	g1		
	retlw	00
;------------------------------------------------------------
	end
;============================================================ 

LPH 7366 controled power supply

LPH 7366 interfacing with PIC16F84

Warning: Front view!

LPH 7366 Pins

      pin1     V+
      pin2     Sclk
      pin3     Sda
      pin4     DorC
      pin5     Cs
      pin6     Osc (32768Hz external clock)
      pin7     Gnd
      pin8     Vout(DC/DC voltage converter)
      pin9     Reset

See also:

Questions:

Comments:


file: /Techref/io/lcd/LPH7366.htm, 8KB, , updated: 2017/4/8 04:54, local time: 2024/10/4 06:46, owner: BCI-hotmail-K96,
TOP NEW HELP FIND: 
35.171.164.77:LOG IN
©2024 PLEASE DON'T RIP! THIS SITE CLOSES OCT 28, 2024 SO LONG AND THANKS FOR ALL THE FISH!

 ©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://www.massmind.org/techref/io/lcd/LPH7366.htm"> Nokia 5110, Nokia 6150, Nokia 6110, LPH 7366-1</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

 

Welcome to massmind.org!

 

Welcome to www.massmind.org!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .