Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

pic16f877-oscillator

Status
Not open for further replies.

gomathi

New Member
i am using a power supply of 5V and crystal of 4MHz connected between 13 & 14 th pin. on connecting the power the oscillator doees'nt function which i checked with oscilloscope. only 5V comes in both pin 13 and 14.the set up is made with breadboard and there is continuity that is confirmed by checking with multimeter. can anyone inform if the oscillator has to function irrespective of configuration word of pic16f877. i am also using the following coding for configuration.
LIST P=16F877
#include <P16F877.INC>
__CONFIG _CP_OFF & _WDT_ON & _BODEN_ON & _PWRTE_ON & _XT_OSC & _WRT_ENABLE_ON & _CPD_OFF


ORG 0x00

BSF STATUS, RP0 ;bank 1
CLRF TRISB ;make all portB pins output
CLRF TRISC
BCF STATUS, RP0 ;bank 0

AGAIN:
CLRWDT
MOVLW 0xFF
MOVWF PORTB ;put 0xFF in port B (all pins high)
MOVWF PORTC
goto AGAIN

END
 
Try using other crystal. Chances are very less that a crystal is faulty but once in a blue moon you may get a fauly one. Also check and see that the capacitors are not short.
 
once the microcontroller is powered up, the oscillator should start oscilatting, regardless of your code.
did u connect capacitor at both end of oscillator???

me myself made a stupid mistake while probing the oscillator..
i forgot to adjust the time scale...

there might be problem on the breadboard. i faced similiar problem before, this was solved after transferring the circuit to another breadboard
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top