View previous topic :: View next topic |
Author |
Message |
mkuang
Joined: 14 Dec 2007 Posts: 257
|
|
Posted: Sat Feb 06, 2010 2:57 pm |
|
|
What do you have connected to the MCLR pin. Is it pulled high? |
|
|
Hicham
Joined: 09 Feb 2010 Posts: 17
|
|
Posted: Tue Feb 09, 2010 7:31 am |
|
|
Hello,
i have the same problem with Proteus, i made a code that set the PWM duty cycle based on a variable resistor (pic 16F876). and i had weird results
when i increase the resistor the PWM works just fine. and i can see the signal in the scope and you can tell its a perfect simulation.
But when decreasing the resistor i get a 0 signal.
I checked the AD conversion and it works just fine,i put 8 leds in PORTB and copy the AD result in it PORTB each time new result comes.
I checked CCPR1L register and its works fine (in watch window) ,it updates each time,and the same for CCPR1H. as you might know CCPR1L is the register to put the PWM ducty cycle in, and the PIC hardware will copy it in CCPR1H in the beginning of each cycle. this was in version 7.4
and i have just updated to version 7.6 and guess what .nothing works it always gives me 0 duty cycle
after all this tests.i can say that Proteus has a big bug in 16F876 familly. |
|
|
memoally
Joined: 25 Jan 2010 Posts: 35
|
|
Posted: Tue Feb 09, 2010 12:04 pm |
|
|
I solved the problem, thank you for your interest and help... _________________ compiler version: 4.105
pic: 16f876
clock frequency: 4MHz |
|
|
Hicham
Joined: 09 Feb 2010 Posts: 17
|
|
Posted: Wed Feb 10, 2010 8:48 am |
|
|
how
can you tell me ? |
|
|
|