CRYSTAL NOT CONNECTED BUT PIC STILL RUNS. - Page 1
Forum section: electronics / beginners

author: neko efecktz
author_rank: Regular Contributor
timestamp: July 05, 2016, 02:02:21 am
content: I am working on a pic project using PIC16F877A driving a LCD display 2 x 16.The project is at the moment on a breadboard and the pic takes up more than its share of holes to plug other components into.My breadboard is two 65 column boards joined and mounted on a piece on MDF.There wasn't much room for the crystal to fit right next to the chip so I fitted it onto the second board with wires about 100mm long.I was experimenting with different frequency crystals and on one occasion accidentally plugged the crystal into an adjoining set of holes.The display came on as normal and worked fine.I only noticed my mistake when I went to try another crystal.The crystal was correctly terminated to OSC1Out of curiosity I moved the wire to the next set of holes out and it still worked up to 4 rows of holes away although it took a little longer for the chip to start about 0.5 second longer.I then tried reversing things. OSC2 connected and OSC1 in error.This time it only worked to 3 holes awayThis would have to be capacitance coupling between the rows of holes.I then decided to try using a gimmick of about 50mm long with a gap of 6 rows. This also worked.I cut it in half and it stiil works.I cut it down until there was only one twist, approx 8mm, in the wire still ok.Unfortunately I only have a multimeter to measure capacitance not good enough I'm afraid.GIMMICK.This dates back to the vacuum tube days. When a very small value of capacitance was needed in a circuit, usually at very high frequencies (30-50-200 MHz.), two pieces of insulated wire were connected to the two points where the capacitor was needed. Then, the two wires were twisted together, in a double helix DNA-like shape, until the desired effect was achieved. The more 'wraps' or turns, the more capacitance it had.I have had other projects just not behaving as expected or getting the right results on the breadboard but having to make component value changes once built up on PCD or Veroboard.I remember Dave Jones doing a video on breadboard capacitances.Might be worth another look at.he measured about 2pF to 2.5pF per trackhttps://youtu.be/6GIscUsnlM0It may be worth looking into some time.

author: Richard Crowley
author_rank: Super Contributor
timestamp: July 05, 2016, 04:27:44 am
content: Some microcontrollers will self-oscillate for a clock if no external reference, crystal, resonator or R/C circuit are provided.That particular microcontroller appears to have EIGHT different oscillator modes. Do you know WHICH mode it is configured for?Ref:http://ww1.microchip.com/downloads/en/DeviceDoc/31002a.pdf

author: neko efecktz
author_rank: Regular Contributor
timestamp: July 05, 2016, 03:33:05 pm
content: Gidday RichardThankyou for the link to the oscillator help sheet.i'll have a look in the morning.just got home from work 1:15 in the morning here.You asked about the mode the oscillator was running.It is configured for FOSC = HS.I'm just a newbie to micro controllers so i have a lot to learn but there a a lot of good blokes on this and other blogs that are willing to give advice.I hope to be able to do the same as I get more into pics.Anyway the floating crystal was an interesting diversion from my project.But it goes to show that breadboards can cause problems in the right situation.Did you watch the video by David.i have a couple of breadboards mounted on 3mm alloy plates that have always caused problems.Must go to bed now.Thank you once again for the ocsillator book.good nightBill.