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

PWM 8 bit or in 10 bit mode ?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
40inD



Joined: 30 Jul 2007
Posts: 112
Location: Moscow, Russia

View user's profile Send private message

PWM 8 bit or in 10 bit mode ?
PostPosted: Thu Apr 03, 2014 1:52 am     Reply with quote

http://www.ccsinfo.com/forum/viewtopic.php?t=45968
If i write for 12F683:
Code:

#device adc=8
...
int16 adcval;
...
 adcval=read_adc()*132/255;  // 100% duty is 132 (WHY?)
    set_pwm1_duty((int)adcval);


PWM will be in 8 bit or in 10 bit mode?
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Thu Apr 03, 2014 6:09 am     Reply with quote

40inD wrote:
If i write for 12F683:

Code:


#device adc=8
...
int16 adcval;
...
 adcval=read_adc()*132/255;  // 100% duty is 132 (WHY?)
    set_pwm1_duty((int)adcval);


PWM will be in 8 bit or in 10 bit mode?
Try it, and see.

Mike

BTW This is an old thread!

+++++++++++++++++++++
New thread created per request.
- Forum Moderator
+++++++++++++++++++++
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Thu Apr 03, 2014 8:04 am     Reply with quote

Quote:

PWM will be in 8 bit or in 10 bit mode?


its all in the data sheet section 11.3

have you read 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