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

PIC18f2331, PWM module

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
hisham.i



Joined: 22 Aug 2010
Posts: 43

View user's profile Send private message

PIC18f2331, PWM module
PostPosted: Fri Aug 27, 2010 7:49 am     Reply with quote

Hello,
Am using pic18f2331, and I want to get pwm outputs...but am not so good in pwm, so I want to know some information about the parameters of pwm functions.
Code:

setup_power_pwm(modes, postscale, time_base, period, compare, compare_postscale, dead_time)

What is meant by the time base?
How can I calculate it?
The second thing is in the calculation of the pwm period. In the data sheet there is a parameter called PTMRPS, which I don't know what it is.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Aug 27, 2010 3:30 pm     Reply with quote

The 18F2331 data sheet says what it is:

Quote:
17.3 PWM Time Base
The PWM time base is provided by a 12-bit timer with
prescaler and postscaler functions.

That's the PTMR register in the PIC data sheet.


This post has some example code, and a brief explanation of the
parameters.
http://www.ccsinfo.com/forum/viewtopic.php?t=30061&start=7

The CCS manual also will help, if you download it.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
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