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 Simulation in uVision2: real Freqeuncy simulated ??

Hi,

I have written an application for the 8051 based Infineon C515C-L mikrocontroller. While testing the application with the simulator of uVision2 a problem arises with the programmed timer interrupt requests. I have programmed timer0 in such a manner, that it requests every 10ms an interrupt. My system clock does not work correctly, as the timer interrupt is requested in less than 10ms. And by the way i have noticed that the timer interrupt is requested every 1ms.

I am working in timer0 Mode 1. The system clock of the C515C-L is 10 MHz. And the timer is run by an 1/6 of the system clock.

PS: The value each time i reload the timer with was examined by many collegeus and it is to 99,999% correct.

Thanks!!

Best regards
Hammoud

Parents
  • Here's a quick but informative thing to try. Take your reload value and cut it in half, check the frequency. Now cut it into a quarter and remeasure the frequency. Does the frequency also double or quadruple? That tells you whether the value is really affecting the simulator frequency or not, and if so in a linear fashion or not. We know what the frequency should be based on calculation but one of the first things an engineer learns is the difference between "should be" and "is".
    Is there a system clock prescaler on that chip?

Reply
  • Here's a quick but informative thing to try. Take your reload value and cut it in half, check the frequency. Now cut it into a quarter and remeasure the frequency. Does the frequency also double or quadruple? That tells you whether the value is really affecting the simulator frequency or not, and if so in a linear fashion or not. We know what the frequency should be based on calculation but one of the first things an engineer learns is the difference between "should be" and "is".
    Is there a system clock prescaler on that chip?

Children
No data