This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Timer 1 Interrupt 10 sec too late

Hello!

I have a problem with Keil Simulator using an C515C-L for a timer program.

Look here --> www.hashbin.com/293.html

The Problem is that the interrupt for timer1 is 10 seconds too late.

Can anyone help me???

Greetings and please excuse my bad english
Jan Wiemer

Parents
  • Sorry I missed what the problem is for "10-seconds too late"? From the code comments you have a 10MHz clock and T1 has a prescaler of 6 so T1 interrupt occurs every 100.2 usecs (with a reload of 89 as you have). So you get 1 second by counting 9980 times. So P4_0 toggles at a 1 second rate.

    I would need more information as to what "10-seconds to late means"?

    What about the watchdog? Did you do anything with this?

Reply
  • Sorry I missed what the problem is for "10-seconds too late"? From the code comments you have a 10MHz clock and T1 has a prescaler of 6 so T1 interrupt occurs every 100.2 usecs (with a reload of 89 as you have). So you get 1 second by counting 9980 times. So P4_0 toggles at a 1 second rate.

    I would need more information as to what "10-seconds to late means"?

    What about the watchdog? Did you do anything with this?

Children