mugheesnawaz
Member level 1

i am using pic 16f877a for my project and i am using very basic code to get 5V on certain pins,i am using 20Mhz crystal and two 22pF capacitors.i am giving +5v on VDD and gnd on Vss and giving +5V on MCLR.but i dont get any output at all.plz help.i have set the oscillator to HS as i am using 20Mhz crystal.maybe my crystal isnt working how do i verify if its working or not? i am using mplab.i have read on forums about giving 13V to MCLR? is it true? i am giving 5V as of now.


Code:
#include <htc.h>
#define _XTAL_FREQ 20000000
void main()
{
TRISD=0;
while(1)
{
RD2=0;
RD3=1;
RD4=0;
}
}