Ответ: программа Вот простая программа.
.include "tn2313def.inc"
.def tmp=r16
.def delay=r17
.cseg
.org 0
rjmp RESET ;Reset handler
reti
reti
reti
reti
reti
rjmp TICK ;timer counter overflow (1 ms)
reti
reti
reti
reti
reti
reti
reti
reti
reti
reti
reti
reti
RESET:
cli
ldi tmp, low(RAMEND)
out SPL, tmp ;Initialise Stack
sbi ACSR, ACD ;Disable Analog Comparator
clr tmp
out WDTCR, tmp ;disable WD Timer
ldi tmp, 2 ;0 for stop, 0x02 for
out TCCR0, tmp ;timer prescalar /8
out TIMSK, tmp ;enable interupt
clr tmp
out TCNT0, tmp ;
sei
ldi tmp, 0xff
out DDRB, tmp ;Initialise PortB as output
ldi tmp, 0
out PORTB, tmp ;Set PortB to 0
ldi delay, 255
inf: rjmp inf
TICK:
or delay,delay
brne next
clr tmp
sbis PINB, 0
inc tmp
out PORTB, tmp
next:
dec delay
reti
Но по моему дело не в программе. Больше похоже на то, что порт сгорел. Статикой по видимому. =(