bianchi77
Advanced Member level 4
- Joined
- Jun 11, 2009
- Messages
- 1,313
- Helped
- 21
- Reputation
- 44
- Reaction score
- 20
- Trophy points
- 1,318
- Location
- California
- Activity points
- 9,442
Guys,
I want to reduce LedTimer after interrupt but it returned to 20 again after interrupt,
Do you have idea how handle it ?
thanks
I want to reduce LedTimer after interrupt but it returned to 20 again after interrupt,
Do you have idea how handle it ?
thanks
Code:
LedTimer EQU .20 ;10 decimal (for content of the counter to get 100ms)
led_state_1
bcf INTCON,T0IF ;clear the interrupt flag
bsf PORTB, POWERLED ;Turn on LED
movlw LedTimer
movwf COUNT
;counting
check_counter
btfss INTCON,T0IF
goto check_counter
sublw .1
btfss STATUS, Z ;Is the result 0, clear COUNT
goto check_counter ;if false check the COUNTER again
goto next_state ;if true go to this statement
next_state
clrf COUNT ;if false go to this statement
incf LedState,1 ; if 00 increase the state, for the next state
return