![Microchip Technology STK600 Скачать руководство пользователя страница 6](http://html1.mh-extra.com/html/microchip-technology/stk600/stk600_user-manual_1785859006.webp)
[
1
]
The ATmega2560 has a default fuse setting that makes it run on a 1MHz internal clock. The maximum ISP frequency is 1/4 of the target clock
frequency.
Connecting the Hardware
The STK600 must be connected to a host PC with a USB cable. Connect the cable to a free USB port on the PC or on a USB hub. The USB port
must be capable of supplying 500mA. If using a USB hub, make sure it has an external power supply.
Connect the other end of the USB cable to the USB connector on STK600 sitting next to the DC jack.
Optionally, if STK600 is to be connected to external hardware that consumes more than 300mA, an external DC power supply can be connected to
the DC jack on STK600. The cable supplied with the kit can be used. Connect the center pin to the positive voltage and the cap to ground.
See
Chapter 3,
Target Socket System
on how to set up the routing card and socket card.
Example Application: Using LEDs and Switches
Copy the code from this document into AVR Studio.
Tip: You need to adjust the include file specified at the 2nd line if you want to run the demo application on a device different from the
ATmega2560.
;***** STK600 LEDS and SWITCH demonstration
.include "m2560def.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)
dec
Temp
; then count LEDS one up
sbis
PIND,0x02
; If (Port D, pin2 == 0)
ror
Temp
; then rotate LEDS one right
sbis
PIND,0x03
; If (Port D, pin3 == 0)
rol
Temp
; then rotate LEDS one left
sbis
PIND,0x04
; If (Port D, pin4 == 0)
com
Temp
; then invert all LEDS
sbis
PIND,0x05
; If (Port D, pin5 == 0)
neg
Temp
; then invert all LEDS and add 1
sbis
PIND,0x06
; If (Port D, pin6 == 0)
swap
Temp
; then swap nibbles of LEDS
;**** Now wait a while to make LED changes visible.
DLY:
dec
Delay
brne
DLY
dec
Delay2
brne
DLY
rjmp
LOOP
;
Repeat
loop
forever
Chapter 3. Target Socket System
Socket System
STK600 is designed to support all AVR devices (both AVR and AVR32) with internal flash memory. A system based on socket and routing cards is
used to support different package types and pinouts on the STK600 board.
The picture below shows an STK600 with a mounted routing card and socket card.
Page 6 of 35
STK600 User Guide
2008-06-20
file://C:\Documents and Settings\PAWEL\Ustawienia lokalne\Temp\~hhE369.htm