Import-Script
06.11.2003, 21:11
!!! VERZWEIFEL !!! <BR>ich hab vor mir einen atmega161 der sich strikt weigert, einen timer-int zu starten! <BR> <BR>hier das programm: <BR>;############################################ <BR>.INCLUDE "m161def.inc" <BR> <BR>.def temp1 = r16 <BR>.def timerByte = r19 <BR> <BR>.CSEG <BR>.ORG 0x00 <BR> rjmp RESET ;1 <BR> reti ;2 eint0 <BR> reti ;3 eint1 <BR> reti ;4 eint2 <BR> reti ;5 timer 2 compare match <BR> reti ;6 timer 2 <BR> reti ;7 timer 1 <BR> reti ;8 timer 1 <BR> reti ;9 timer 1 <BR> reti ;10 timer 1 <BR> reti ;11 timer 0 compare match <BR> rjmp TIMER_INT ;12 timer 0 overflow <BR> reti ;13 spi <BR> reti ;14 UART0 <BR> reti ;15 UART1 <BR> reti ;16 UART0 <BR> reti ;17 UART1 <BR> reti ;18 UART0 TXC <BR> reti ;19 UART1 TXC <BR> reti ;20 ee_rdy <BR> reti ;21 ana_comp <BR> <BR>.ORG 0x30 <BR>RESET: <BR>;stack <BR> ldi temp1, low(RAMEND) <BR> out SPL, temp1 ldi temp1, high(RAMEND) out SPH, temp1 <BR>; TIMER 0 <BR>; TCCR0: Clock Select Bits (1:0:1 = prescaler 1024) <BR> ldi temp1, 0b00000101 <BR> out TCCR0, temp1 ; <BR> ldi temp1, 0x02 ;overflow-int enablen <BR> out TIMSK, temp1 <BR> <BR> sei ;general ints enable <BR> <BR> <BR> ser temp1 <BR> out DDRA, temp1 ;als output für leds <BR>testloop: <BR> clr temp1 ;leds einschalten <BR> out PORTA, temp1 <BR> ldi timerByte, 0x80 <BR> <BR>Loop1: <BR> tst timerByte ;solange warten, der timer runtergezählt hat <BR> brne Loop1 <BR> <BR> ser temp1 ;leds ausschalten <BR> out PORTA, temp1 <BR> ldi timerByte, 0x80 <BR> <BR>Loop2: <BR> tst timerByte ;solange warten, der timer runtergezählt hat <BR> brne Loop2 <BR> <BR> rjmp testloop <BR> <BR> <BR> <BR>TIMER_INT: <BR> push temp1 <BR> in temp1, SREG <BR> <BR> dec timerByte <BR> <BR> out SREG, temp1 <BR> pop temp1 <BR> reti <BR> <BR>;################################################ <BR> <BR>hatte den ausschalt-befehl auch schon in der isr, aber ging auch nicht! <BR> <BR>vielen Dank für eure hilfe! <BR>nides <BR> <BR>