; Program LCD_TEST
; 
; PORTA, Bit 0 (terminal 17) ------ TX ----------> to RX on Serial LCD
;
; Illustrates various tools for debugging using the PIC-n-LCD.
;
; Note that LCD_V4_6.ASM is included near the end of this program.
;
; copyright, Peter H. Anderson, March, '98
	
	LIST p=16f84
#include <C:\mplab\p16f84.inc>	
	__CONFIG 11h

	CONSTANT BASE_VAR=10H	; note that base is 10H


Q_H	EQU BASE_VAR+0
Q_L	EQU BASE_VAR+1

	ORG 000H

	MOVLW 03H	; dummy up some variables
	MOVWF Q_H
	MOVLW 0E4H
	MOVWF Q_L

	CALL LCD_RESET	; allow time to manually reset the LCD
			; and assure it is working

	MOVLW "V"	; display V=
	CALL LCD_CHAR

	MOVLW "="
	CALL LCD_CHAR

	MOVF Q_H, W	; put the BCD word into locations 41H and 42H
	MOVWF 41H

	MOVF Q_L, W
	MOVWF 42H

	CALL LCD_BCD_WORD	; display it in decimal

	MOVLW 0AH	; new line
	CALL LCD_CHAR

	MOVLW 0DH
	CALL LCD_CHAR

	MOVLW 0FEH	; display a value
	CALL LCD_VAL

	MOVLW .250	; four 1/4 second delays
	CALL LCD_DELAY
	CALL LCD_DELAY
	CALL LCD_DELAY
	CALL LCD_DELAY

	MOVLW 0FEH	; dummy up W
	ADDLW .10	; Z is now zero, C is one

	CALL LCD_DEBUG	; display W, Z, C and locations 10H - 17H

DONE:
	GOTO DONE

#include <a:\lcd_v4_6.asm>

	END