shubham kumar
Member level 3
- Joined
- Sep 11, 2014
- Messages
- 59
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 8
- Location
- bangalore
- Activity points
- 511
I am using PIC18F452 and MikroC.
My doubt is not specifically related to this controller.
I am trying to make a program, in which I have to continuously monitor the temperature. Controller do the calculations as normal work and Whenever there is a change by (+ or -)2degree (or 2 units) the controller must notify or do certain specified task and come back to normal work.
How do I do that. Please tell me the logic.
I thought of writing the program in timer interrupt and the timer will check for the change whenever the timer flag overflows. but that doesn't help as what if each time the timer overflows and temperature increase by 2 degree and decrease by 1 degree (in that case I controller will not detect it).
I thought of connecting the temperature input to INT1 but there also that change is not detectable.
It is something like whenever there is 2degree change it will take that as interrupt. I know that if it is in the ISR till then it will not detect any further change but even then I didn't found a way to do that.
Please tell me the logic
My doubt is not specifically related to this controller.
I am trying to make a program, in which I have to continuously monitor the temperature. Controller do the calculations as normal work and Whenever there is a change by (+ or -)2degree (or 2 units) the controller must notify or do certain specified task and come back to normal work.
How do I do that. Please tell me the logic.
I thought of writing the program in timer interrupt and the timer will check for the change whenever the timer flag overflows. but that doesn't help as what if each time the timer overflows and temperature increase by 2 degree and decrease by 1 degree (in that case I controller will not detect it).
I thought of connecting the temperature input to INT1 but there also that change is not detectable.
It is something like whenever there is 2degree change it will take that as interrupt. I know that if it is in the ISR till then it will not detect any further change but even then I didn't found a way to do that.
Please tell me the logic