;*************************************************************************** ;* ;* File Name : "blink.asm" ;* Title : EE-281 Lab #1 Starter File ;* Date : September 26, 2000 ;* Version : 1.1 ;* Target MCU : AT90S8515 ;* ;* DESCRIPTION ;* ;* Minimal program that turns on LEDs on the STK-200 Development Kit ;* when the corresponding button is pressed. ;* ;*************************************************************************** .device AT90S8515 ; Prohibits use of non-implemented instructions; .nolist .include "8515def.inc" .list rjmp RESET ; Set up the reset vector. ; Other vector setup really should go here... RESET: ldi R16,low(RAMEND) ; Load low byte address of end of RAM into register R16 out SPL,R16 ; Initialize stack pointer to end of internal RAM ldi R16,high(RAMEND) ; Load high byte address of end of RAM into register R16 out SPH, R16 ; Initialize high byte of stack pointer to end of internal RAM SETUP: ldi R16, $00 ; All zeros makes out DDRD, R16 ; port D an input ldi R16, $FF ; All ones makes out DDRB, R16 ; port B all outputs LOOP: in R16, PIND ; Read buttons from port D (active low) out PORTB, R16 ; Output value of buttons to port B (active low) rjmp LOOP ; Forever