CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Why can't I generate pulses with pwm? help please
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
mkuang



Joined: 14 Dec 2007
Posts: 257

View user's profile Send private message Send e-mail

PostPosted: Sat Feb 06, 2010 2:57 pm     Reply with quote

What do you have connected to the MCLR pin. Is it pulled high?
Hicham



Joined: 09 Feb 2010
Posts: 17

View user's profile Send private message

PostPosted: Tue Feb 09, 2010 7:31 am     Reply with quote

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

View user's profile Send private message MSN Messenger

PostPosted: Tue Feb 09, 2010 12:04 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Feb 10, 2010 8:48 am     Reply with quote

how
can you tell me ?
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group