Hi,
Have to make a little MCU with some small things.
Need to have a indication when ex 15 min is reached.
Have planed this.,
Use a 16F1509 ( Spare one i have
MCU Running at FOSC 8 mhz.
use TIMER2
Input 2 mhz (FOSC/4)
PRESCALE 64 = 2.000.000 / 64 = 31.250 hz,
Set Compare (PR2) to 31.250
Rollover at 1 sec. approx.
Set POSTSCALE to 15 = 4 times pr minut.
Set Interrupt and add one to variable "numbers_of_runs"
"number_of_runs" up to 60 = 15 minutes. give or take some seconds.
Is this an easy way to do it, ??
Here is from datasheet.
And in main code just a loop that check if "numbers_of_runs" = 60 then do something
Know it's overkill to use that MCU, but all i have.
Have to make a little MCU with some small things.
Need to have a indication when ex 15 min is reached.
Have planed this.,
Use a 16F1509 ( Spare one i have
MCU Running at FOSC 8 mhz.
use TIMER2
Input 2 mhz (FOSC/4)
PRESCALE 64 = 2.000.000 / 64 = 31.250 hz,
Set Compare (PR2) to 31.250
Rollover at 1 sec. approx.
Set POSTSCALE to 15 = 4 times pr minut.
Set Interrupt and add one to variable "numbers_of_runs"
"number_of_runs" up to 60 = 15 minutes. give or take some seconds.
Is this an easy way to do it, ??
Here is from datasheet.
And in main code just a loop that check if "numbers_of_runs" = 60 then do something
Know it's overkill to use that MCU, but all i have.