код, проблема проявилась при эксперементах с бегущими огоньками
Код
.include "tiny26def.inc"
.def temp=R16
.def binding=R17
.def output=R18
.def counter=R19
.cseg
.org 0
rjmp Reset
rjmp INT_0
rjmp INT_1
rjmp Timer1_CompareA
rjmp Timer1_CompareB
rjmp Timer1_Overflow
rjmp Timer0_Overflow
rjmp UART_RX
rjmp UART_UDRE
rjmp UART_TX
rjmp ANA_COMP
INT_0:
INT_1:
Timer1_CompareB:
Timer1_Overflow:
Timer0_Overflow:
UART_RX:
UART_UDRE:
UART_TX:
ANA_COMP:
reti
/* Initialization */
Reset: ldi temp, RamEnd
out SP, temp
ldi temp, 0b11111111
out DDRA, temp
out DDRB, temp
ldi temp, 0b01000000
out TCCR1A, temp
ldi temp, 0b00001010
out TCCR1B, temp
ldi temp, 0b11111110
out OCR1A, temp
ldi temp, 0b01000000
out TIMSK, temp
sei
/* Main loop */
Main: rjmp Main
/* Functions */
ResetTimer:
ldi temp, 0
out TCNT1, temp
ret
ResetCounter:
ldi counter, 0
ret
DataBind: out PortA, output
ldi output, 0b11111111
out PortB, output;<---- проблема тут
ret
/* Timer interrupt handling */
Timer1_CompareA:
rcall ResetTimer
cpi counter, 14
brne Timer1_CompareA_continue
rcall ResetCounter
Timer1_CompareA_continue:
ldi ZH, High(Program1 * 2)
ldi ZL, Low(Program1 * 2)
ldi temp, 0
add ZL, counter
adc ZH, temp
lpm
mov output, R0
inc counter
rcall DataBind
reti
Program1:
.db 0b00000000, 0b00000001
.db 0b00000011, 0b00000111
.db 0b00001110, 0b00011100
.db 0b00111000, 0b01110000
.db 0b11100000, 0b11000000
.db 0b10000000, 0b00000000
.db 0, 0
UPD:
Проявил военнцую смекалку -- почитал референс

С помощью тыкания на ресет удалось микроконтроллер прошить и он типо "починился".
Сообщение отредактировал ADOConnection - Jul 9 2008, 22:17