/* SLdt 260604 Disclaimer: none. Sue me. betrifft: PRR bei laufendem Timer0 (mit gesetztem OCIE) https://www.mikrocontroller.net/topic/584688#new eingespeist auf B4: Rechtecksignal mit 70 mHz LED & Frequenzzaehler an B3: B4=1: LED blinkt sichtbar (0.25 Hz) B4=0: LED 'blinkt' mit 1.5 kHz Programm laeuft eine Weile, dann auf B3 konstant ca. 31 kHz entspr. 39 Takten (OC0A-ISR?) avrasm2 */ .nolist .include "tn13Adef.inc" ;****************************************************** .macro put .if @0 < $40 out @0,@1 .else sts @0,@1 .endif .endmacro ;---------------------- .macro puti ldi tmp0,@1 put @0,tmp0 .endmacro ;****************************************************** .list .def null = r2 .def tmp0 = r16 ;****************************************************** .cseg ; flash ;********************** .org $0000 clr null rjmp start .org OC0Aaddr rjmp ISR_OC0A .org WDTaddr rjmp ISR_WDT ;------------------------------------------------------- ISR_OC0A: sbi PINB,3 push tmp0 pop tmp0 reti ;---------------------- ISR_WDT: sbi PINB,3 push tmp0 sbic PINB,4 rjmp hell put PRR,null ; 'dunkel' -> 'Lauflicht' laeuft rjmp ISR_WDT_end hell: puti PRR,(1< 'Lauflicht' stoppt ISR_WDT_end: pop tmp0 reti ;****************************************************** start: sbi DDRB,3 puti TCCR0A,(1<