View previous topic :: View next topic |
Author |
Message |
1980best
Joined: 25 May 2007 Posts: 26
|
24FV32KA pwm ...GOOD.. |
Posted: Sun Jan 22, 2012 2:18 pm |
|
|
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
|
Re: 24FV32KA302 pwm, timer, please help |
Posted: Mon Jan 23, 2012 8:52 am |
|
|
hımm |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9240 Location: Greensville,Ontario
|
|
Posted: Mon Jan 23, 2012 8:56 am |
|
|
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! |
|
|
|