das war verbessert Code ,aber wirkt trotzdem nicht, das controlle wacht nicht auf, trotz Asynchronous mode ist doch eingestelltCode:.include"8535def.inc" .def temp=r16 .def temp2=r17 .def crc8=r24 .org 0X000 rjmp reset ;reset handler .org 0X004 rjmp TIM2_OVF .org 0X008 rjmp TIM1_OVF .equ quartz=7372800 ;Seite 60,64,XTAL->Baudrategenerator .equ baud=9600 .equ start=65536-39060 .equ highvalue=high(start) .equ lowvalue=low(start) reset: ldi temp,low(RAMEND) out spl,temp ;Seite 21 ldi temp,high(RAMEND) ;Stackpoint initialisieren out sph,temp ldi temp,highvalue out TCNT1H,temp ;Datenblaette Seite 38 ldi temp,lowvalue ;Startwert des Timers einstellen out TCNT1L,temp ldi temp,1<<TOIE1 out TIMSK,temp ;time1 interrupt ein , Seite 27 ldi temp,0b00000101 ;Seite 38 out TCCR1B,temp ;bit2-0 define the Prescaling ldi temp,1<<SE out mcucr,temp ori temp,0b00110000 ;sleep enable out mcucr,temp sei loop: ldi temp,0b11111100 out portb,temp ldi temp,0b11111111 out DDRB,temp rjmp loop initial: in temp,timsk andi temp,0b00111111 ;ldi temp,(0<<OCIE2)+(0<<TOIE2) out TIMSK,temp ldi temp,1<<as2 out assr,temp ldi temp,200 out TCNT2,temp ldi temp,0b00000011 out TCCR2,temp ldi temp,0b11111111 wait1: in temp,ASSR sbrs temp,2 ;tcn2ub rjmp wait1 wait2: in temp,ASSR sbrs temp,0 ;TCR2UB rjmp wait2 wait3: in temp,ASSR sbrs temp,0 ;TCR2UB rjmp wait3 ldi temp,(1<<TOIE2) out TIMSK,temp sei ldi temp2,0b11111111 out portb,temp2 sleep rcall reset ret TIM1_OVF: ldi temp,highvalue out TCNT1H,temp ;Datenblaette Seite 38 ldi temp,lowvalue ;Startwert des Timers einstellen out TCNT1L,temp ;39060 Takt ist 5 Sekunde ;nach 5 sekunde ist interrupt ausgeloest rcall initial ;aufrufen Sleep Funktion reti TIM2_OVF: ldi temp,200 out TCNT2,temp rcall reset reti
Lesezeichen