hi....i am new to pic18f452...i have written a simple c code to generate pulses in port D of it...i used mplab c18 compiler and pickit 3 to program the pic....the program is as follows....
#include<p18f452.h>
#pragma config OSC=HS
#pragma config OSCS=OFF
#pragma config WDT =OFF
void main()
{
int i;
TRISD=0;
PORTD=0x00;
while(1)
{
for(i=0;i<10;i++)
{
PORTD=0x00;
}
for(i=0;i<10;i++)
{
PORTD=0xff;
}
}
}
the output expected is a continuous pulses from every pin of PORTD.
i'm attaching the output which i got in oscilloscope...
the 1st figure shows the output of a pin of the port D....i am getting pulses for a short duration, then the output remains low for a short interval, then again i obtain pulses....this cycle repeats...
why is the output low for a short interval?
#include<p18f452.h>
#pragma config OSC=HS
#pragma config OSCS=OFF
#pragma config WDT =OFF
void main()
{
int i;
TRISD=0;
PORTD=0x00;
while(1)
{
for(i=0;i<10;i++)
{
PORTD=0x00;
}
for(i=0;i<10;i++)
{
PORTD=0xff;
}
}
}
the output expected is a continuous pulses from every pin of PORTD.
i'm attaching the output which i got in oscilloscope...
the 1st figure shows the output of a pin of the port D....i am getting pulses for a short duration, then the output remains low for a short interval, then again i obtain pulses....this cycle repeats...
why is the output low for a short interval?
Attachments
-
90.8 KB Views: 15
-
67 KB Views: 15
-
96 KB Views: 14