OTE LCD Pinouts and test code



OTE lcd
 
	pin1 Vled+	
	pin2 Vled-		
	pin3 Nc
	pin4 _reset	
	pin5 _RD	
	pin6 _WR	
	pin7 _CS	
	pin8 AD	
	pin9 d0	
	pin10 d1	
	pin11	d2
	pin12	d3
	pin13	d4
	pin14	d5
	pin15	d6
	pin16	d7
	pin17	Vdd
	pin18	Vdc + 3V (+/-10%)
	pin19	Gnd
	pin20	Nc
					

Test code:



;http://sandiding.tripod.com/Bertys.html
;------------------------------------------------------------
;	configure programmer
	list	p=16f628;f=inhx8m
	__CONFIG	_PWRTE_ON  & _WDT_OFF & _XT_OSC & _BODEN_OFF & _LVP_OFF & _CP_OFF & _MCLRE_OFF
;------------------------------------------------------------
;------------------------------------------------------------
 	org	0x00
	goto	init
	org	0x04
;------------------------------------------------------------
	#INCLUDE P16F628.INC
;------------------------------------------------------------
;       cpu init
	cblock 0x20	; Beginn General Purpose-Register
;------------------------------------------------------------
	count1	
	count2	
	count3	
	count4	
	count5
;------------------------------------------------------------	
	endc
;------------------------------------------------------------

#DEFINE rset	PORTA,0
#DEFINE rd	PORTA,1
#DEFINE wr	PORTA,2
#DEFINE cs	PORTA,3
#DEFINE rs	PORTA,4
;------------------------------------------------------------
;------------------------------------------------------------
	org	0x00
;	goto	init
	org	0x04
;------------------------------------------------------------
init	
	clrf	PORTA
	movlw	0x07		; Turn comparators off and enable pins for I/O 
	movwf	CMCON
	bcf	STATUS,RP1
	bsf	STATUS,RP0  ;switch to bank 1
	clrf	TRISA
	clrf	TRISB
	bcf	STATUS,RP0  ;switch back to bank 0
	clrf	PORTA
	clrf	PORTB
;***************************************************
start	
	
	call	pause
	bsf	rset	; reset finished
	call	haltb
	bsf	rd

	movlw	0x01
	call	lcdcmd
	movlw	0x8C
	call	lcddta

	movlw	0x0B
	call	lcdcmd
	movlw	0x04
	call	lcddta


	movlw	0x11
	call	lcdcmd
	movlw	0x04
	call	lcddta


	movlw	0x10
	call	lcdcmd
	movlw	0x0F
	call	lcddta

	movlw	0x00
	call	lcdcmd
	movlw	0x50
	call	lcddta

	movlw	0x04
	call	lcdcmd
	movlw	0x00
	call	lcddta
	movlw	0xFF
	call	lcddta
	movlw	0x00
	call	lcddta
	movlw	0xFF
	call	lcddta
	movlw	0x00
	call	lcddta
	movlw	0xFF
	call	lcddta
	movlw	0x00
	call	lcddta
	movlw	0xFF
	call	lcddta
	movlw	0x00
	call	lcddta
	movlw	0xFF
	call	lcddta
	movlw	0x00
	call	lcddta
	movlw	0xFF
	call	lcddta

;***************************************************
	call	pause
;***************************************************
homa	goto	homa
;***************************************************
;***************************************************
;***************************************************
lcdcmd
	bcf	cs
	nop
	bcf	rs
	nop
	bcf	wr
	nop
	movwf	PORTB
	nop
	bsf	wr
	nop
	bsf	rs
	nop
	call	haltb
 	return
;***************************************************
lcddta
	bcf	cs
	nop
	bsf	rs
	nop
	bcf	wr
	nop
	movwf	PORTB
	nop
	bsf	wr
	nop
	nop
	call	haltb
 	return
;************************************************************************

;************************************************************************
;	Subrutine de intarziere				 				
;************************************************************************
;________________________________________________________________________
haltb
	movlw	0xFA	  
	movwf	count2
r2	nop
	nop
	nop
	nop
	nop
	decfsz	count2,F	
	goto	r2
 	return
;________________________________________________________________________
pause	movlw	0x02 ;	
hopa	movwf	count3
d3	movlw	0xF9
	movwf	count1
d1	movlw	0xFA	  
	movwf	count2
d2	nop
	decfsz	count2,F	
	goto	d2		
	decfsz	count1,F	
	goto	d1		
	decfsz	count3,F    
	goto	d3          
	retlw	0x00
;************************************************************************

;------------------------------------------------------------
	end
;============================================================


Back to my home page
Make your own free website on Tripod.com