;-----------------------------------------------------------------
; Name:			LCD Test.asm
; Description:	Tests the addition of an LCD to STK500
;				

; Author:		Max Koessick
; Class:		EEL5666C, Intelligent Machine Design Lab
; Date:			June 22, 2003
; Revision		1.a
; Changes to Date:
;				6/22/03 First Revision
;				


.include "m128def.inc"

; Interrupt service vectors

.org $0000
	rjmp Reset						; Reset vector
;-----------------------------------------------------------------
; Register defines for main loop
;-----------------------------------------------------------------


.def		mpr		=r16			; defines multipurpose register
.def		mpr2	=r17			; multipurpose register 2
.def		delay	=r18			; servo direction register (values 1-3)
.def		delay2	=r19			; General Purpose Delay Register
.def		delay3	=r20			; General Purpose Delay Register

; Equate statements

.equ		RS 		= 	PD7			; Register Select connected to PortD7
									; 0: Command Register
									; 1: Data Register
.equ		Enable	=	PD6


.cseg
;-----------------------------------------------------------------
; Reset vector
;-----------------------------------------------------------------

Reset:
;-----Setting Stackpointer----------------------------------------


	ldi		ZH,high(varlist2<<1)
	ldi		ZL,low(varlist2<<1)

here:
	lpm		mpr,Z+


	rjmp	here

.org $300



; Data Segment
varlist2:
.dw 0x6152

varlist:.dw $52,$61,$6e,$67,$65,$20,$54,$6f,$20,$54,$61,$72,$67,$66,$74,$ff