Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PWM Frequncy Problem

Status
Not open for further replies.

rmrps

Member level 2
Joined
Oct 4, 2011
Messages
42
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,635
_FOSC(CSW_FSCM_OFF & XT_PLL8);
_FWDT(WDT_OFF);
_FBORPOR(PBOR_ON & MCLR_EN & PWRT_OFF);
_FGS(CODE_PROT_ON);

void Delay(unsigned int del);

int main(void)
{

Delay(50000);
Delay(50000);
Delay(50000);
Delay(50000);
Delay(50000);
TRISE=0x00;
PORTE=0x00;
PTCON=0x8004;
PTMR=100;
PTPER=199;
IPC9bits.PWMIP=1;
IFS2bits.PWMIF=0;
IEC2bits.PWMIE=1;
SEVTCMP=0x00;
PWMCON1=0xFFF;
PWMCON2=0x207;
DTCON1=0x4C4C;
DTCON2=0xFF;

FLTACON=0xFF80;
FLTBCON=0xFF80;
OVDCON=0xFF00;
PDC1=0x0A;
PDC2=6553.6;


while(1)
{
Delay(50000);
Delay(50000);
Delay(50000);
}
return (0);
}

void Delay(unsigned int del)
{
while(--del);
}

Hi friends this is my code for generating pwm pulses it is generating 275hz pulses but i want 20khz pulses there is no changes while changing PTPER value Same frequency only coming how to change frequency of pulses i am using 16Mhz PIC30F6010A controller please give me guidelines where to change the code for generating 20khz pulses thanks in advance
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top