First time with external oscillator - 16F877a Not working
Hello everyone
It was easy for me upto now using PICKIT2 and 16F690 for all my experiments.
This is the first time I am using an PIC with an external oscillator. My PIC is 16F877A. I have placed the 4Mhz ceramic two pin oscillator as said in the datasheet (between os1 and os2) and 15pF from osc pins to gnd. My program is simple and all pins need to be Digital I\O.
I am creating an .Hex file using PBP with MPLAB and then loading it onto my PIC using MELAB U2 USB programmer (Hope I can do it this way?)
Oscillator selection is XT, wdt on, PUT on, BOD on, Low V. Prog Disabled, Data EE.... On, Flash program Write Off, Code protect On AND my simple code is :
DEFINE OSC 4
intcon=0
adcon0=%000
adcon1=%1110
cmcon=%000
@ ERRORLEVEL -306 ( It is for my actual code which is very loooooooooooong)
trisb=%00111111
portb=0
Include "modedefs.bas"
while 1
toggle portb.6
pause 30
wend
The above is not working. Please help.
___________________
WHY things get boring when they work just fine?
Bookmarks