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
You may do a quick hardware test. You should toggle a free port pin in your timer interrupt and measure it with an oscilloscope. Is the interval correct there? Have you specified the correct XTAL frequency in Options for Target - Target?
Hi, First thanks for your quick answer. Yes i did specify the right XTAL frequency in the TARGET-Option(it was set automatically by creating the project). Despite that the timer does not work correctly. As said i compared the value which each time is loaded to the timer after an interrupt: and it is nearly inpossible that an incorrect vlaue is loaded. Best regards Hammoud
What software versions are you using. Also we need to know how you reload the timer. Maybe you send a test project to support.intl@keil.com Reinhard
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?