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
I would come to a different if statement for the "One second compare".
if (int3_count == 9980) { /* Jedes 10000ste Mal */
Thank ya! But the Problem with the 10-Seconds-Delay still exists!
.....
Jan Wiemer
The timer interrupts at rollover and hencenormally upcounts from the loaded value. This will give a count of 166 almost double the expected time.I was not able to understand the comments. So probably your timer should be loaded with 166 tor -89.
Whats your osc frequency?
Suvidh
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?
Hi!
I'm using µVision simulating Infenion C515C-L. This program uses Timer1 in Modus2 (8-Bit Auto-reload) and the OSC-Frequency is 10MHz, whiuch is devided through 6 ==> tclock = 0,6µs.
Im using 100ms aus Start-/Reload-Value.
The exact problem is that the first interrupt needs (exactly) 10 seconds till it "comes". So the counting-procedure starts after 10 seconds, too. After those 10 seconds, it counts fully correctly!
I've uploaded the whole µVision-project as .zip, I hope this will help you to find the problem:
www.bigupload.com/d=8788FBA6
---- Thats my debug.ini: PE_SWD=0 RESET --------------
Greetings Jan W.
I don't think this is a problem with the code but with the Keil Simulator. If you beign with the Timer1 window from the Peripherals window open and then run you don't see the 10 second delay.
Here is the project back with the window open.
www.bigupload.com/d=2EF976D6
Hmmmm, You're right! Thanx :D But I never thought that this is a code-caused problem :D