| Author |
Message |
   
gordon
Frequent Contributor Username: gordon
Post Number: 780 Registered: 05-2005
Rating: N/A Votes: 0 (Vote!) | | Posted on Saturday, 18 February, 2012 - 05:54 pm: |
|
Hi All, I want to alter the frequency of a 4MHz crystal by a few kHz. I know you can add a variable capacitor in series with the crystal, to vary the frequency a little. Looking on the Web, I found some references to using a small inductor in series as well as the variable capacitor. Just wondered if anybody has dabbled in this, and can give some values for the inductor needed, and what sort of frequency variation can be obtained. |
   
cjaysharp
Frequent Contributor Username: cjaysharp
Post Number: 196 Registered: 06-2010
Rating: N/A Votes: 0 (Vote!) | | Posted on Saturday, 18 February, 2012 - 06:29 pm: |
|
I think maybe a few KHz is a little optimistic. I think it'll be difficult to 'pull' it more than a hundred Hz or so either way from the centre. |
   
vlf
Frequent Contributor Username: vlf
Post Number: 294 Registered: 10-2005

Rating: N/A Votes: 0 (Vote!) | | Posted on Saturday, 18 February, 2012 - 07:16 pm: |
|
cjaysharp is correct gordon, xtals are cut for Fundamental Series or Parallel Resonant frequency, or cut for an Overtone; overtone xtals would make use of an inductor tank-tune L/C for the desired overtone frequency... otherwise, fundamental xtals operate at the stated frequency to pull them depend on the type having been cut for it's frequency; however they normally do not pull more than +/- 100 Htz. At 4Mhz in a colpitts Osc circuit, a C-value between 47 to 100pf would do... and will depend on output you require too, as you pull the xtal it's output will reduce too... look at the Parallel Resonant Circuit, it has no need for an inductor, but requires a parallel cut xtal, that normally this is the type offered at most web-sites, however it's best to check this first. See below URL, lots of useful circuits: http://hem.passagen.se/communication/txo.html Regards, Brian L. (Message edited by vlf on 18 February, 2012) |
   
cjaysharp
Frequent Contributor Username: cjaysharp
Post Number: 197 Registered: 06-2010
Rating: N/A Votes: 0 (Vote!) | | Posted on Saturday, 18 February, 2012 - 08:42 pm: |
|
You can, if you're feeling very adventurous, 'modify' a crystal, you can raise or lower the frequency significantly (significantly is relative to the accuracy of the crystal) by 'penning' it or raise it by grinding it. I'm interested to know why you'd want to move a crystal by KHz though? |
   
terry
Frequent Contributor Username: terry
Post Number: 653 Registered: 05-2005
Rating: N/A Votes: 0 (Vote!) | | Posted on Saturday, 18 February, 2012 - 09:54 pm: |
|
I used to add a preset cap via a switch to the crystal in CB radio's to effectively add a channel 41 to a 40 channel set. Terry |
   
g6osv
Frequent Contributor Username: g6osv
Post Number: 151 Registered: 05-2005
Rating: N/A Votes: 0 (Vote!) | | Posted on Saturday, 18 February, 2012 - 10:10 pm: |
|
Ahhh but that is by a pll the shift is multiplied by the phse locked loop. Ian been there done that |
   
gordon
Frequent Contributor Username: gordon
Post Number: 781 Registered: 05-2005
Rating: N/A Votes: 0 (Vote!) | | Posted on Sunday, 19 February, 2012 - 11:19 am: |
|
Hi All, Thanks for the suggestions so far. The reason for altering the crystal is I found a PIC LED clock project on the Web, and I have all the parts. Connected it up on a breadboard, works, but the clock loses about 3 seconds in an hour. The normal solution would be to adjust the timing in the software, but I only have the HEX code. Not sure if having the crystal on a breadboard would affect the timing this much, but from what has been said this should only be a few hundred ppm max. |
   
foxyrick
Valued Member Username: foxyrick
Post Number: 13 Registered: 01-2012
Rating: N/A Votes: 0 (Vote!) | | Posted on Monday, 20 February, 2012 - 12:25 pm: |
|
That's quite a bit out then. It equates to the crystal being off by over 800ppm, and needing raising by nearly 3.5KHz. Do you have a few other 4MHz crystals you could try? You might get lucky. Or try leaning it to one side, that works for my automatic watch I would suspect that the code is a bit dodgy myself though, rather than the crystal being that far off unless it's a cheap one from somewhere foreign with poor QC. |
   
cjaysharp
Frequent Contributor Username: cjaysharp
Post Number: 199 Registered: 06-2010
Rating: N/A Votes: 0 (Vote!) | | Posted on Monday, 20 February, 2012 - 12:32 pm: |
|
I'm not so sure, I think the use of a prescaler with a timer will multiply the error. |
   
gordon
Frequent Contributor Username: gordon
Post Number: 782 Registered: 05-2005
Rating: N/A Votes: 0 (Vote!) | | Posted on Monday, 20 February, 2012 - 12:50 pm: |
|
I did try it with a 3.2768MHz crystal, and the time was out by a similar factor, so I thought the software was probably to blame. There might be some other projects on the Web, that might be more accurate, but the display I have is a 4 digit CC multiplexed type, so the choices are limited. |
   
cjaysharp
Frequent Contributor Username: cjaysharp
Post Number: 200 Registered: 06-2010
Rating: N/A Votes: 0 (Vote!) | | Posted on Monday, 20 February, 2012 - 12:53 pm: |
|
So there were two versions of the code? A link might be helpful  |
   
gordon
Frequent Contributor Username: gordon
Post Number: 784 Registered: 05-2005
Rating: N/A Votes: 0 (Vote!) | | Posted on Monday, 20 February, 2012 - 01:11 pm: |
|
There are two versions of the code for 12 and 24 hour clocks, but both are for 4MHz crystals. When I used the 3.2768MHz, I calculated what the time should be, but it was still out by about 1 second in a thousand. The project is here http://www.electronica-pt.com/circuitos/en/pics/85-digital-clock.html Just realised, the ASM is included. Could someone have a look, and see if there is a simple fix in the software. |
   
alexr
Frequent Contributor Username: alexr
Post Number: 201 Registered: 02-2008
Rating: N/A Votes: 0 (Vote!) | | Posted on Monday, 20 February, 2012 - 03:41 pm: |
|
Looks more like a hardware problem to me. It could be that your circuit layout is causing parasitic oscillations that are driving the PIC rather than the crystal or maybe the PIC configuration bits are not set to enable the crystal oscillator. Either way the PIC is not being driven by the crystal. I say this because if you were loosing 3 seconds per hour when using a 4MHz crystal then using a 3.2768MHz crystal you should be loosing about 10 minutes per hour. The fact that your error remains about the same indicates that the crystal is not driving the PIC. Alex
|
   
cjaysharp
Frequent Contributor Username: cjaysharp
Post Number: 201 Registered: 06-2010
Rating: N/A Votes: 0 (Vote!) | | Posted on Monday, 20 February, 2012 - 04:08 pm: |
|
Doubt It's parasitic oscillation if the clock is accurate to 3 seconds, (Gordon said he'd calculated the time using the 3.2768MHz Crystal) it's the Crystal that's being affected by the breadboard or the software isn't as accurate as it should be or perhaps both. |
   
alexr
Frequent Contributor Username: alexr
Post Number: 202 Registered: 02-2008
Rating: N/A Votes: 0 (Vote!) | | Posted on Monday, 20 February, 2012 - 04:33 pm: |
|
As I understand it the time was out 3 seconds per hour with the 4MHz Xtal then with the 3.2768MHz crystal it was out by a similar amount. If that is true then the crystal can't be controlling the oscillator frequency. Alex
|
   
vlf
Frequent Contributor Username: vlf
Post Number: 296 Registered: 10-2005

Rating: N/A Votes: 0 (Vote!) | | Posted on Monday, 20 February, 2012 - 04:56 pm: |
|
Hi... I use bread-board for R.F. experiments, and measured the capacity between any two side-by-side tracks, to be 3.2pf... thus, I ensure osc/xtals and alike R.F. areas, get a 3 to 4 track spacing where possible; also I place links to Ve, two tracks away either side from any working R.F. tracks for screening. It's possible the extra tracks if there side-by-side holding the xtal, is reducing it's fundamental frequency !, recommend check this area out... It's just occurred to me that again, are you sure your using a fundamental parallel xtal at 4Mhz... otherwise if it's an overtone, this would account for the large seconds drift. Regards, Brian L. (Message edited by vlf on 20 February, 2012) |
   
gordon
Frequent Contributor Username: gordon
Post Number: 785 Registered: 05-2005
Rating: N/A Votes: 0 (Vote!) | | Posted on Monday, 20 February, 2012 - 05:07 pm: |
|
Sorry, what I meant was with the 3.2768MHz crystal, I worked out the percentage slower it should be, if the circuit was counting right. If I worked it out right, I should get 2949 pulses from the seconds LED, in a hour. I got about 3 less, so it is still about the same error. This assumes that it is not parasitic oscillation, and the PIC counting is at fault. If I measure the frequency from osc. out at pin 15, I get about 4.000300MHz, with a 4MHz crystal, no adjustment. (Message edited by gordon on 20 February, 2012) |
   
cjaysharp
Frequent Contributor Username: cjaysharp
Post Number: 202 Registered: 06-2010
Rating: N/A Votes: 0 (Vote!) | | Posted on Monday, 20 February, 2012 - 05:39 pm: |
|
I thought that was what you meant, that the error is fairly constant makes me think it's the breadboard pulling the crystal enough to give you the error and/or the software. The assembly listing is also in the ZIP file so simulating it using the stopwatch in MPLAB should give an idea of how accurate it is. |
   
cjaysharp
Frequent Contributor Username: cjaysharp
Post Number: 204 Registered: 06-2010
Rating: N/A Votes: 0 (Vote!) | | Posted on Monday, 20 February, 2012 - 07:13 pm: |
|
Blimey, I've just created a project around the code, set up some complex breakpoints so I can trap the timer intervals and looked at the special function registers then thought 'is that *all* the SFRs?' I think I'm spending too much time with the bigger chips  |
   
rob_guyer
Regular Contributor Username: rob_guyer
Post Number: 31 Registered: 08-2011
Rating: N/A Votes: 0 (Vote!) | | Posted on Saturday, 25 February, 2012 - 01:47 am: |
|
Substitution of this Xtal proved it OK but Xtals can shift frequency markedly sometimes when a connection point on the quartz slice develops a hairline fault, allowing an unwanted vibration node to emerge. Check by tapping the suspect while listening to a CW receiver. |
   
gordon
Frequent Contributor Username: gordon
Post Number: 787 Registered: 05-2005
Rating: N/A Votes: 0 (Vote!) | | Posted on Tuesday, 28 February, 2012 - 11:46 am: |
|
I have managed to do a few experiments with putting an inductor in series with the crystal. Using a 100uH inductor in series, I get the crystal vibrating several hundred Hertz lower. Not really enough to correct the timing. An additional effect is the crystal frequency is more sensitive to temperature. I am giving up on this solution, and will look for a different clock project. |
   
atferrari
Frequent Contributor Username: atferrari
Post Number: 1205 Registered: 05-2005

Rating: N/A Votes: 0 (Vote!) | | Posted on Friday, 02 March, 2012 - 10:05 pm: |
|
Maybe here? http://g4oep.atspace.com/pulling/pulling.htm Agustín Tomás - Buenos Aires - Argentina
|