Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PWM Using PIC30F6010A

Status
Not open for further replies.

rmrps

New Member
_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);
}


this is my code pwm pulses generated but the frequency was not changed by changing PTPER value please give me a guidelines to change frequency i am using 16Mhz for controller
 
Last edited:
Status
Not open for further replies.

Latest threads

Back
Top