/*
 * I2C Master Project
 *
 * org: 9/03/2014
 * auth: Nels "Chip" Pearson
 *
 * Target: I2C Demo Board w/ display and keypad I/O, 20MHz
 *
 * Resources
 * SRAM
 *	i2c_buff:	.BYTE	FIFO_SIZE(18)	; Reserve N bytes in SRAM
 *
 * IO
 *	GPIOR0.GPIOR00		display tic1ms flag
 *	GPIOR0.GPIOR01		key scan tic1ms flag
 *
 */ 

.nolist
.include "m164pdef.inc"
.list



.ORG	$0000
		rjmp	RESET

.ORG	OC0Aaddr
		rjmp	st_tmr0_intr	; TMR0 counter compare intr

.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	st_init_tmr0		; set up interrupt
;
		sei							; enable intr
;
main_m:
		call	switch_service
;
m_skip00:
		call	led_service
;
m_skip01:
;
		rjmp	main_m


// Bring in timmer support
.include "sys_timers.asm"
// Bring in led_switch code
.include "led_switch.asm"
