Atmel ATSTK500 500 Starter kit and development system. ATSTK500 ATSTK500 Hoja De Datos
![Atmel](https://files.manualsbrain.com/attachments/0369829915bda09f9c2e00fb805a7753579683b5/common/fit/150/50/8d2bf08978ec3e5bc63f4343ac5e91ce8d0e40045619fa520d910d64af8f/brand_logo.png)
Los códigos de productos
ATSTK500
AVR STK500 User Guide
9-1
Rev. 1925C–AVR–3/03
Section 9
Example Applications
9.1
Using LEDs and
Switches
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)