ON 20050603@2:42:23 PM at page: http://www.piclist.com/techref/member/peter_Oonion-bt-/index.htm#38506.6127662037 [peter_Oonion-bt-] Code: in a new file at: http://www.piclist.com/techref/member/peter_Oonion-bt-/LCD.htm
My code for drawing lines on a KS0108 based 128x64 LCD display
ON 20050603@2:46:40 PM at page: http://www.piclist.com/techref/member/peter_Oonion-bt-/LCD.htm#38506.6157407407 [peter_Oonion-bt-] Code:
;------------------------------------------------------
; Breshenham's line draw for KS0108 based 128x64 LCDs
; (C) Peter Onion 2005
; Use at your own risk !
;------------------------------------------------------
 	Processor       16F877	
        Radix   DEC
        EXPAND

        include         "p16f877.inc"

	
brWleF macro	F,dst
	subwf	F,W
	skpz
	skpc
	goto	$+2		; YUK!
	goto	dst
	endm



#define CNTLPORT PORTB
#define CNTLTRIS TRISB
#define DATAPORT PORTD
#define	DATATRIS TRISD
	;; For 20Mhz use 12.     Can be reduced at lower clock speeds
	;; For 12.288Mhz use 5   Select on test !
#define DELAY 12
	
		
	;; Definitions for bits in CNTLPORT 
	
#define CSABIT 0
#define CSBBIT 1
#define DIBIT 2
#define RWBIT  3
#define EBIT   4
#define RESETBIT 5

	;; Definitions for bits in the control word
#define	INCX 0
#define INCY 1
#define DECY 2
#define SETCS 3
#define SETPAGE 4
#define FLUSH 5
#define DONE 6
#define	SAVE 7
	

	;; Macros for bit twiddling on the control interface
	
WSTROBE	MACRO
	movlw	12
	movwf	scratch3
	decfsz	scratch3,F
	goto	$-1

	bsf	CNTLPORT,4		; Rising edge 
IF 0
	movlw	1
	movwf	scratch3
	decfsz	scratch3,F
	goto	$-1
ENDIF
	bcf	CNTLPORT,4		; Falling edge
					;  strobes data
	ENDM 	

RSTROBE	MACRO
	movlw	12
	movwf	scratch3
	decfsz	scratch3,F
	goto	$-1
	bsf	CNTLPORT,4		; Rising edge 
If 0
	movlw	1
	movwf	scratch3
	decfsz	scratch3,F
	goto	$-1
ENDIF
	movf	DATAPORT,W
	bcf	CNTLPORT,4		; Falling edge

	ENDM 	

	
	
SETELOW	MACRO
	bcf	CNTLPORT,4
	ENDM
	
		
SETW	MACRO
	bcf	CNTLPORT,3
	ENDM
	
	
SETR	MACRO
	bsf	CNTLPORT,3
	ENDM
	
	
SETD	MACRO
	bsf	CNTLPORT,2
	ENDM
	
SETI	MACRO
	bcf	CNTLPORT,2
	ENDM
	
	
RESETH	MACRO
	bsf	CNTLPORT,5
	ENDM
	
RESETL	MACRO
	bcf	CNTLPORT,5
	ENDM
	
		
SELA	MACRO
	bcf	CNTLPORT,0
	bsf	CNTLPORT,1
	ENDM
	
SELB	MACRO
	bsf	CNTLPORT,0
	bcf	CNTLPORT,1
	ENDM

SELBOTH	MACRO
	bcf	CNTLPORT,0
	bcf	CNTLPORT,1
	ENDM
	
SELNONE	MACRO
	bsf	CNTLPORT,0
	bsf	CNTLPORT,1
	ENDM
		
	
DATA1	UDATA	
x1	res 1			; Start ppint
y1	res 1
x2	res 1			; End point
y2	res 1
dx	res 1
dy	res 1
control	res 1
length	res 1
dec	res 1
	
d	res 1
aa	res 1
bb	res 1
temp	res 1
cachestart	res 1
currentbyte	res 1
cachelength	res 1 


count	res 1
pageNo	res 1
AA	res 1
BB	res 1
xpos	res 1
ypos	res 1
ctlCode	res 1			; bits
temp1	res 1
pixelbit res 1
		;; delay	res 1


	;; A cache that hold one "page" of pixels 
CacheRam	UDATA	
cache	res 64


	;; Scratch registers in shared bank. DO not assume they
	;; are preserved by any subroutines.
	extern scratch1,scratch2,scratch3,scratch4
	
	GLOBAL x1,y1,x2,y2

line	CODE


	;; Clear the LCD
	
clearLCD:

	clrf	scratch1	;  set page number to zero

	banksel	CNTLPORT
	SELBOTH			;  Write to both halves together
	SETW
	
	
clrloop:
	SETI
	movf	scratch1,W
	addlw	0xB8		;  set page number
	movwf	DATAPORT

	WSTROBE

	movlw	0x40		; set X address to 0
	movwf	DATAPORT

	WSTROBE
		
	movlw	64
	movwf	scratch2	; counter

	SETW
	SETD

	movlw	0x0		;  clear to OFF
	movwf	DATAPORT
clrloop1:
	
	WSTROBE
	decfsz	scratch2,F
	goto	clrloop1

	incf	scratch1,F	;  loop until page == 8
	btfss	scratch1,3
	goto	clrloop

	SETI
	SELNONE
	
	return


IF 0
	
fillcache:			; Test code to read 64 bytes from
				; LCD
	

	BANKSEL	CNTLPORT
	BANKISEL	cache	;  set up for indirect cahce access
	movlw	cache
	movwf	FSR
	

	movlw	64
	movwf	count

	SETI
	SETW
	
	movlw	0x40		; set y address to 0
	movwf	DATAPORT

	WSTROBE

	clrf	DATAPORT
	BANKSEL	TRISD
	movlw	0xFF
	movwf	TRISD
	BANKSEL DATAPORT

	SETD			; data
	SETR			; read
	
	RSTROBE			;  Dummy read
	movlw	0x40		; set y address to 0
	movwf	DATAPORT

	WSTROBE

	clrf	DATAPORT
	BANKSEL	TRISD
	movlw	0xFF
	movwf	TRISD
	BANKSEL DATAPORT

	SETD			; data
	SETR			; read

	RSTROBE			;  Dummy read

readloop:	

	RSTROBE			;  read the byte
	movwf	INDF		;  save in the cache
	
	incf	FSR,F
	decfsz	count,F
	goto	readloop

	BANKSEL	TRISD		;  reset portd to output
	movlw	0x00
	movwf	TRISD
	BANKSEL DATAPORT
	
	return
ENDIF	


	;; Write used part of cache back to the LCD
flushcache:
	
	BANKSEL	CNTLPORT
	BANKISEL	cache	;  set up for indirect cahce access
	
	movlw	cache
	movwf	FSR
	
	banksel	cachelength
	movf	cachelength,W
	movwf	scratch1	;  hold the counter

	banksel	CNTLPORT
	SETI
	SETW
	
	BANKSEL	DATATRIS	;  reset portd to output
	movlw	0x00
	movwf	DATATRIS

	
	


	banksel	cachestart	
	movlw	0x40		; set y address to first used
	addwf	cachestart,W	; byte in the cache
	banksel DATAPORT
	movwf	DATAPORT

	WSTROBE
	
	SETD			; data
	SETW			; write

	

	
flushloop:	
	
	
	movlw	DELAY
	movwf	scratch2
	decfsz	scratch2,F
	goto	$-1
	

	movf	INDF,W		;  read from the cache

	bsf	CNTLPORT,4	; Rising edge
	movwf	DATAPORT
	bcf	CNTLPORT,4	; Falling edge
				; strobes data


	
	incf	FSR,F
	decfsz	scratch1,F
	goto	flushloop
	
	return
	

linedraw:
	banksel	ctlCode

	clrf	ctlCode
	clrf	control

	comf	y1,F		; Make y = 0 the bottom rather 
	comf	y2,F		; than the top 

		
	movf	x1,W		; check moving left to right 
	subwf	x2,W		; and workout dx
	skpnc	
	goto	ld1
	sublw	0

	movwf	temp

	movf	x1,W		; swap end points so left to right
	movwf	temp1
	movf	x2,W
	movwf	x1
	movf	temp1,W
	movwf	x2

	movf	y1,W
	movwf	temp1
	movf	y2,W
	movwf	y1
	movf	temp1,W
	movwf	y2

	movf	temp,W

ld1
	movwf	dx		; dx = |x1 - x2|


	movf	y1,W
	subwf	y2,W
	skpnc	
	goto	ld2
	sublw	0	
	bsf	ctlCode,0	;  Going Up or Down
ld2
	movwf	dy		; dy = |y1 - y2|


	movf	dy,W		; test if steep or shallow line
	subwf	dx,W
	skpnc	
	goto	ld3

	movf	dx,W		; swap to make shallow
	movwf	temp
	movf	dy,W
	movwf	dx
	movf	temp,W
	movwf	dy
	
		
	bsf	ctlCode,1	;  set "steep flag"
ld3
	clrf	dec
	bcf	STATUS,C
	rrf	dx,W		; W = dx >> 1
	rlf	dec,F		; dec = dx & 1
	subwf	dy,W		; W = dy - (dx >> 1)
	movwf	d		; d = W

	movf	dx,W
	subwf	dy,W
	movwf	AA		; A = dy -dx

	movf	dy,W
	movwf	BB		;  B = dy

	movf	AA,W
	subwf	dec,F		;  dec -= A
	subwf	d,F		;  d   -= A

	movf	dx,W
	sublw	0
	movwf	AA		; A = -dx

	
	movf	x1,W		; set up for looping
	movwf	xpos
	movf	y1,W
	movwf	ypos
	movf	dx,W
	movwf	length
	
	clrf	control		; set the inital actions to take
	bsf	control,SETCS	; setup the Chip Selects
	bsf	control,SETPAGE	; set the page number
	bsf	control,SAVE	; 
	
	movf	ypos,W		; Set correct bit in pixelbit  
	andlw	0x7		; for the y position
	addlw	0x1
	movwf	temp
	
	clrf	pixelbit
	bsf	STATUS,C
setyloop:	
	rlf	pixelbit,F
	decfsz	temp,F
	goto	setyloop

	;; loop back here if step over to right hand side
setcs:	banksel	control
	btfss	control,SETCS
	goto	pageSet

	bcf	control,SETCS
	btfsc	xpos,6		; set correct Chip select
	goto	setcs1

	banksel	CNTLPORT
	SELA
	goto	pageSet

setcs1:	banksel	CNTLPORT
	SELB

pageSet:banksel	control
	btfss	control,SETPAGE
	goto	initcache


	
	movf	ypos,W		; set y page address in controler
	movwf	pageNo
	rrf	pageNo,F
	rrf	pageNo,F
	rrf	pageNo,F
	movlw	0x7
	andwf	pageNo,F
	movf	pageNo,W	
	addlw	0xB8
	banksel	DATAPORT
	movwf	DATAPORT
	
	SETI
	SETW
	
	WSTROBE

initcache:	
	bankisel cache
	banksel	cachelength
	
	clrf	cachelength	; initialise the cache
	movlw	cache
	movwf	FSR
	
	movf	xpos,W
	andlw	0x3F
	movwf	cachestart

	movlw	0x40		; set x address 
	addwf	cachestart,W
	banksel	DATAPORT	
	movwf	DATAPORT

	WSTROBE

	clrf	DATAPORT		;  prepare to read from controler
	BANKSEL	DATATRIS
	movlw	0xFF
	movwf	DATATRIS
	BANKSEL DATAPORT

	SETD			; data
	SETR			; read

	RSTROBE			;  Dummy read

readbyte:
	banksel	control
	btfss	control,SAVE
	goto	dontread

	banksel	DATAPORT
	RSTROBE			;  read the byte
	banksel	currentbyte
	movwf	currentbyte

dontread:
	movf	pixelbit,W	;  set the bit
	iorwf	currentbyte,F

	btfsc	control,DONE	; test end flag
	goto	alldone

	clrf	control		;  reset all the flags

	;; DANGER DANGER.....  Check for page boundry !!
here:	banksel	ctlCode
	movlw	high $	
	movwf	PCLATH		; page 
	movf	ctlCode,W
	andlw	0x7
	
	addwf	PCL,F
	goto	code0
	goto	code1
	goto	code2
	goto	code3
	
code0:	
	movf	d,W
	brWleF	dec,code01

	movf	AA,W
	addwf	d,F

	bsf	control,INCY
code01:	movf	BB,W
	addwf	d,F
	bsf	control,INCX
	goto	common


code1:	movf	d,W
	brWleF	dec,code11

	movf	AA,W
	addwf	d,F
	
	bsf	control,DECY
code11:	movf	BB,W
	addwf	d,F
	bsf	control,INCX
	goto	common

	
code2:	
	movf	d,W
	brWleF	dec,code21

	movf	AA,W
	addwf	d,F
	
	bsf	control,INCX
code21:	movf	BB,W
	addwf	d,F
	bsf	control,INCY
	goto	common

	
code3:	movf	d,W
	brWleF	dec,code31

	movf	AA,W
	addwf	d,F

	bsf	control,INCX
code31:	movf	BB,W
	addwf	d,F
	bsf	control,DECY
	goto	common
	
	

common:	
	decf	length,F
	skpnz
	bsf	control,DONE

	btfss	control,INCX	;  did we move to the right ?
	goto	checkINCY

					
	bsf	control,SAVE
	movf	xpos,W		; increment X
	incf	xpos,F
	xorwf	xpos,W
	movwf	temp1
	btfss	temp1,6		; test for left-to-right change
	goto	checkINCY
	
	bsf	control,FLUSH	; set flush
	bsf	control,SETCS	; set setCS
	bsf	control,SETPAGE
checkINCY:	
	
	btfss	control,INCY	;  did we move down ?
	goto	checkDECY
	
	incf	ypos,F
	bcf	STATUS,C
	rlf	pixelbit,F	; move bit
	btfss	STATUS,C	; if carry set, we ned to move to next bank
	goto	checksave

	rlf	pixelbit,F	
	bsf	control,SETPAGE
	bsf	control,SAVE
	bsf	control,FLUSH
	goto	checksave

checkDECY:
	btfss	control,DECY	;  did we move up ?
	goto	checksave
	
	decf	ypos,F
	bcf	STATUS,C
	rrf	pixelbit,F
	btfss	STATUS,C
	goto	checksave

	rrf	pixelbit,F
	bsf	control,SETPAGE
	bsf	control,SAVE
	bsf	control,FLUSH
	goto	checksave	

checksave:			; do we need to save byte to cache ?
	btfss	control,SAVE
	goto	checkflush
	
	movf	currentbyte,W	;  write byte to cache
	movwf	INDF
	incf	FSR,F
	incf	cachelength,F
	
checkflush:			; do we need to flush the cache ?
	btfss	control,FLUSH
	goto	readbyte

	call	flushcache

	goto	setcs


alldone:			;  write endpoint and flush cache
	movf	currentbyte,W
	movwf	INDF
	incf	FSR,F
	incf	cachelength,F
	
	call	flushcache
	return

initGRLCD:	

	banksel	DATATRIS
	clrf	DATATRIS
	clrf	CNTLTRIS
	
	banksel	DATAPORT	
	
	RESETL			; 5      XX0XXXXX
		
	SELBOTH			; 0 1    XX0XXX00
		

	SETELOW			; 4      XX00XX00
	SETI			; 2      XX00X000
	SETW			; 3      XX000000
	RESETH			;        XX100000
	
	movlw	0x3F		; Display ON
	movwf	DATAPORT
	movlw	9
	movwf	scratch1
	decfsz	scratch1,F
	goto	$-1

	WSTROBE	
	
	movlw	0x40		; set x address to 0
	movwf	DATAPORT
	WSTROBE
	
	movlw	0xBF		;  set page to 0 
	movwf	DATAPORT
	WSTROBE

	movlw	0xC0		;  set display start line to 0
	movwf	DATAPORT
	WSTROBE
	return

	
		
	GLOBAL	linedraw,initGRLCD,clearLCD
	
	END
ON 20050603@2:48:38 PM at page: http://www.piclist.com/techref/member/peter_Oonion-bt-/LCD.htm# [peter_Oonion-bt-] edited the page. Difference: http://www.piclist.com/techref/diff.asp?url=H:\techref\member\peter_Oonion-bt-\LCD.htm&version=1 ON 20050603@2:50:04 PM at page: http://www.piclist.com/techref/member/peter_Oonion-bt-/LCD.htm# [peter_Oonion-bt-] edited the page. Difference: http://www.piclist.com/techref/diff.asp?url=H:\techref\member\peter_Oonion-bt-\LCD.htm&version=2 ON 20050603@2:59:46 PM at page: http://www.piclist.com/techref/member/peter_Oonion-bt-/index.htm# [peter_Oonion-bt-] edited the page. Difference: http://www.piclist.com/techref/diff.asp?url=H:\techref\member\peter_Oonion-bt-\index.htm&version=1 ON 20050603@3:00:19 PM at page: http://www.piclist.com/techref/member/peter_Oonion-bt-/index.htm# [peter_Oonion-bt-] edited the page. Difference: http://www.piclist.com/techref/diff.asp?url=H:\techref\member\peter_Oonion-bt-\index.htm&version=2 ON 20050603@3:01:35 PM at page: http://www.piclist.com/techref/member/peter_Oonion-bt-/index.htm# [peter_Oonion-bt-] edited the page. Difference: http://www.piclist.com/techref/diff.asp?url=H:\techref\member\peter_Oonion-bt-\index.htm&version=3 ON 20050603@3:02:33 PM at page: http://www.piclist.com/techref/member/peter_Oonion-bt-/index.htm#38506.6267708333 [peter_Oonion-bt-] Says /techref/member/peter_Oonion-bt-/LCD.htm Here is the LCD code I promised ON 20050603@3:05:17 PM at page: http://www.piclist.com/techref/member/peter_Oonion-bt-/index.htm# [peter_Oonion-bt-] I have agreed to maintain this page. ON 20050603@3:05:58 PM at page: http://www.piclist.com/techref/member/peter_Oonion-bt-/index.htm# [peter_Oonion-bt-] edited the page. Difference: http://www.piclist.com/techref/diff.asp?url=H:\techref\member\peter_Oonion-bt-\index.htm&version=6 ON 20050603@3:06:28 PM at page: http://www.piclist.com/techref/member/peter_Oonion-bt-/index.htm# [peter_Oonion-bt-] I have agreed to maintain this page. ON 20050603@3:07:11 PM at page: http://www.piclist.com/techref/member/peter_Oonion-bt-/index.htm# [peter_Oonion-bt-] edited the page. Difference: http://www.piclist.com/techref/diff.asp?url=H:\techref\member\peter_Oonion-bt-\index.htm&version=8 ON 20050603@3:09:16 PM at page: http://www.piclist.com/techref/member/peter_Oonion-bt-/index.htm#38506.6314351852 [peter_Oonion-bt-] Says /techref/member/peter_Oonion-bt-/LCD.htm Here is the LCD code I promised ON 20050603@3:09:45 PM at page: http://www.piclist.com/techref/member/peter_Oonion-bt-/index.htm# [peter_Oonion-bt-] I have agreed to maintain this page. ON 20050603@3:10:19 PM at page: http://www.piclist.com/techref/member/peter_Oonion-bt-/index.htm# [peter_Oonion-bt-] edited the page. Difference: http://www.piclist.com/techref/diff.asp?url=H:\techref\member\peter_Oonion-bt-\index.htm&version=11 ON 20050603@3:10:42 PM at page: http://www.piclist.com/techref/member/peter_Oonion-bt-/index.htm# [peter_Oonion-bt-] edited the page. Difference: http://www.piclist.com/techref/diff.asp?url=H:\techref\member\peter_Oonion-bt-\index.htm&version=12 ON 20050603@3:18:30 PM at page: http://www.piclist.com/techref/member/peter_Oonion-bt-/index.htm# [peter_Oonion-bt-] edited the page. Difference: http://www.piclist.com/techref/diff.asp?url=H:\techref\member\peter_Oonion-bt-\index.htm&version=13 ON 20050603@3:21:05 PM at page: http://www.piclist.com/techref/member/peter_Oonion-bt-/index.htm#38506.6314351852 [peter_Oonion-bt-] removed post 38506.6314351852 |Delete ' Says: " Here is the LCD code I promised " ' ON 20050603@3:22:06 PM at page: http://www.piclist.com/techref/member/peter_Oonion-bt-/index.htm#38506.6403472222 [peter_Oonion-bt-] Says in a new file at: http://www.piclist.com/techref/member/peter_Oonion-bt-/linedraw.htm Here is the line drawing code I promised ON 20050603@3:22:37 PM at page: http://www.piclist.com/techref/member/peter_Oonion-bt-/index.htm#38506.6406944444 [peter_Oonion-bt-] Code:
This is the code
ON 20050603@3:23:25 PM at page: http://www.piclist.com/techref/member/peter_Oonion-bt-/linedraw.htm#38506.6412615741 [peter_Oonion-bt-] Questions: ;------------------------------------------------------
; Breshenham's line draw for KS0108 based 128x64 LCDs
; (C) Peter Onion 2005
; Use at your own risk !
;------------------------------------------------------
Processor 16F877
Radix DEC
EXPAND

include "p16f877.inc"


brWleF macro F,dst
subwf F,W
skpz
skpc
goto $+2 ; YUK!
goto dst
endm



#define CNTLPORT PORTB
#define CNTLTRIS TRISB
#define DATAPORT PORTD
#define DATATRIS TRISD
;; For 20Mhz use 12. Can be reduced at lower clock speeds
;; For 12.288Mhz use 5 Select on test !
#define DELAY 12


;; Definitions for bits in CNTLPORT

#define CSABIT 0
#define CSBBIT 1
#define DIBIT 2
#define RWBIT 3
#define EBIT 4
#define RESETBIT 5

;; Definitions for bits in the control word
#define INCX 0
#define INCY 1
#define DECY 2
#define SETCS 3
#define SETPAGE 4
#define FLUSH 5
#define DONE 6
#define SAVE 7


;; Macros for bit twiddling on the control interface

WSTROBE MACRO
movlw 12
movwf scratch3
decfsz scratch3,F
goto $-1

bsf CNTLPORT,EBIT ; Rising edge
IF 0
movlw 1
movwf scratch3
decfsz scratch3,F
goto $-1
ENDIF
bcf CNTLPORT,EBIT ; Falling edge
; strobes data
ENDM

RSTROBE MACRO
movlw 12
movwf scratch3
decfsz scratch3,F
goto $-1
bsf CNTLPORT,EBIT ; Rising edge
If 0
movlw 1
movwf scratch3
decfsz scratch3,F
goto $-1
ENDIF
movf DATAPORT,W
bcf CNTLPORT,EBIT ; Falling edge

ENDM



SETELOW MACRO
bcf CNTLPORT,EBIT
ENDM


SETW MACRO
bcf CNTLPORT,RWBIT
ENDM


SETR MACRO
bsf CNTLPORT,RWBIT
ENDM


SETD MACRO
bsf CNTLPORT,DIBIT
ENDM

SETI MACRO
bcf CNTLPORT,DIBIT
ENDM


RESETH MACRO
bsf CNTLPORT,RESETBIT
ENDM

RESETL MACRO
bcf CNTLPORT,RESETBIT
ENDM


SELA MACRO
bcf CNTLPORT,CSABIT
bsf CNTLPORT,CSBBIT
ENDM

SELB MACRO
bsf CNTLPORT,CSABIT
bcf CNTLPORT,CSBBIT
ENDM

SELBOTH MACRO
bcf CNTLPORT,CSABIT
bcf CNTLPORT,CSBBIT
ENDM

SELNONE MACRO
bsf CNTLPORT,CSABIT
bsf CNTLPORT,CSBBIT
ENDM


DATA1 UDATA
x1 res 1 ; Start ppint
y1 res 1
x2 res 1 ; End point
y2 res 1
dx res 1
dy res 1
control res 1
length res 1
dec res 1

d res 1
aa res 1
bb res 1
temp res 1
cachestart res 1
currentbyte res 1
cachelength res 1


count res 1
pageNo res 1
AA res 1
BB res 1
xpos res 1
ypos res 1
ctlCode res 1 ; bits
temp1 res 1
pixelbit res 1
;; delay res 1


;; A cache that hold one "page" of pixels
CacheRam UDATA
cache res 64


;; Scratch registers in shared bank. DO not assume they
;; are preserved by any subroutines.
extern scratch1,scratch2,scratch3,scratch4

GLOBAL x1,y1,x2,y2

line CODE


;; Clear the LCD

clearLCD:

clrf scratch1 ; set page number to zero

banksel CNTLPORT
SELBOTH ; Write to both halves together
SETW


clrloop:
SETI
movf scratch1,W
addlw 0xB8 ; set page number
movwf DATAPORT

WSTROBE

movlw 0x40 ; set X address to 0
movwf DATAPORT

WSTROBE

movlw 64
movwf scratch2 ; counter

SETW
SETD

movlw 0x0 ; clear to OFF
movwf DATAPORT
clrloop1:

WSTROBE
decfsz scratch2,F
goto clrloop1

incf scratch1,F ; loop until page == 8
btfss scratch1,3
goto clrloop

SETI
SELNONE

return


IF 0

fillcache: ; Test code to read 64 bytes from
; LCD


BANKSEL CNTLPORT
BANKISEL cache ; set up for indirect cahce access
movlw cache
movwf FSR


movlw 64
movwf count

SETI
SETW

movlw 0x40 ; set y address to 0
movwf DATAPORT

WSTROBE

clrf DATAPORT
BANKSEL TRISD
movlw 0xFF
movwf TRISD
BANKSEL DATAPORT

SETD ; data
SETR ; read

RSTROBE ; Dummy read
movlw 0x40 ; set y address to 0
movwf DATAPORT

WSTROBE

clrf DATAPORT
BANKSEL TRISD
movlw 0xFF
movwf TRISD
BANKSEL DATAPORT

SETD ; data
SETR ; read

RSTROBE ; Dummy read

readloop:

RSTROBE ; read the byte
movwf INDF ; save in the cache

incf FSR,F
decfsz count,F
goto readloop

BANKSEL TRISD ; reset portd to output
movlw 0x00
movwf TRISD
BANKSEL DATAPORT

return
ENDIF


;; Write used part of cache back to the LCD
flushcache:

BANKSEL CNTLPORT
BANKISEL cache ; set up for indirect cahce access

movlw cache
movwf FSR

banksel cachelength
movf cachelength,W
movwf scratch1 ; hold the counter

banksel CNTLPORT
SETI
SETW

BANKSEL DATATRIS ; reset portd to output
movlw 0x00
movwf DATATRIS





banksel cachestart
movlw 0x40 ; set y address to first used
addwf cachestart,W ; byte in the cache
banksel DATAPORT
movwf DATAPORT

WSTROBE

SETD ; data
SETW ; write




flushloop:


movlw DELAY
movwf scratch2
decfsz scratch2,F
goto $-1


movf INDF,W ; read from the cache

bsf CNTLPORT,EBIT ; Rising edge
movwf DATAPORT
bcf CNTLPORT,EBIT ; Falling edge
; strobes data



incf FSR,F
decfsz scratch1,F
goto flushloop

return


linedraw:
banksel ctlCode

clrf ctlCode
clrf control

comf y1,F ; Make y = 0 the bottom rather
comf y2,F ; than the top


movf x1,W ; check moving left to right
subwf x2,W ; and workout dx
skpnc
goto ld1
sublw 0

movwf temp

movf x1,W ; swap end points so left to right
movwf temp1
movf x2,W
movwf x1
movf temp1,W
movwf x2

movf y1,W
movwf temp1
movf y2,W
movwf y1
movf temp1,W
movwf y2

movf temp,W

ld1
movwf dx ; dx = |x1 - x2|


movf y1,W
subwf y2,W
skpnc
goto ld2
sublw 0
bsf ctlCode,0 ; Going Up or Down
ld2
movwf dy ; dy = |y1 - y2|


movf dy,W ; test if steep or shallow line
subwf dx,W
skpnc
goto ld3

movf dx,W ; swap to make shallow
movwf temp
movf dy,W
movwf dx
movf temp,W
movwf dy


bsf ctlCode,1 ; set "steep flag"
ld3
clrf dec
bcf STATUS,C
rrf dx,W ; W = dx >> 1
rlf dec,F ; dec = dx & 1
subwf dy,W ; W = dy - (dx >> 1)
movwf d ; d = W

movf dx,W
subwf dy,W
movwf AA ; A = dy -dx

movf dy,W
movwf BB ; B = dy

movf AA,W
subwf dec,F ; dec -= A
subwf d,F ; d -= A

movf dx,W
sublw 0
movwf AA ; A = -dx


movf x1,W ; set up for looping
movwf xpos
movf y1,W
movwf ypos
movf dx,W
movwf length

clrf control ; set the inital actions to take
bsf control,SETCS ; setup the Chip Selects
bsf control,SETPAGE ; set the page number
bsf control,SAVE ;

movf ypos,W ; Set correct bit in pixelbit
andlw 0x7 ; for the y position
addlw 0x1
movwf temp

clrf pixelbit
bsf STATUS,C
setyloop:
rlf pixelbit,F
decfsz temp,F
goto setyloop

;; loop back here if step over to right hand side
setcs: banksel control
btfss control,SETCS
goto pageSet

bcf control,SETCS
btfsc xpos,6 ; set correct Chip select
goto setcs1

banksel CNTLPORT
SELA
goto pageSet

setcs1: banksel CNTLPORT
SELB

pageSet:banksel control
btfss control,SETPAGE
goto initcache



movf ypos,W ; set y page address in controler
movwf pageNo
rrf pageNo,F
rrf pageNo,F
rrf pageNo,F
movlw 0x7
andwf pageNo,F
movf pageNo,W
addlw 0xB8
banksel DATAPORT
movwf DATAPORT

SETI
SETW

WSTROBE

initcache:
bankisel cache
banksel cachelength

clrf cachelength ; initialise the cache
movlw cache
movwf FSR

movf xpos,W
andlw 0x3F
movwf cachestart

movlw 0x40 ; set x address
addwf cachestart,W
banksel DATAPORT
movwf DATAPORT

WSTROBE

clrf DATAPORT ; prepare to read from controler
BANKSEL DATATRIS
movlw 0xFF
movwf DATATRIS
BANKSEL DATAPORT

SETD ; data
SETR ; read

RSTROBE ; Dummy read

readbyte:
banksel control
btfss control,SAVE
goto dontread

banksel DATAPORT
RSTROBE ; read the byte
banksel currentbyte
movwf currentbyte

dontread:
movf pixelbit,W ; set the bit
iorwf currentbyte,F

btfsc control,DONE ; test end flag
goto alldone

clrf control ; reset all the flags

;; DANGER DANGER..... Check for page boundry !!
here: banksel ctlCode
movlw high $
movwf PCLATH ; page
movf ctlCode,W
andlw 0x7

addwf PCL,F
goto code0
goto code1
goto code2
goto code3

code0:
movf d,W
brWleF dec,code01

movf AA,W
addwf d,F

bsf control,INCY
code01: movf BB,W
addwf d,F
bsf control,INCX
goto common


code1: movf d,W
brWleF dec,code11

movf AA,W
addwf d,F

bsf control,DECY
code11: movf BB,W
addwf d,F
bsf control,INCX
goto common


code2:
movf d,W
brWleF dec,code21

movf AA,W
addwf d,F

bsf control,INCX
code21: movf BB,W
addwf d,F
bsf control,INCY
goto common


code3: movf d,W
brWleF dec,code31

movf AA,W
addwf d,F

bsf control,INCX
code31: movf BB,W
addwf d,F
bsf control,DECY
goto common



common:
decf length,F
skpnz
bsf control,DONE

btfss control,INCX ; did we move to the right ?
goto checkINCY


bsf control,SAVE
movf xpos,W ; increment X
incf xpos,F
xorwf xpos,W
movwf temp1
btfss temp1,6 ; test for left-to-right change
goto checkINCY

bsf control,FLUSH ; set flush
bsf control,SETCS ; set setCS
bsf control,SETPAGE
checkINCY:

btfss control,INCY ; did we move down ?
goto checkDECY

incf ypos,F
bcf STATUS,C
rlf pixelbit,F ; move bit
btfss STATUS,C ; if carry set, we ned to move to next bank
goto checksave

rlf pixelbit,F
bsf control,SETPAGE
bsf control,SAVE
bsf control,FLUSH
goto checksave

checkDECY:
btfss control,DECY ; did we move up ?
goto checksave

decf ypos,F
bcf STATUS,C
rrf pixelbit,F
btfss STATUS,C
goto checksave

rrf pixelbit,F
bsf control,SETPAGE
bsf control,SAVE
bsf control,FLUSH
goto checksave

checksave: ; do we need to save byte to cache ?
btfss control,SAVE
goto checkflush

movf currentbyte,W ; write byte to cache
movwf INDF
incf FSR,F
incf cachelength,F

checkflush: ; do we need to flush the cache ?
btfss control,FLUSH
goto readbyte

call flushcache

goto setcs


alldone: ; write endpoint and flush cache
movf currentbyte,W
movwf INDF
incf FSR,F
incf cachelength,F

call flushcache
return

initGRLCD:

banksel DATATRIS
clrf DATATRIS
clrf CNTLTRIS

banksel DATAPORT

RESETL ; 5 XX0XXXXX

SELBOTH ; 0 1 XX0XXX00


SETELOW ; 4 XX00XX00
SETI ; 2 XX00X000
SETW ; 3 XX000000
RESETH ; XX100000

movlw 0x3F ; Display ON
movwf DATAPORT
movlw 9
movwf scratch1
decfsz scratch1,F
goto $-1

WSTROBE

movlw 0x40 ; set x address to 0
movwf DATAPORT
WSTROBE

movlw 0xBF ; set page to 0
movwf DATAPORT
WSTROBE

movlw 0xC0 ; set display start line to 0
movwf DATAPORT
WSTROBE
return



GLOBAL linedraw,initGRLCD,clearLCD

END
ON 20050603@3:25:12 PM at page: http://www.piclist.com/techref/member/peter_Oonion-bt-/linedraw.htm#38506.6425 [peter_Oonion-bt-] Code:
;------------------------------------------------------
; Breshenham's line draw for KS0108 based 128x64 LCDs
; (C) Peter Onion 2005
; Use at your own risk !
;------------------------------------------------------ 
	Processor       16F877	
        Radix   DEC
        EXPAND

        include         "p16f877.inc"

	
brWleF macro	F,dst
	subwf	F,W
	skpz
	skpc
	goto	$+2		; YUK!
	goto	dst
	endm



#define CNTLPORT PORTB
#define CNTLTRIS TRISB
#define DATAPORT PORTD
#define	DATATRIS TRISD
	;; For 20Mhz use 12.     Can be reduced at lower clock speeds
	;; For 12.288Mhz use 5   Select on test !
#define DELAY 12
	
		
	;; Definitions for bits in CNTLPORT 
	
#define CSABIT 0
#define CSBBIT 1
#define DIBIT 2
#define RWBIT  3
#define EBIT   4
#define RESETBIT 5

	;; Definitions for bits in the control word
#define	INCX 0
#define INCY 1
#define DECY 2
#define SETCS 3
#define SETPAGE 4
#define FLUSH 5
#define DONE 6
#define	SAVE 7
	

	;; Macros for bit twiddling on the control interface
	
WSTROBE	MACRO
	movlw	12
	movwf	scratch3
	decfsz	scratch3,F
	goto	$-1

	bsf	CNTLPORT,EBIT		; Rising edge 
IF 0
	movlw	1
	movwf	scratch3
	decfsz	scratch3,F
	goto	$-1
ENDIF
	bcf	CNTLPORT,EBIT		; Falling edge
					;  strobes data
	ENDM 	

RSTROBE	MACRO
	movlw	12
	movwf	scratch3
	decfsz	scratch3,F
	goto	$-1
	bsf	CNTLPORT,EBIT		; Rising edge 
If 0
	movlw	1
	movwf	scratch3
	decfsz	scratch3,F
	goto	$-1
ENDIF
	movf	DATAPORT,W
	bcf	CNTLPORT,EBIT		; Falling edge

	ENDM 	

	
	
SETELOW	MACRO
	bcf	CNTLPORT,EBIT
	ENDM
	
		
SETW	MACRO
	bcf	CNTLPORT,RWBIT
	ENDM
	
	
SETR	MACRO
	bsf	CNTLPORT,RWBIT
	ENDM
	
	
SETD	MACRO
	bsf	CNTLPORT,DIBIT
	ENDM
	
SETI	MACRO
	bcf	CNTLPORT,DIBIT
	ENDM
	
	
RESETH	MACRO
	bsf	CNTLPORT,RESETBIT
	ENDM
	
RESETL	MACRO
	bcf	CNTLPORT,RESETBIT
	ENDM
	
		
SELA	MACRO
	bcf	CNTLPORT,CSABIT
	bsf	CNTLPORT,CSBBIT
	ENDM
	
SELB	MACRO
	bsf	CNTLPORT,CSABIT
	bcf	CNTLPORT,CSBBIT
	ENDM

SELBOTH	MACRO
	bcf	CNTLPORT,CSABIT
	bcf	CNTLPORT,CSBBIT
	ENDM
	
SELNONE	MACRO
	bsf	CNTLPORT,CSABIT
	bsf	CNTLPORT,CSBBIT
	ENDM
		
	
DATA1	UDATA	
x1	res 1			; Start ppint
y1	res 1
x2	res 1			; End point
y2	res 1
dx	res 1
dy	res 1
control	res 1
length	res 1
dec	res 1
	
d	res 1
aa	res 1
bb	res 1
temp	res 1
cachestart	res 1
currentbyte	res 1
cachelength	res 1 


count	res 1
pageNo	res 1
AA	res 1
BB	res 1
xpos	res 1
ypos	res 1
ctlCode	res 1			; bits
temp1	res 1
pixelbit res 1
		;; delay	res 1


	;; A cache that hold one "page" of pixels 
CacheRam	UDATA	
cache	res 64


	;; Scratch registers in shared bank. DO not assume they
	;; are preserved by any subroutines.
	extern scratch1,scratch2,scratch3,scratch4
	
	GLOBAL x1,y1,x2,y2

line	CODE


	;; Clear the LCD
	
clearLCD:

	clrf	scratch1	;  set page number to zero

	banksel	CNTLPORT
	SELBOTH			;  Write to both halves together
	SETW
	
	
clrloop:
	SETI
	movf	scratch1,W
	addlw	0xB8		;  set page number
	movwf	DATAPORT

	WSTROBE

	movlw	0x40		; set X address to 0
	movwf	DATAPORT

	WSTROBE
		
	movlw	64
	movwf	scratch2	; counter

	SETW
	SETD

	movlw	0x0		;  clear to OFF
	movwf	DATAPORT
clrloop1:
	
	WSTROBE
	decfsz	scratch2,F
	goto	clrloop1

	incf	scratch1,F	;  loop until page == 8
	btfss	scratch1,3
	goto	clrloop

	SETI
	SELNONE
	
	return


IF 0
	
fillcache:			; Test code to read 64 bytes from
				; LCD
	

	BANKSEL	CNTLPORT
	BANKISEL	cache	;  set up for indirect cahce access
	movlw	cache
	movwf	FSR
	

	movlw	64
	movwf	count

	SETI
	SETW
	
	movlw	0x40		; set y address to 0
	movwf	DATAPORT

	WSTROBE

	clrf	DATAPORT
	BANKSEL	TRISD
	movlw	0xFF
	movwf	TRISD
	BANKSEL DATAPORT

	SETD			; data
	SETR			; read
	
	RSTROBE			;  Dummy read
	movlw	0x40		; set y address to 0
	movwf	DATAPORT

	WSTROBE

	clrf	DATAPORT
	BANKSEL	TRISD
	movlw	0xFF
	movwf	TRISD
	BANKSEL DATAPORT

	SETD			; data
	SETR			; read

	RSTROBE			;  Dummy read

readloop:	

	RSTROBE			;  read the byte
	movwf	INDF		;  save in the cache
	
	incf	FSR,F
	decfsz	count,F
	goto	readloop

	BANKSEL	TRISD		;  reset portd to output
	movlw	0x00
	movwf	TRISD
	BANKSEL DATAPORT
	
	return
ENDIF	


	;; Write used part of cache back to the LCD
flushcache:
	
	BANKSEL	CNTLPORT
	BANKISEL	cache	;  set up for indirect cahce access
	
	movlw	cache
	movwf	FSR
	
	banksel	cachelength
	movf	cachelength,W
	movwf	scratch1	;  hold the counter

	banksel	CNTLPORT
	SETI
	SETW
	
	BANKSEL	DATATRIS	;  reset portd to output
	movlw	0x00
	movwf	DATATRIS

	
	


	banksel	cachestart	
	movlw	0x40		; set y address to first used
	addwf	cachestart,W	; byte in the cache
	banksel DATAPORT
	movwf	DATAPORT

	WSTROBE
	
	SETD			; data
	SETW			; write

	

	
flushloop:	
	
	
	movlw	DELAY
	movwf	scratch2
	decfsz	scratch2,F
	goto	$-1
	

	movf	INDF,W		;  read from the cache

	bsf	CNTLPORT,EBIT	; Rising edge
	movwf	DATAPORT
	bcf	CNTLPORT,EBIT	; Falling edge
				; strobes data


	
	incf	FSR,F
	decfsz	scratch1,F
	goto	flushloop
	
	return
	

linedraw:
	banksel	ctlCode

	clrf	ctlCode
	clrf	control

	comf	y1,F		; Make y = 0 the bottom rather 
	comf	y2,F		; than the top 

		
	movf	x1,W		; check moving left to right 
	subwf	x2,W		; and workout dx
	skpnc	
	goto	ld1
	sublw	0

	movwf	temp

	movf	x1,W		; swap end points so left to right
	movwf	temp1
	movf	x2,W
	movwf	x1
	movf	temp1,W
	movwf	x2

	movf	y1,W
	movwf	temp1
	movf	y2,W
	movwf	y1
	movf	temp1,W
	movwf	y2

	movf	temp,W

ld1
	movwf	dx		; dx = |x1 - x2|


	movf	y1,W
	subwf	y2,W
	skpnc	
	goto	ld2
	sublw	0	
	bsf	ctlCode,0	;  Going Up or Down
ld2
	movwf	dy		; dy = |y1 - y2|


	movf	dy,W		; test if steep or shallow line
	subwf	dx,W
	skpnc	
	goto	ld3

	movf	dx,W		; swap to make shallow
	movwf	temp
	movf	dy,W
	movwf	dx
	movf	temp,W
	movwf	dy
	
		
	bsf	ctlCode,1	;  set "steep flag"
ld3
	clrf	dec
	bcf	STATUS,C
	rrf	dx,W		; W = dx >> 1
	rlf	dec,F		; dec = dx & 1
	subwf	dy,W		; W = dy - (dx >> 1)
	movwf	d		; d = W

	movf	dx,W
	subwf	dy,W
	movwf	AA		; A = dy -dx

	movf	dy,W
	movwf	BB		;  B = dy

	movf	AA,W
	subwf	dec,F		;  dec -= A
	subwf	d,F		;  d   -= A

	movf	dx,W
	sublw	0
	movwf	AA		; A = -dx

	
	movf	x1,W		; set up for looping
	movwf	xpos
	movf	y1,W
	movwf	ypos
	movf	dx,W
	movwf	length
	
	clrf	control		; set the inital actions to take
	bsf	control,SETCS	; setup the Chip Selects
	bsf	control,SETPAGE	; set the page number
	bsf	control,SAVE	; 
	
	movf	ypos,W		; Set correct bit in pixelbit  
	andlw	0x7		; for the y position
	addlw	0x1
	movwf	temp
	
	clrf	pixelbit
	bsf	STATUS,C
setyloop:	
	rlf	pixelbit,F
	decfsz	temp,F
	goto	setyloop

	;; loop back here if step over to right hand side
setcs:	banksel	control
	btfss	control,SETCS
	goto	pageSet

	bcf	control,SETCS
	btfsc	xpos,6		; set correct Chip select
	goto	setcs1

	banksel	CNTLPORT
	SELA
	goto	pageSet

setcs1:	banksel	CNTLPORT
	SELB

pageSet:banksel	control
	btfss	control,SETPAGE
	goto	initcache


	
	movf	ypos,W		; set y page address in controler
	movwf	pageNo
	rrf	pageNo,F
	rrf	pageNo,F
	rrf	pageNo,F
	movlw	0x7
	andwf	pageNo,F
	movf	pageNo,W	
	addlw	0xB8
	banksel	DATAPORT
	movwf	DATAPORT
	
	SETI
	SETW
	
	WSTROBE

initcache:	
	bankisel cache
	banksel	cachelength
	
	clrf	cachelength	; initialise the cache
	movlw	cache
	movwf	FSR
	
	movf	xpos,W
	andlw	0x3F
	movwf	cachestart

	movlw	0x40		; set x address 
	addwf	cachestart,W
	banksel	DATAPORT	
	movwf	DATAPORT

	WSTROBE

	clrf	DATAPORT		;  prepare to read from controler
	BANKSEL	DATATRIS
	movlw	0xFF
	movwf	DATATRIS
	BANKSEL DATAPORT

	SETD			; data
	SETR			; read

	RSTROBE			;  Dummy read

readbyte:
	banksel	control
	btfss	control,SAVE
	goto	dontread

	banksel	DATAPORT
	RSTROBE			;  read the byte
	banksel	currentbyte
	movwf	currentbyte

dontread:
	movf	pixelbit,W	;  set the bit
	iorwf	currentbyte,F

	btfsc	control,DONE	; test end flag
	goto	alldone

	clrf	control		;  reset all the flags

	;; DANGER DANGER.....  Check for page boundry !!
here:	banksel	ctlCode
	movlw	high $	
	movwf	PCLATH		; page 
	movf	ctlCode,W
	andlw	0x7
	
	addwf	PCL,F
	goto	code0
	goto	code1
	goto	code2
	goto	code3
	
code0:	
	movf	d,W
	brWleF	dec,code01

	movf	AA,W
	addwf	d,F

	bsf	control,INCY
code01:	movf	BB,W
	addwf	d,F
	bsf	control,INCX
	goto	common


code1:	movf	d,W
	brWleF	dec,code11

	movf	AA,W
	addwf	d,F
	
	bsf	control,DECY
code11:	movf	BB,W
	addwf	d,F
	bsf	control,INCX
	goto	common

	
code2:	
	movf	d,W
	brWleF	dec,code21

	movf	AA,W
	addwf	d,F
	
	bsf	control,INCX
code21:	movf	BB,W
	addwf	d,F
	bsf	control,INCY
	goto	common

	
code3:	movf	d,W
	brWleF	dec,code31

	movf	AA,W
	addwf	d,F

	bsf	control,INCX
code31:	movf	BB,W
	addwf	d,F
	bsf	control,DECY
	goto	common
	
	

common:	
	decf	length,F
	skpnz
	bsf	control,DONE

	btfss	control,INCX	;  did we move to the right ?
	goto	checkINCY

					
	bsf	control,SAVE
	movf	xpos,W		; increment X
	incf	xpos,F
	xorwf	xpos,W
	movwf	temp1
	btfss	temp1,6		; test for left-to-right change
	goto	checkINCY
	
	bsf	control,FLUSH	; set flush
	bsf	control,SETCS	; set setCS
	bsf	control,SETPAGE
checkINCY:	
	
	btfss	control,INCY	;  did we move down ?
	goto	checkDECY
	
	incf	ypos,F
	bcf	STATUS,C
	rlf	pixelbit,F	; move bit
	btfss	STATUS,C	; if carry set, we ned to move to next bank
	goto	checksave

	rlf	pixelbit,F	
	bsf	control,SETPAGE
	bsf	control,SAVE
	bsf	control,FLUSH
	goto	checksave

checkDECY:
	btfss	control,DECY	;  did we move up ?
	goto	checksave
	
	decf	ypos,F
	bcf	STATUS,C
	rrf	pixelbit,F
	btfss	STATUS,C
	goto	checksave

	rrf	pixelbit,F
	bsf	control,SETPAGE
	bsf	control,SAVE
	bsf	control,FLUSH
	goto	checksave	

checksave:			; do we need to save byte to cache ?
	btfss	control,SAVE
	goto	checkflush
	
	movf	currentbyte,W	;  write byte to cache
	movwf	INDF
	incf	FSR,F
	incf	cachelength,F
	
checkflush:			; do we need to flush the cache ?
	btfss	control,FLUSH
	goto	readbyte

	call	flushcache

	goto	setcs


alldone:			;  write endpoint and flush cache
	movf	currentbyte,W
	movwf	INDF
	incf	FSR,F
	incf	cachelength,F
	
	call	flushcache
	return

initGRLCD:	

	banksel	DATATRIS
	clrf	DATATRIS
	clrf	CNTLTRIS
	
	banksel	DATAPORT	
	
	RESETL			; 5      XX0XXXXX
		
	SELBOTH			; 0 1    XX0XXX00
		

	SETELOW			; 4      XX00XX00
	SETI			; 2      XX00X000
	SETW			; 3      XX000000
	RESETH			;        XX100000
	
	movlw	0x3F		; Display ON
	movwf	DATAPORT
	movlw	9
	movwf	scratch1
	decfsz	scratch1,F
	goto	$-1

	WSTROBE	
	
	movlw	0x40		; set x address to 0
	movwf	DATAPORT
	WSTROBE
	
	movlw	0xBF		;  set page to 0 
	movwf	DATAPORT
	WSTROBE

	movlw	0xC0		;  set display start line to 0
	movwf	DATAPORT
	WSTROBE
	return

	
		
	GLOBAL	linedraw,initGRLCD,clearLCD
	
	END
ON 20050603@3:26:45 PM at page: http://www.piclist.com/techref/member/peter_Oonion-bt-/linedraw.htm# [peter_Oonion-bt-] edited the page. Difference: http://www.piclist.com/techref/diff.asp?url=H:\techref\member\peter_Oonion-bt-\linedraw.htm&version=2 ON 20050603@3:28:04 PM at page: http://www.piclist.com/techref/member/peter_Oonion-bt-/index.htm#38506.6444907407 [peter_Oonion-bt-] Says in a new file at: http://www.piclist.com/techref/member/peter_Oonion-bt-/linedemo.htm Here is a bit of demo code that uses the linedraw ON 20050603@3:29:33 PM at page: http://www.piclist.com/techref/member/peter_Oonion-bt-/linedemo.htm#38506.6455208333 [peter_Oonion-bt-] Code:
	
	
	Processor       16F877	
	
        Radix   DEC
        EXPAND

        include         "p16f877.inc"

	
	
	
	EXTERN initGRLCD,clearLCD,linedraw
	EXTERN x1,y1,x2,y2
	EXTERN xtable,ytable
	

shared	UDATA_SHR
FSR_TEMP	res 1
W_TEMP		res 1
STATUS_TEMP	res 1
scratch1	res 1		; work space
scratch2	res 1
scratch3	res 1
scratch4	res 1
scratch5	res 1

	GLOBAL	scratch1,scratch2,scratch3



	UDATA

count	res 1
xx	res 1
yy	res 1
angleL	res 1
angleH	res 1

	
	
_ResetVector    set     0x00

	ORG	_ResetVector

	movlw	high Start
	movwf	PCLATH
	goto	Start


	
application CODE


Start:

	banksel	TRISC
	clrf	TRISC

	banksel	PORTC
	movlw	1
	movwf	PORTC
	
	pagesel	initGRLCD
	call	initGRLCD

	pagesel	clearLCD
	call	clearLCD

	
	
	movlw	0x0
	movwf	xx
	movlw	0x3F
	movwf	yy
	

	movlw	21
	movwf	count

loop:	
	movf	xx,W
	movwf	scratch1
	movf	yy,W
	movwf	scratch2	
	
	
	banksel	x1
	movlw	0
	movwf	x1
	movf	scratch2,W
	movwf	y1

	movf	scratch1,W
	movwf	x2
	movlw	0x0
	movwf	y2

	pagesel	linedraw
	call	linedraw

	banksel	xx
	movlw	6
	addwf	xx,F
	movlw	3
	subwf	yy,F

	clrf	scratch1
	clrf	scratch2
	movlw	0x1
	movwf	scratch3

	decfsz	scratch1,F
	goto	$-1

	decfsz	scratch2,F
	goto	$-3

	decfsz	scratch3,F
	goto	$-5
	

	
	decfsz	count,F
	goto	loop

	pagesel	clearLCD
	call	clearLCD
loop3:	
	banksel	angleL
	clrf	angleL
	clrf	angleH
	movlw	60
	movwf	count
loop2:		
	pagesel	clearLCD
	call	clearLCD	
	pagesel $

	banksel	x1
	movlw	0x40
	movwf	x1
	movlw	0x20
	movwf	y1
	
	call	xsinlookup
	banksel	x2
	andlw	0x7F
	movwf	x2
	
	call	ycoslookup
	banksel	y2
	andlw	0x3F
	movwf	y2
	
		
	pagesel	linedraw
	call	linedraw

	pagesel $
		
	clrf	scratch1
	clrf	scratch2
	movlw	0x4
	movwf	scratch3

	decfsz	scratch1,F
	goto	$-1

	decfsz	scratch2,F
	goto	$-3

	decfsz	scratch3,F
	goto	$-5

	
	banksel	angleL
	movlw	6
	addwf	angleL,F
	btfsc	STATUS,C
	incf	angleH,F

	decfsz	count,F
	goto	loop2
	goto	loop3

commonlook:	
	banksel	EEADRH
	movwf	EEADRH

	
	movf	scratch1,W
	banksel	EEADR
	movwf	EEADR
	banksel	EECON1
	bsf	EECON1 & 0x7F,EEPGD
	bsf	EECON1 & 0x7F,RD
	nop
	nop

	banksel	EEDATA
	movf	EEDATA,W
	banksel	angleL

	return

	
xsinlookup:
	banksel	angleL
	movf	angleL,W
	addlw	low	xtable
	movwf	scratch1

	
	
	movlw	high	xtable
	btfsc	STATUS,C
	addlw	1
	addwf	angleH,W
	goto	commonlook

	
xcoslookup:	
	banksel	angleL
	clrf	scratch2
	movf	angleL,W
	addlw	90
	movwf	scratch1
	btfsc	STATUS,C
	incf	scratch2,F
	
	addlw	low	xtable
	movwf	scratch1
	btfsc	STATUS,C
	incf	scratch2,F
	
	movlw	high	xtable
	addwf	scratch2,W
	addwf	angleH,W
	goto	commonlook

	
	
ysinlookup:
	banksel	angleL
	movf	angleL,W
	addlw	low	ytable
	movwf	scratch1
	movlw	high	ytable
	btfsc	STATUS,C
	addlw	1
	addwf	angleH,W
	goto	commonlook

ycoslookup	
	banksel	angleL
	clrf	scratch2
	movf	angleL,W
	addlw	90
	movwf	scratch1
	btfsc	STATUS,C
	incf	scratch2,F
	
	addlw	low	ytable
	movwf	scratch1

	
	
	btfsc	STATUS,C
	incf	scratch2,F
	
	movlw	high	ytable
	addwf	scratch2,W
	addwf	angleH,W
	goto	commonlook
		


	


	END

ON 20050603@3:30:34 PM at page: http://www.piclist.com/techref/member/peter_Oonion-bt-/linedemo.htm#38506.6462268519 [peter_Oonion-bt-] Code:
	; Created by LCDtrigtable360.c

 	Processor       16F877
	
trig	CODE
	GLOBAL xtable,ytable
xtable:
	DW 0x40
	DW 0x40
	DW 0x41
	DW 0x42
	DW 0x43
	DW 0x43
	DW 0x44
	DW 0x45
	DW 0x46
	DW 0x47
	DW 0x47
	DW 0x48
	DW 0x49
	DW 0x4A
	DW 0x4B
	DW 0x4B
	DW 0x4C
	DW 0x4D
	DW 0x4E
	DW 0x4E
	DW 0x4F
	DW 0x50
	DW 0x51
	DW 0x51
	DW 0x52
	DW 0x53
	DW 0x54
	DW 0x54
	DW 0x55
	DW 0x56
	DW 0x56
	DW 0x57
	DW 0x58
	DW 0x58
	DW 0x59
	DW 0x5A
	DW 0x5A
	DW 0x5B
	DW 0x5C
	DW 0x5C
	DW 0x5D
	DW 0x5E
	DW 0x5E
	DW 0x5F
	DW 0x5F
	DW 0x60
	DW 0x60
	DW 0x61
	DW 0x62
	DW 0x62
	DW 0x63
	DW 0x63
	DW 0x64
	DW 0x64
	DW 0x65
	DW 0x65
	DW 0x65
	DW 0x66
	DW 0x66
	DW 0x67
	DW 0x67
	DW 0x68
	DW 0x68
	DW 0x68
	DW 0x69
	DW 0x69
	DW 0x69
	DW 0x6A
	DW 0x6A
	DW 0x6A
	DW 0x6B
	DW 0x6B
	DW 0x6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DW 0x09
	DW 0x08
	DW 0x08
	DW 0x08
	DW 0x07
	DW 0x07
	DW 0x07
	DW 0x06
	DW 0x06
	DW 0x06
	DW 0x06
	DW 0x05
	DW 0x05
	DW 0x05
	DW 0x04
	DW 0x04
	DW 0x04
	DW 0x04
	DW 0x03
	DW 0x03
	DW 0x03
	DW 0x03
	DW 0x03
	DW 0x02
	DW 0x02
	DW 0x02
	DW 0x02
	DW 0x02
	DW 0x02
	DW 0x01
	DW 0x01
	DW 0x01
	DW 0x01
	DW 0x01
	DW 0x01
	DW 0x01
	DW 0x01
	DW 0x01
	DW 0x01
	DW 0x01
	DW 0x01
	DW 0x01
	DW 0x01
	DW 0x01
	DW 0x01
	DW 0x01
	DW 0x01
	DW 0x01
	DW 0x01
	DW 0x01
	DW 0x01
	DW 0x01
	DW 0x01
	DW 0x01
	DW 0x01
	DW 0x01
	DW 0x01
	DW 0x01
	DW 0x02
	DW 0x02
	DW 0x02
	DW 0x02
	DW 0x02
	DW 0x02
	DW 0x03
	DW 0x03
	DW 0x03
	DW 0x03
	DW 0x03
	DW 0x04
	DW 0x04
	DW 0x04
	DW 0x04
	DW 0x05
	DW 0x05
	DW 0x05
	DW 0x06
	DW 0x06
	DW 0x06
	DW 0x06
	DW 0x07
	DW 0x07
	DW 0x07
	DW 0x08
	DW 0x08
	DW 0x08
	DW 0x09
	DW 0x09
	DW 0x0A
	DW 0x0A
	DW 0x0A
	DW 0x0B
	DW 0x0B
	DW 0x0C
	DW 0x0C
	DW 0x0C
	DW 0x0D
	DW 0x0D
	DW 0x0E
	DW 0x0E
	DW 0x0F
	DW 0x0F
	DW 0x10
	DW 0x10
	DW 0x10
	DW 0x11
	DW 0x11
	DW 0x12
	DW 0x12
	DW 0x13
	DW 0x13
	DW 0x14
	DW 0x14
	DW 0x15
	DW 0x15
	DW 0x16
	DW 0x16
	DW 0x17
	DW 0x17
	DW 0x18
	DW 0x19
	DW 0x19
	DW 0x1A
	DW 0x1A
	DW 0x1B
	DW 0x1B
	DW 0x1C
	DW 0x1C
	DW 0x1D
	DW 0x1D
	DW 0x1E
	DW 0x1E
	DW 0x1F
	DW 0x1F
	DW 0x20
	DW 0x21
	DW 0x21
	DW 0x22
	DW 0x22
	DW 0x23
	DW 0x23
	DW 0x24
	DW 0x24
	DW 0x25
	DW 0x25
	DW 0x26
	DW 0x26
	DW 0x27
	DW 0x28
	DW 0x28
	DW 0x29
	DW 0x29
	DW 0x2A
	DW 0x2A
	DW 0x2B
	DW 0x2B
	DW 0x2C
	DW 0x2C
	DW 0x2D
	DW 0x2D
	DW 0x2E
	DW 0x2E
	DW 0x2F
	DW 0x2F
	DW 0x2F
	DW 0x30
	DW 0x30
	DW 0x31
	DW 0x31
	DW 0x32
	DW 0x32
	DW 0x33
	DW 0x33
	DW 0x33
	DW 0x34
	DW 0x34
	DW 0x35
	DW 0x35
	DW 0x35
	DW 0x36
	DW 0x36
	DW 0x37
	DW 0x37
	DW 0x37
	DW 0x38
	DW 0x38
	DW 0x38
	DW 0x39
	DW 0x39
	DW 0x39
	DW 0x39
	DW 0x3A
	DW 0x3A
	DW 0x3A
	DW 0x3B
	DW 0x3B
	DW 0x3B
	DW 0x3B
	DW 0x3C
	DW 0x3C
	DW 0x3C
	DW 0x3C
	DW 0x3C
	DW 0x3D
	DW 0x3D
	DW 0x3D
	DW 0x3D
	DW 0x3D
	DW 0x3D
	DW 0x3E
	DW 0x3E
	DW 0x3E
	DW 0x3E
	DW 0x3E
	DW 0x3E
	DW 0x3E
	DW 0x3E
	DW 0x3E
	DW 0x3E
	DW 0x3E
	DW 0x3E
	DW 0x3E
	DW 0x3E
	DW 0x3F

 	END
ON 20050603@3:33:54 PM at page: http://www.piclist.com/techref/member/peter_Oonion-bt-/linedemo.htm# [peter_Oonion-bt-] edited the page. Difference: http://www.piclist.com/techref/diff.asp?url=H:\techref\member\peter_Oonion-bt-\linedemo.htm&version=2 ON 20050603@3:35:23 PM at page: http://www.piclist.com/techref/member/peter_Oonion-bt-/linedraw.htm# [peter_Oonion-bt-] edited the page. Difference: http://www.piclist.com/techref/diff.asp?url=H:\techref\member\peter_Oonion-bt-\linedraw.htm&version=3 ON 20050603@3:36:18 PM at page: http://www.piclist.com/techref/member/peter_Oonion-bt-/index.htm# [peter_Oonion-bt-] edited the page. Difference: http://www.piclist.com/techref/diff.asp?url=H:\techref\member\peter_Oonion-bt-\index.htm&version=19 ON 20050603@3:40:39 PM at page: http://www.piclist.com/techref/member/peter_Oonion-bt-/index.htm#38506.6532291667 [peter_Oonion-bt-] See also: /techref/member/peter_Oonion-bt-/linedemo.htm Here is the demo code ON 20050603@3:41:57 PM at page: http://www.piclist.com/techref/member/peter_Oonion-bt-/index.htm# [peter_Oonion-bt-] edited the page. Difference: http://www.piclist.com/techref/diff.asp?url=H:\techref\member\peter_Oonion-bt-\index.htm&version=21 ON 20050603@3:44:28 PM at page: http://www.piclist.com/techref/member/peter_Oonion-bt-/index.htm#38506.6558796296 [peter_Oonion-bt-] Says /techref/member/peter_Oonion-bt-/linedraw.htm this is a comment ON 20050603@3:45:49 PM at page: http://www.piclist.com/techref/member/peter_Oonion-bt-/index.htm#38506.6568171296 [peter_Oonion-bt-] See also: /techref/member/peter_Oonion-bt-/linedemo.htm /techref/member/peter_Oonion-bt-/ ON 20050603@3:49:59 PM at page: http://www.piclist.com/techref/member/peter_Oonion-bt-/index.htm# [peter_Oonion-bt-] edited the page. Difference: http://www.piclist.com/techref/diff.asp?url=H:\techref\member\peter_Oonion-bt-\index.htm&version=25 ON 20050604@12:34:15 AM at page: http://www.piclist.org/techref/member/peter_Oonion-bt-/index.htm# Peter Onion[peter_Oonion-bt-] edited the page. Difference: http://www.piclist.org/techref/diff.asp?url=H:\techref\member\peter_Oonion-bt-\index.htm&version=26 ON 20050604@12:34:54 AM at page: http://www.piclist.org/techref/member/peter_Oonion-bt-/index.htm# Peter Onion[peter_Oonion-bt-] edited the page. Difference: http://www.piclist.org/techref/diff.asp?url=H:\techref\member\peter_Oonion-bt-\index.htm&version=27 ON 20050604@12:35:45 AM at page: http://www.piclist.org/techref/member/peter_Oonion-bt-/index.htm# Peter Onion[peter_Oonion-bt-] edited the page. Difference: http://www.piclist.org/techref/diff.asp?url=H:\techref\member\peter_Oonion-bt-\index.htm&version=28 ON 20050604@12:36:13 AM at page: http://www.piclist.org/techref/member/peter_Oonion-bt-/index.htm# Peter Onion[peter_Oonion-bt-] edited the page. Difference: http://www.piclist.org/techref/diff.asp?url=H:\techref\member\peter_Oonion-bt-\index.htm&version=29 ON 20050604@12:46:09 AM at page: http://www.piclist.org/techref/member/peter_Oonion-bt-/index.htm# Peter Onion[peter_Oonion-bt-] edited the page. Difference: http://www.piclist.org/techref/diff.asp?url=H:\techref\member\peter_Oonion-bt-\index.htm&version=30 ON 20050604@12:56:44 AM at page: http://www.piclist.org/techref/member/peter_Oonion-bt-/index.htm# Peter Onion[peter_Oonion-bt-] edited the page. Difference: http://www.piclist.org/techref/diff.asp?url=H:\techref\member\peter_Oonion-bt-\index.htm&version=31 ON 20050604@12:57:39 AM at page: http://www.piclist.org/techref/member/peter_Oonion-bt-/index.htm# Peter Onion[peter_Oonion-bt-] edited the page. Difference: http://www.piclist.org/techref/diff.asp?url=H:\techref\member\peter_Oonion-bt-\index.htm&version=32 ON 20050604@1:04:11 AM at page: http://www.piclist.org/techref/member/peter_Oonion-bt-/index.htm# Peter Onion[peter_Oonion-bt-] edited the page. Difference: http://www.piclist.org/techref/diff.asp?url=H:\techref\member\peter_Oonion-bt-\index.htm&version=33 ON 20050604@1:10:45 AM at page: http://www.piclist.org/techref/member/peter_Oonion-bt-/index.htm# Peter Onion[peter_Oonion-bt-] edited the page. Difference: http://www.piclist.org/techref/diff.asp?url=H:\techref\member\peter_Oonion-bt-\index.htm&version=34