hai everyone I am using MPLABX IDE with hitech c compiler. I wrote a program to just blink a led at pin RD2. The delay time i programmed is 1second. But the actual delay time is more than 15 seconds . why is that?. How to solve it?
the program is as below
#include<pic.h>
#define _XTAL_FREQ 4000000
void main()
{
TRISD = 0x00;
PORTD=0x00;
while(1)
{
RD2=0;
__delay_ms(1000);
RD2 = 1;
__delay_ms(1000);
}
}
the program is as below
#include<pic.h>
#define _XTAL_FREQ 4000000
void main()
{
TRISD = 0x00;
PORTD=0x00;
while(1)
{
RD2=0;
__delay_ms(1000);
RD2 = 1;
__delay_ms(1000);
}
}
Last edited: