Дракон - только по JTAG (по PDI не хочет), AVRISP - по PDI, лично проверял на Xplain'е. Один перец с AVRFreaks запустил PDI, всунув пару К33 резисторов в линии, но мне не помогло Зато первую работающую кнопкомигалку нопесал для XMegaA1:
.nolist
.include "ATxmega128A1def.inc"
.list
.def tmp = r16 ; Temporary register (low)
.equ leds = VPORT0_OUT
.equ buttons = VPORT1_IN
.macro stsi
; Writes an 8-bit immediate value to a 8-bit RAM location.
; Usage: stsi addr,value
; Uses/trashes a tmp register for operation.
ldi tmp,@1
sts @0,tmp
.endm
.macro outi
; Writes a 8-bit immediate value to an 8-bit i/o SFR.
; Usage: outi IOREG8,value.
; Uses/trashes a tmp register for operation.
ldi tmp,@1
out @0,tmp
.endm
.listmac
.cseg ; Start of Code segment
reset:
rcall init_ports ; Initialize ports
main:
in tmp,buttons
swap tmp
out leds,tmp
rjmp main
;------------------------------------------------------------------------------
; Port initialization
init_ports:
stsi PORTCFG_MPCMASK,0xFF ; Force all port pins to be configured as follows
stsi PORTF_PIN0CTRL,PORT_OPC_PULLUP_gc ; Input w/pullup
stsi PORTCFG_VPCTRLA,PORTCFG_VP0MAP_PORTE_gc+PORTCFG_VP1MAP_PORTF_gc ; Map PE to VP0, PF to VP1
outi VPORT0_DIR,0xFF ; VP0 = outputs (default as totem pole)
outi VPORT1_DIR,0 ; VP1 = inputs (default as hi-z, modified above to pullup)
ret
;------------------------------------------------------------------------------
.exit