What you want is not much different from the interrupt code I posted in your other thread.
You just need to add a line to count the interrupt events.
Regardless, I would begin with DTs Elapsed Time code,
and add the portb.0 interrupt from there.
If you just get the elapsed timer working,
so you can check within any program that the SecondsChanged
variable is set (a second has ticked over),
it already contains an interrupt routine for a timer.
Then trust me, I'm in a good position to help you.
You don't add to what you've got,
best put it aside and use parts of it that do what you want,
but consider beginning with the Elapsed timer demo and adding what you need to that.




Bookmarks