Alcatel HD1 Lcd Pinouts


Alcatel HD1 user interface

Connector detail


    Pin2 Gnd 
    Pin13 _CS 
    Pin15 Sdata 
    Pin16 Sclk
    Pin18 A0 
    Pin20 Reset
    Pin21 Vdd

Source code:

;=================hd1  lcd  driver=======================08/11/06==
;     standard crystal 4.0MHz XT
;------------------------------------------------------------
;     configure programmer
      LIST P=16F676;f=inhx8m
        #include "P16F676.INC"  ; Include header file
	__CONFIG	_PWRTE_ON  & _WDT_OFF & _XT_OSC & _BODEN & _CP_OFF & _MCLRE_OFF
; http://sandiding.tripod.com/Bertys.html
;------------------------------------------------------------
	cblock 0x20	; Beginn General Purpose-Register
;-------------------------- counters	
	count1
	count2
	count3
	count4
;-------------------------- registrii transfer
	afisaj
;--------------------------
	endc
;--------------------------
#DEFINE dorc	PORTC,0
#DEFINE enab	PORTC,1
#DEFINE sclk	PORTC,2
#DEFINE sdta	PORTC,3
#DEFINE rset	PORTC,4

;--- Reset --------------------------------------------------
	org	h'00'
	goto	init		; reset -> init
;--- Interrupt ----------------------------------------------
	org	h'04'
;************************************************************
init	
	bcf	STATUS,RP0	; Bank 0
	clrf	PORTA
	clrf	PORTC
	movlw	0x05		; Turn comparators off and enable pins for I/O 
	movwf	CMCON	
	bsf	STATUS,RP0	; Bank 1
	movlw	0x00	
	movwf	ANSEL
	movlw	0x0F	; input
	movwf	TRISA
	movlw	0x00	; output
	movwf	TRISC
	bcf	STATUS,RP0	; Bank 0
	movlw	0x00

;************************************************************************
	call	halte
	call	halte
	call	lcres
	movlw	0x61	; 
	call	lccmd
	movlw	0x42	;
	call	lccmd
	movlw	0x10	;
	call	lccmd
	movlw	0x3D	; 
	call	lccmd
	movlw	0x23	; 
	call	lccmd
	movlw	0x57	;
	call	lccmd
	movlw	0x7A	; 
	call	lccmd
	movlw	0x80	; 
	call	cls
	call	lccmd
	movlw	0xB0	; 
	call	lccmd
	movlw	0x4C	; 
	call	lcdta
	movlw	0x69	; 
	call	lcdta
	movlw	0x70	; 
	call	lcdta
	movlw	0x70	; 
	call	lcdta
	movlw	0x73	; 
	call	lcdta
	movlw	0xC0	; 
	call	lccmd
	movlw	0x46	; 
	call	lcdta
	movlw	0x59	; 
	call	lcdta
	movlw	0x46	; 
	call	lcdta
	movlw	0x59	; 
	call	lcdta
	movlw	0x24	; 
	call	lcdta
nou	goto	nou

;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;------------------------------------------------------------
lcdta	bsf	dorc
	bcf	enab	;activare chip si start date
	call	varsa
	bsf	enab
	return
;------------------------------------------------------------
lccmd	bcf	dorc
	bcf	enab	;activare chip si start comenzi
	call	varsa
	bsf	enab
	return
;------------------------------------------------------------
lcres	bsf	enab
	call	halte
	bsf	rset	;resetare
	call	halte
	return
;------------------------------------------------------------
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
	return
;------------------------------------------------------------
cls 
	movlw	0x0C
	movwf	count1
	movlw	0xB0	; 
	call	lccmd
wdh1	movlw	0x24	; 
	call	lcdta
	decfsz	count1,F	
	goto 	wdh1
	movlw	0xC0	; 
	call	lccmd
	movlw	0x0C
	movwf	count1
wdh2	movlw	0x24	; 
	call	lcdta
	decfsz	count1,F	
	goto 	wdh2
	movlw	0xF0	; 
	call	lccmd
	movlw	0x0C
	movwf	count1
wdh3	movlw	0x00	; 
	call	lcdta
	decfsz	count1,F	
	goto 	wdh3

	return
;************************************************************************
;	Subrutine de intarziere				 				*
;************************************************************************
halta	movlw	0x1F	; 92us
	movwf	count1
q0	decfsz	count1,F	
	goto 	q0
 	retlw	00
;________________________________________________________________________
haltb	movlw	0x10	; 47us
	movwf	count1
q1	decfsz	count1,F	
	goto 	q1		
 	retlw	0x00
;________________________________________________________________________
;------------------------------------------------------------
halte	movlw	0x07
	movwf	count3
d3	movlw	0x7F
	movwf	count1
d1	movlw	0xF0	  
	movwf	count2
d2	nop
	decfsz	count2,F	
	goto	d2		
	decfsz	count1,F	
	goto	d1		
	decfsz	count3,F    
	goto	d3          
	return
;============================================================

	end
;============================================================


Back to my home page

Last updated October, 2006

© Copyright 2006 Bergthaller Iulian-Alexandru