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 CCS Technical Support

24FV32KA pwm ...GOOD..

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



Joined: 25 May 2007
Posts: 26

View user's profile Send private message

24FV32KA pwm ...GOOD..
PostPosted: Sun Jan 22, 2012 2:18 pm     Reply with quote

SUPER............
Code:

#include <24FV32KA302.h>
#device ADC=12

#FUSES NOWDT //No Watch Dog Timer
#FUSES NOPROTECT //Code not protected from reading
#FUSES NOWRT //Program memory not write protected
#FUSES NODEBUG //No Debug mode for ICD

#FUSES PR                       //Primary Oscillator
#FUSES HS                       //High speed Osc (> 4mhz for PCM/PCH) (>10mhz for PCD)
#FUSES NOOSCIO

#use delay(clock=20000000)  // hs 20mhz osc

void main()
{   
delay_ms(10);   
   
         
SET_TRIS_A(0x0000);     
SET_TRIS_B(0x0000);
 
setup_compare(1,COMPARE_PWM_EDGE | COMPARE_SYSTEM_CLOCK | COMPARE_TRIG_SYNC_SELF);
   set_pwm_period(1, 10000);
   set_pwm_duty   (1,   5000);

     
while(TRUE);   
}


Last edited by 1980best on Mon Jan 30, 2012 2:00 am; edited 1 time in total
razor1983m



Joined: 09 Jun 2011
Posts: 2

View user's profile Send private message

Re: 24FV32KA302 pwm, timer, please help
PostPosted: Mon Jan 23, 2012 8:52 am     Reply with quote

hımm
temtronic



Joined: 01 Jul 2010
Posts: 9240
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Jan 23, 2012 8:56 am     Reply with quote

Best help is for you to press F11 when your project is open! Consult the nice onscreen HELP file that CCS supplies.
Hint...look under 'Builtin Functions'....scroll down to set_pwm...........and read!
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