JAI PRAKASH LAMBA
Newbie level 5
- Joined
- Nov 12, 2013
- Messages
- 9
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 81
Hi All,
I am new to pic,m designing a project using pic16f676 (4Mhz),the controller unit drives the relay which furthur drives a Water purifier motor.
i have to save the total runtime of the motor when it turn ON using timer1(16 bit), I have set a flag from my main code which is available to isr, on which it starts calculting motor run time & when motor is off i just clear the flag from main and clearing the isr variable.
I am facing two main problems that are:-
1) when motor elapse 1 hr i turn ON 1 led, after 2 hrs 2nd led and so on for three leds but led turns after 1 hr 2 min & for second led it will turn ON after 2 Hrs 1min 35 sec so on, means every time i Turn on my device it will turn on led's at variable interval of time.
2) some time my led state will not changes it gets struck in only one mode.
Attach my main code and isr routine
waiting for quick reply........
Thanks in advance
I am new to pic,m designing a project using pic16f676 (4Mhz),the controller unit drives the relay which furthur drives a Water purifier motor.
i have to save the total runtime of the motor when it turn ON using timer1(16 bit), I have set a flag from my main code which is available to isr, on which it starts calculting motor run time & when motor is off i just clear the flag from main and clearing the isr variable.
I am facing two main problems that are:-
1) when motor elapse 1 hr i turn ON 1 led, after 2 hrs 2nd led and so on for three leds but led turns after 1 hr 2 min & for second led it will turn ON after 2 Hrs 1min 35 sec so on, means every time i Turn on my device it will turn on led's at variable interval of time.
2) some time my led state will not changes it gets struck in only one mode.
Attach my main code and isr routine
waiting for quick reply........
Thanks in advance