Thankx HenrikOlsson
True the problem was due to the simulator was not working properly .Now the code is working fine and I get the correct PWM frequency(5khz) after change the ISIS vasion Thankx for it. But I have the following problem of relating the dutycycle from the theory and that from picdatashetformural.
From theory (dutycycle=(Time-ON/period) for my case
case1: AS seen from the scope when I used the above fomural gives 1/2=0.5=50%
case2: As seen from the scope when I used the above fomural gives 0.1/2=0.05=5%
how these values(case1 and case2) can be related with 40 and 400 values
from pic16f877 datasheet PWM_dutycycle= CCPR1L:CCP1CON<5:4>*TOSC*(TMR2 prscale value)
I 'm confusing how can I relate the value from theory formular and that from datasheet to know that I get the correct results.
Help me to solve this problems because always these two case confusing me.
Thankx




Bookmarks