zero2004
Member level 1
Hi every one
I try to generate a square wave generators of 40 KHz, so i use a 18f4520 PIC and write the following programmes :
int y, yy;
main()
{
do {
portb=0x00;
for(yy=0; yy<20; yy=yy+1)
delay_us(1);
portb = 0xff;
for(yy=0; yy<20; yy=yy+1)
delay_us(1);
}
while(1);
}
the problem is the output frequency is only up to 5 KHz and doesnt increase even i make the for loop condition yy<1
i want to help me
thanks
I try to generate a square wave generators of 40 KHz, so i use a 18f4520 PIC and write the following programmes :
int y, yy;
main()
{
do {
portb=0x00;
for(yy=0; yy<20; yy=yy+1)
delay_us(1);
portb = 0xff;
for(yy=0; yy<20; yy=yy+1)
delay_us(1);
}
while(1);
}
the problem is the output frequency is only up to 5 KHz and doesnt increase even i make the for loop condition yy<1
i want to help me
thanks