Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Crystal in 16F877 how to know it works or not

Status
Not open for further replies.

fuyejun

Newbie level 4
Joined
Nov 19, 2009
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,326
Hi

I used a 20MHZ crystal for my 16F877 , I test the chip by on and off a LED connect to PINA1, But I found that when I cut the line which connected 2 capacitors 22pF and ground. The LED also function well.
I checked the datasheet 16F877 do not have internal oscillator. This confused me a lot.
Then I want to found weather my crystal work. Can anyone told me how to measure it. I try many time and found it's not work.
I connect 2 prob of digital oscilloscope to 2 pin of crystal, but no signal. Then I try use 1 pin connect to crystal ,the other connect to ground also no signal.
I used Hi_tech compiler, do I need add __CONFIG(); to my code. I fund that this when I don't use this word, the pic16f877 also can work, ADC, or DAC or LCD display all can work.
 

Yes, you need to set config bits, but since this PIC doesn't have internal oscillator, external oscillator is set by default, but you should set it for HS. I think it's working. The PIC operates without those 2 capacitors. Even if you don't connect those two capacitors, the PIC will work. However, if you disconnect the crystal, the LED should not work.
 

Dear fuyejun,
I think you will help this
HTML:
 #include <p16f877a.inc>

__CONFIG   _WDT_OFF   &   _HS_OSC


First connect your 4MHz OSC to PIC using oscillator XT and apply proper delay that you can see blink led. Then change your oscillator 20MHz changing __CONFIG bit I shown above using same delay and monitor led operation
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top