I was wondering if I could use the timers in a PIC18F4550 to save some space and use them as to count how long a event has been active in C using SDCC. I'm new using this compiler and library's. =/
e.g: I'm writing a fire alarm panel program that has all the bells and whistles a commercial one you would see. What I'm trying to accomplish is a cut off delay. When the alarm has been active for more then 20 minutes, I want the audible signal devices to shut off. (This feature is in many of them, it stops a false alarm from sounding encase no one is home)
I was hopping for someone to write a simple example of using the timer in a PIC in C to help me get a better idea how to write this. I seem to have everything down such as reading ADC, setting pins outputs and inputs, but I've never played with timers.
Thank you, Ajm.
e.g: I'm writing a fire alarm panel program that has all the bells and whistles a commercial one you would see. What I'm trying to accomplish is a cut off delay. When the alarm has been active for more then 20 minutes, I want the audible signal devices to shut off. (This feature is in many of them, it stops a false alarm from sounding encase no one is home)
I was hopping for someone to write a simple example of using the timer in a PIC in C to help me get a better idea how to write this. I seem to have everything down such as reading ADC, setting pins outputs and inputs, but I've never played with timers.
Thank you, Ajm.
Last edited: