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.

Problem with crystal oscillator / PIC 16F870

Status
Not open for further replies.

ripkars

Junior Member level 1
Joined
Feb 23, 2007
Messages
19
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,422
pic16f870

Hi all,
I am encountering a problem with a PIC16F870
1) I set the fuse Oscillator to HS
2) I link pin 9 (OSCIN) and pin 10 (OSCOUT) with an 8Mhz crystal
3) I link to ground pin 9 & 10
This is exactly what the datasheet says to do. I wrote a code proven working with a RC oscillator; is there anyone who knows the rason why when i replace the RC oscillator with the crystal in the way descibed above the circuit stops working?
The code i'm referring to is posted here: https://groups.google.it/group/it.h...a73d3ebbef0/09564bdd6680624d#09564bdd6680624d
I can state theat the crystal circuit does not work (and that it's not too fast) because the led on RA2 doesn't seem to turn on
Thanks all and escuse my awful english,
Riccardo
 

pic crystal oscillator problem

If you connect pins 9 and 10 to ground, you have no clock as well. You should connect each crystal pin to pins 9 and 10 of the PIC and connect two 22pF ceramic capacitors (or any value around this) from ground to these crystal/PIC pins. See datasheet for picture.
 

problems with pic16f870

Excuse me it was wat i wanted to say...
9---ceramic_capacitor_22pf----gnd
10---ceramic_capacitor_22pf---gnd
This configuration does not work and i can't say why!!
 

16f870

Check if the PIC suffix is 04P or 20P or IP (for dip packages these means: 4MHz, 20MHz and industrial - 20MHz devices). If it is 04P, probably it will not work at 8MHz.
 

crystal oscillator pic 24

it is ip...
 

16f870 crystal

My last bet :eek:)

Replace the capacitors, maybe they were damaged during soldering (hot can damage them). It already happened to me.

Other guess: maybe your crystal is damaged. Don´t you have another one to make a test ?

Last guess: crystals have two modes of operation: serial resonance and paralel resonance. PIC´s oscillators work with paralel resonance type crystals. Bad luck if you have used one of serial type (not probable, but may be).
 

hobby pic16f870

mmmh...after reading your post i went to my local electronics stuff reseller and TRIED to buy a crystal oscillator but they told me that crystal are no longer sold!!! So they sold me a ceramic resonator...it is ok or not?? On the datasheet it seems to be quite the same or am i making a mistake?[/GVideo]
 

does pic16f870 have internal oscillator

Ok. Try the ressonator. It is much simple to use (you do not need the capacitors), but you will loose precision, as the ressonator has higher tolerance than the crystal
 

4049 crystal oscillator

But is it sufficiently precise for an asyncronous serial transmission? Is it better to use the ceramic resonator or the RC oscillator?
Thanks a lot
 

crb 1.0m crystal

I think if you use low baud rates it can work with resonator, but at high baud rates (9600 or 4800) you´ll have problems. Resonators have 0.5% tolerance, crystals have 30 to 50ppm ( 0.00005 = 0.005% error).
Does your oscillator work with resonator ? Make a test with serial communication, it may work, but it is not sure for all resonators.

RC oscillators are the worst and less accurate of all. You do not know and do not predict at what frequency they will work, and they are more dependent of temperature.
 

74ls06 oscillator

The resonator i bought does not work. On it is written CRB 1.0M. I linked its two pins between pic's pin 9&10, as described in datasheet.
Any idea?
 

how to use a 2 pin crystal

If the resonator has two pins, then you still need capacitors. If it has three pins, then the middle pin goes to ground.

Is the /MCLR pin high? What are the other config bits? What supply voltage?
 

how to connect crystal to pic

The resonator has only two pins; i'll try to link them with a capacitor and then to ground...

Config bits are:
Oscillator: XT
Watchdog Timer: OFF
Power Up Timer: OFF
Brown Out Detect: OFF
Low Voltage Program: ON
Flash Program Write: ON
Data EE Read Protect: OFF
Code Protect: OFF

/MCLR is set to +5V

Supply voltage is +5V
 

crb1.0m

breadboard has enought capacitance
you simply remove them
or the oscillator is overloaded and will colapse on start
 

resonator crb

I already tried this but it still doesn't work...
:*(
 

1) I forgot that there are 2 pins resonators. Yes you should use the capacitors with 2 pin resonator.

2) Do you have a scope ? Use a high impedance probe (10x position) and check the oscout pin (one of the oscillator pins in the PIC). There should be a signal (the clock).

3) To test the crystal, use an inverter gate (74HC04, 4049, 74LS06, any), and build an oscillator similar to the PIC oscillator. The only additional componentes are 2 resistors: 10Mohm in paralel with the inverter pins and a 100 ohm resistor in series with the crystal (check the datasheet of the PIC to see the diagram. Of course you should use the 22 pF capacitors. IF it works, I think your PIC is damaged (very improbable).

4) For what I remember of the config fuses of 16F870 there is no Low Voltage Programming bit. Are you sure you are doing it correct ?
 

4) I'm uing MPLAB IDE to set the fuses, and, of course, i selected PIC16F870 as device to be programmed

3)I have here 6 PICs: no one of them work... :*(

2)I'm sorry but i haven't got a scope... is there any other way to test the crystals?

Thanks!
 

Sorry, I checked the datasheet, and yes, the 16F870 has the low voltage programming feature. So it can be your problem. Disable the LVP. For some reason, the PIC may enter in the low voltage programming mode (connect this pin to ground anyway). May be your oscillator (with crystal) was running, but the LVP does not allow the normal functioning.

You can also test the oscillator with a frequency counter, or a logic probe. Any instrument that shows you that there is signal oscillations will do the job.
 

ripkars said:
The resonator i bought does not work. On it is written CRB 1.0M. I linked its two pins between pic's pin 9&10, as described in datasheet.
Any idea?

Hi,

The type CRB1.0M is not a 1MHz resonator??? Probably it is... according its typename.

unkarc
 

I noticed only now that there is a location in which it's written the value of the calibration of the oscillator... is that important?

Added after 1 minutes:

unkarc said:
Hi,

The type CRB1.0M is not a 1MHz resonator??? Probably it is... according its typename.

unkarc

Yes it is ... I tried this one after the crystal ...
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top