Hi this coding I have inside the ISR.
For every 10ms it’s giving an TMR0 interrupt. So I count 100 times to get 1 second.
After I checking whether it has reaches 60 seconds to get 1 minute.
What I need is the output must stay ON 50% & other 50% must be OFF.
The coding done for 2 minutes on & 2 minutes off from 4 minutes.
I want to verify is this ok or not.
For every 10ms it’s giving an TMR0 interrupt. So I count 100 times to get 1 second.
After I checking whether it has reaches 60 seconds to get 1 minute.
What I need is the output must stay ON 50% & other 50% must be OFF.
The coding done for 2 minutes on & 2 minutes off from 4 minutes.
I want to verify is this ok or not.
Code:
ISR decfsz COUNT,F
goto Output
movlw .100
movwf COUNT
decfsz Second,F
goto Output
movlw .60
movwf Second
decfsz Minute,F
goto Output
movlw .4
movwf Minute
Output movf Minute,W
sublw .2
btfsc STATUS,C
bsf PORTB,0 ;turn ON
btfss STATUS,C
bcf PORTB,0 ;turn OFF
Last edited: