/*
 * LCD_CDM-16100 Display Project
 *
 * org: 9/29/2014
 * auth: Nels "Chip" Pearson
 *
 * Target: LCD_CDM-116100 Demo Board w/ LCD display and keypad I/O, 8MHz
 *
 * Resources
 * SRAM
 *
 * IO
 *
 */ 

.nolist
.include "m328pdef.inc"
.list



.ORG	$0000
		rjmp	RESET

.ORG	OC0Aaddr
;;;		rjmp	st_tmr0_intr	; TMR0 counter compare intr

.ORG	TWIaddr
;;;		rjmp	i2c_intr		; 2-wire Serial Interface

	reti

.ORG	INT_VECTORS_SIZE		; Skip over the rest of them.

.CSEG
RESET:
; setup SP
		ldi		R16, LOW(RAMEND)
		out		spl, R16
		ldi		R16, HIGH(RAMEND)
		out		sph, R16
; JTAG disable
		ldi		R16, $80
		out		MCUCR, R16
		out		MCUCR, R16
;
	call	init_led_io
	call	lcd_init			; set up LCD
;
	call	lcd_board_test
;
;;;	sei							; enable intr
;
;
main_m:

		call	lcd_delay_40us
;
m_skip00:
;;;		call	master_service
;
m_skip01:
;
		rjmp	main_m

// LCD CDM-16100 Driver
.include "lcd_cdm_16100_4bit.asm"
// LCD CDM-16100 Board Test
.include "board_test.asm"
