EasyManuals Logo

Atmel AVR STK500 User Manual

Atmel AVR STK500
62 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #57 background imageLoading...
Page #57 background image
AVR STK500 User Guide 9-1
Rev. 1925C–AVR–3/03
Section 9
Example Applications
9.1 Using LEDs and
Switches
Connect PORTB to LEDS and PORTD to SWITCHES.
LEDs will operate differently depending on what switch is pressed.
Tip: Copy the code from this document into AVR Studio.
;***** STK500 LEDS and SWITCH demonstration
.include “8515def.inc”
.def Temp =r16 ; Temporary register
.def Delay =r17 ; Delay variable 1
.def Delay2 =r18 ; Delay variable 2
;***** Initialization
RESET:
ser Temp
out DDRB,Temp ; Set PORTB to output
;**** Test input/output
LOOP:
out PORTB,temp ; Update LEDS
sbis PIND,0x00 ; If (Port D, pin0 == 0)
inc Temp ; then count LEDS one down
sbis PIND,0x01 ; If (Port D, pin1 == 0)

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Atmel AVR STK500 and is the answer not in the manual?

Atmel AVR STK500 Specifications

General IconGeneral
BrandAtmel
ModelAVR STK500
CategoryController
LanguageEnglish

Related product manuals