Author Topic: need a small accurate 100Hz oscillator  (Read 27730 times)

0 Members and 1 Guest are viewing this topic.

Offline deth502Topic starter

  • Frequent Contributor
  • **
  • Posts: 418
  • Country: us
Re: need a small accurate 100Hz oscillator
« Reply #25 on: January 05, 2014, 01:47:05 pm »
so your saying that with a 12f675, and NOTHING ELSE, i can get a stable accurate signal? this would be perfect.

You will get about 1% accuracy from a PIC12F675 internal RC oscillator. More like 2% with temperature and supply voltage spread.

The chip can be used with an external crystal or ceramic resonator if you need better.

I would be surprised if you could find exactly the code you need.

I would use a PIC10F200... it's less than 0.60 USD and also has a ±1% accurate internal RC oscillator.

A 555 is generally cheaper, at less than 0.40 to 0.50, but when you consider you need to add a stable cap to it, it is a solution with more components and maybe now exceeds the area and price of a standalone PIC10F200.

reason i mention the 12f675 is because i actually have them on hand. ive got no problem picking up a few 10f200's if they are going to work better.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: need a small accurate 100Hz oscillator
« Reply #26 on: January 05, 2014, 02:03:14 pm »
If you are doing it on a mcu, you probably want the following:

- out frequencies: 1000/100/1hz.
- enable/disable pin.
- volt controlled running.

that means 3iutput puns, 1 digital input and 1 analog input.

12f675 seems perfect for this, especially if you already have them.
================================
https://dannyelectronics.wordpress.com/
 

Offline codeboy2k

  • Super Contributor
  • ***
  • Posts: 1836
  • Country: ca
Re: need a small accurate 100Hz oscillator
« Reply #27 on: January 05, 2014, 02:50:42 pm »
Yeah, 12f675's are better if you already have them on hand, and this gives you more pins anyways vs. a 6-pin 10f200.  With more pins you can get the extra features that dannyf describes.

 

Offline oldway

  • Super Contributor
  • ***
  • !
  • Posts: 2172
Re: need a small accurate 100Hz oscillator
« Reply #28 on: January 05, 2014, 02:51:30 pm »
Using a pic for making a simple 100 Hz oscillator ? |O
You are kidding  :-DD
Here is a simple 100Hz oscillator as stable as a Xtal.
NB: TLC555 = Cmos version of the 555.
C1 : low temperature coefficient condensator.
For highest stability, trimpot R2 (22K) may be substituted by adjusted resistor. (ajusted for 100 Hz)
« Last Edit: January 05, 2014, 03:05:36 pm by oldway »
 

Offline Jon86

  • Frequent Contributor
  • **
  • Posts: 526
  • Country: gb
Re: need a small accurate 100Hz oscillator
« Reply #29 on: January 05, 2014, 03:09:11 pm »
Using a pic for making a simple 100 Hz oscillator ? |O
You are kidding  :-DD
Here is a simple 100Hz oscillator as stable as a Xtal.
NB: TLC555 = Cmos version of the 555.
C1 : low temperature coefficient condensator.
For highest stability, trimpot R2 (22K) may be substituted by adjusted resistor. (ajusted for 100 Hz)

Why not? The circuit you showed uses many more components and is less accurate. I don't see how a single 8-pin micro by itself is a bad idea?
Death, taxes and diode losses.
 

Offline oldway

  • Super Contributor
  • ***
  • !
  • Posts: 2172
Re: need a small accurate 100Hz oscillator
« Reply #30 on: January 05, 2014, 03:29:41 pm »
Using a pic for making a simple 100 Hz oscillator ? |O
You are kidding  :-DD
Here is a simple 100Hz oscillator as stable as a Xtal.
NB: TLC555 = Cmos version of the 555.
C1 : low temperature coefficient condensator.
For highest stability, trimpot R2 (22K) may be substituted by adjusted resistor. (ajusted for 100 Hz)

Why not? The circuit you showed uses many more components and is less accurate. I don't see how a single 8-pin micro by itself is a bad idea?
More components?
01 x TLC555 or equivalent
01 x 4049B
01 x 0.1µF condensator (c2 is not essential)
03 x resistors (if trimpot is not used and replace with ajusted resistors)
 

Offline fcb

  • Super Contributor
  • ***
  • Posts: 2129
  • Country: gb
  • Test instrument designer/G1YWC
    • Electron Plus
Re: need a small accurate 100Hz oscillator
« Reply #31 on: January 05, 2014, 03:30:31 pm »
Watch out for feature creep with a microcontroller.

My favorite fit&forget solution would be 3.2768MHz xtal driving (and driven by) a 74HC4020, then feeding the output from this into another 74HC4020.

You need a 15 stage divider for 3.2768MHz, so you can play with the different taps (7 stage feeding an 8 stage, 9 stage feeding a 6 stage etc...)

The 74HC4020 is very cheap and using two doesn't complicate the BOM - no programming also.  There is also a schematic of the xtal oscillator rigging in the NXP datasheet.
https://electron.plus Power Analysers, VI Signature Testers, Voltage References, Picoammeters, Curve Tracers.
 

Offline Jay_Diddy_B

  • Super Contributor
  • ***
  • Posts: 2758
  • Country: ca
Re: need a small accurate 100Hz oscillator
« Reply #32 on: January 05, 2014, 03:30:52 pm »
Hi,

Here is a solution that will get you a very small solution size. The accuracy is <1.5% over the full temperature range. The solution size:

1x SOT23
2x 0402


This is a silicon oscillator based timer. The duty cycle is 50% from built in divider.






Link to the datasheet: http://www.linear.com/product/LTC6991

I have attached the LTspice model.

No programing required  :-+

Regards,

Jay_Diddy_B
 

Offline Rufus

  • Super Contributor
  • ***
  • Posts: 2095
Re: need a small accurate 100Hz oscillator
« Reply #33 on: January 05, 2014, 03:48:55 pm »
More components?
01 x TLC555 or equivalent
01 x 4049B
01 x 0.1µF condensator (c2 is not essential)
03 x resistors (if trimpot is not used and replace with ajusted resistors)
Yes more components. A PIC needs no other components except a supply decoupling capacitor if you don't already have some.

Link to the datasheet: http://www.linear.com/product/LTC6991
$3 100 off from Digikey is the problem with that suggestion and it is barely more accurate than a PIC10F200 which is also in SOT-23 and costs $0.34 100 off from Digikey.
 

Offline codeboy2k

  • Super Contributor
  • ***
  • Posts: 1836
  • Country: ca
Re: need a small accurate 100Hz oscillator
« Reply #34 on: January 05, 2014, 03:50:45 pm »
Using a pic for making a simple 100 Hz oscillator ? |O

...because OP has them on hand, they have a built-in, factory-trimmed RC oscillator stable to 1%, and OP already tried to use a 555 (albeit not the TLC555) and it was unstable, again using the parts OP had on hand.

Yes, your solution uses more parts and requires quality caps, and even then may not be better than a few percent accurate.  And it won't be as stable as a crystal, like you claim. Plus an analog input of the PIC can be used to make a temperature compensated oscillator, if needed.

More components?
01 x TLC555 or equivalent
01 x 4049B
01 x 0.1µF condensator (c2 is not essential)
03 x resistors (if trimpot is not used and replace with ajusted resistors)
PIC:
01 x PIC12F675
01 x 0.1u bypass cap

RE: LTC6991 - nice part, but $3.80???
The PIC12F675 is $1.26.  I wouldn't use that part in a design but OP has it on hand.  I would use the cheaper 10F200 at $0.68 for an oscillator like this.

The TLC555 is $0.87,  the cd4049  $0.51, the 60ppm precision thin-film cap might be $0.50 to $0.70

[ edit: I always quote 1 off prices here rather than 100 or 1k because often the OP is making less than 100 anyways, and the relative pricing is still clear using 1 offs ]

« Last Edit: January 05, 2014, 03:57:10 pm by codeboy2k »
 

Offline vk6zgo

  • Super Contributor
  • ***
  • Posts: 7677
  • Country: au
Re: need a small accurate 100Hz oscillator
« Reply #35 on: January 05, 2014, 04:28:20 pm »
You could use a watch crystal---less division.

Another way is to use a 100Hz oscillator which is triggered every 10 cycles from a 10Hz pulse derived by dividing the 60Hz mains  by 6.     

Messy?--I know,but it's how it would have been done back in the day!

Or you could heterodyne two stable low frequency crystal oscillators.
 

Offline Rufus

  • Super Contributor
  • ***
  • Posts: 2095
Re: need a small accurate 100Hz oscillator
« Reply #36 on: January 05, 2014, 04:31:43 pm »
You could use a watch crystal---less division.

Dividing by 327.68 to get 100Hz isn't so simple.
 

Offline oldway

  • Super Contributor
  • ***
  • !
  • Posts: 2172
Re: need a small accurate 100Hz oscillator
« Reply #37 on: January 05, 2014, 04:40:30 pm »
I pay 6€ for 40 x TS555 (same as TLC555) smd. (0.15€ each) (ebay.de)
For 4049b smd, waiting for good deal, i pay only 0.1€ each.
 

Offline vk6zgo

  • Super Contributor
  • ***
  • Posts: 7677
  • Country: au
Re: need a small accurate 100Hz oscillator
« Reply #38 on: January 05, 2014, 04:51:39 pm »
You could use a watch crystal---less division.

Dividing by 327.68 to get 100Hz isn't so simple.

Yep!
But you could probably "pull" the crystal to an integral number.
 

Offline oldway

  • Super Contributor
  • ***
  • !
  • Posts: 2172
Re: need a small accurate 100Hz oscillator
« Reply #39 on: January 05, 2014, 05:22:53 pm »
As condensator, a 0.1µF WIMA MKS-3 seems to be good enough to reach the stability request for the temperature range. (98-102Hz)
Output frequency is not voltage dependent: no variation for power supply between 4V to 6V.
 

Offline Jay_Diddy_B

  • Super Contributor
  • ***
  • Posts: 2758
  • Country: ca
Re: need a small accurate 100Hz oscillator
« Reply #40 on: January 05, 2014, 05:25:52 pm »
[RE: LTC6991 - nice part, but $3.80???

$3.80 is the Digikey price for 1 piece.

The price on the Linear website is $1.88:



When you consider that you don't need a precision capacitor or a crystal this is quite good.

If the original post needs 1 or 2 parts, he can get samples from Linear free.

Jay_Diddy_B

 

Offline deth502Topic starter

  • Frequent Contributor
  • **
  • Posts: 418
  • Country: us
Re: need a small accurate 100Hz oscillator
« Reply #41 on: January 05, 2014, 05:37:11 pm »

...because OP has them on hand, they have a built-in, factory-trimmed RC oscillator stable to 1%, and OP already tried to use a 555 (albeit not the TLC555) and it was unstable, again using the parts OP had on hand.

Yes, your solution uses more parts and requires quality caps, and even then may not be better than a few percent accurate.  And it won't be as stable as a crystal, like you claim. Plus an analog input of the PIC can be used to make a temperature compensated oscillator, if needed.


this pretty much hits the nail on the head.

ok, so about the xtal, afa i know, to get my 12f675 to mate to an xtal, it needs a driver circuit for it. i also know that there are other micros that exist that are made to made up with a crystal directly, no drivers required. is there another small 8 pin dip micro that could mate directly to a crystal that would be a better candidate, or is the xtal really not that necessary? like i said, i dont need world clock accuracy, but the best metalized poly film caps i could muster deviated >10% within minutes. the more accurate the better, obviously, but im not launching space shuttles.
 

Offline Rufus

  • Super Contributor
  • ***
  • Posts: 2095
Re: need a small accurate 100Hz oscillator
« Reply #42 on: January 05, 2014, 05:46:46 pm »
ok, so about the xtal, afa i know, to get my 12f675 to mate to an xtal, it needs a driver circuit for it.

It has a built in oscillator (like almost all PICs) which needs an external crystal and two small capacitors.
 

Offline codeboy2k

  • Super Contributor
  • ***
  • Posts: 1836
  • Country: ca
Re: need a small accurate 100Hz oscillator
« Reply #43 on: January 05, 2014, 07:01:49 pm »
The good thing about using the PIC is you can start without a crystal and use the internal oscillator. It might be good enough. If you are making a PC board, you can place the pads for a crystal and 2 caps to add later, should you need better accuracy than the internal RC oscillator can deliver.

 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 19842
  • Country: gb
  • 0999
Re: need a small accurate 100Hz oscillator
« Reply #44 on: January 05, 2014, 08:18:47 pm »
Watch out for feature creep with a microcontroller.

My favorite fit&forget solution would be 3.2768MHz xtal driving (and driven by) a 74HC4020, then feeding the output from this into another 74HC4020.

You need a 15 stage divider for 3.2768MHz, so you can play with the different taps (7 stage feeding an 8 stage, 9 stage feeding a 6 stage etc...)

The 74HC4020 is very cheap and using two doesn't complicate the BOM - no programming also.  There is also a schematic of the xtal oscillator rigging in the NXP datasheet.
Yes, though I think the 74HC4060 would be better as it has a built-on oscillator.
 

Offline fcb

  • Super Contributor
  • ***
  • Posts: 2129
  • Country: gb
  • Test instrument designer/G1YWC
    • Electron Plus
Re: need a small accurate 100Hz oscillator
« Reply #45 on: January 05, 2014, 08:27:43 pm »
Watch out for feature creep with a microcontroller.

My favorite fit&forget solution would be 3.2768MHz xtal driving (and driven by) a 74HC4020, then feeding the output from this into another 74HC4020.

You need a 15 stage divider for 3.2768MHz, so you can play with the different taps (7 stage feeding an 8 stage, 9 stage feeding a 6 stage etc...)

The 74HC4020 is very cheap and using two doesn't complicate the BOM - no programming also.  There is also a schematic of the xtal oscillator rigging in the NXP datasheet.
Yes, though I think the 74HC4060 would be better as it has a built-on oscillator.

Quite right... that's the one I meant to write & the data sheet I was reading.

...The OP now has a number of well thought-out options with most of the pros/cons discussed - a most satisfying thread I think.
https://electron.plus Power Analysers, VI Signature Testers, Voltage References, Picoammeters, Curve Tracers.
 

Offline codeboy2k

  • Super Contributor
  • ***
  • Posts: 1836
  • Country: ca
Re: need a small accurate 100Hz oscillator
« Reply #46 on: January 05, 2014, 08:35:04 pm »
...The OP now has a number of well thought-out options with most of the pros/cons discussed - a most satisfying thread I think.

Agreed.  There's more than one way to skin a clock :)
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: need a small accurate 100Hz oscillator
« Reply #47 on: January 05, 2014, 08:42:11 pm »
Quote
is the xtal really not that necessary?

For what you do, no.

I put this together quickly but it will generate 3 frequencies, 1khz/100hz/1hz, on a 12F675's 7/6/5 pins, respectively. In addition to the pic, no other part is required, though a decoupling cap (.1uf) + 3 resistors (220ohm each on the output, for protection) would be nice.

Code: [Select]
:020000002C28AA
:10000800A00003088301AA000B1101308312A30783
:100018002302F43003192202031C26280130850626
:100028000C30A2070318A30AFE30A307A60B262844
:10003800023085060A30A600A70B2628043085065C
:100048006430A70083122A088300A00E200E09003E
:1000580021308400263040200030A9006130A800FB
:1000680026308400283045208316FF239000830122
:10007800052904068001840A0406031D3D2864003E
:100088000034DC0050208000840A04085C06031950
:10009800003446288312A800A91B592829088A0079
:1000A8002808A80A0319A90A8200831329188317A4
:1000B8002808A80A8400000808000A346434831257
:1000C800A4008A28F3309F0583169F111F119F10E3
:1000D8001F14A3281F08F33904389F0083169F11A3
:1000E8001F119F1487281F08F33908389F008316AB
:1000F8009F111F1586281F08F3390C389F00831697
:100108009F151F119F101F10A328892883122408E8
:100118000C39DE00DF019E285E08003A03196628C4
:10012800043A03196E280C3A03197728043A03197C
:100138007F2889285F08003A031990288928000039
:1001480000000000000000000000000083129F145F
:100158009F18AC281E08DD00DC0183161E08DC048D
:1001680083120800831224088312FE202508A400A5
:10017800A501C028FF30FE2024080319A503A40305
:10018800240A0319250A03190800BE28D028C830F4
:10019800A400A5018312B620831224080319A5031D
:1001A800A403240A0319250A03190800CB28831677
:1001B8001F139F161F1683129F111F119F171F13BE
:1001C8000C1383160C1383121F140800F8308312C3
:1001D80085058316850581128115831281010B110E
:1001E8008B16080007308312990083169F0181132C
:1001F800831208008312A4008312A403240F002989
:0C02080008008312F620EA208B17092959
:02400E00843FED
:00000001FF

Save the above in a hex file and burn to a pic12f675. It will start generate the output frequencies right away.

I will implement enable/disable + voltage tuning of the output later on.
================================
https://dannyelectronics.wordpress.com/
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: need a small accurate 100Hz oscillator
« Reply #48 on: January 05, 2014, 08:46:13 pm »
Quote
which needs an external crystal and two small capacitors.

Even those two small capacitors can be ignored - crystal's pullability is very low, especially if you pick a crystal with ~6pf of load capacitance (which is roughly the parasitic capacitance on a pin).
================================
https://dannyelectronics.wordpress.com/
 

Offline mrkev

  • Regular Contributor
  • *
  • Posts: 225
  • Country: cz
Re: need a small accurate 100Hz oscillator
« Reply #49 on: January 05, 2014, 08:47:45 pm »
Well, to my mind came more than one solution...

- Using 555. I would use simple current source to charge that capacitor, as the low value cap is better for this, but high value resistor isn't; plus you would get rid of slight voltage dependability. You can actually get very close to 0,2% with 555 and right components...

- I would personaly use 32,768kHz basic watch xtal, with 9 bit (8+1) counter that would reset on 328th pulse. That way you would get very precise 99,9Hz...

- Back in the day, they would use something like 300Hz - 3kHz VCO, that would be divided by 3 (output) and 5 (for sync. with the 120V/60Hz wall...).

- there are IO with complete solution, you just add a timing resistor (i think something like that mentioned someone above)...
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf