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.

problem in generating the pwm output

Status
Not open for further replies.

sangeetha sangu

Newbie level 4
Newbie level 4
Joined
Mar 4, 2013
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Visit site
Activity points
1,355
hi, i have posted the code ,please can anyone tell me what is the problem in generating the pwm output

int freq,rpm,prpm,k;

interrupt service routine
{
k++
portb=0x02;
}
input capture service routine
int crpm=tcnt1;
freq=tcnt1;
if(tov1)
{
rpm=((tov1*65535)/freq)+((crpm-prpm)/freq);
}
else
{
rpm=((crpm-prpm)/freq);
}
prpm=crpm;
k=0;
}
voidmain(void)
while(1)
{
int i,j;
int ton=0;
for(i=0;i<100;i++)
{
for(j=0;j<=freq;j++)
{
for(ton-0;ton<100;ton++)
{
ocrial=ton/rpm;
}
}
}
}
}
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top