need a small accurate 100Hz oscillator  - Page 1
Forum section: electronics / projects

author: deth502
author_rank: Frequent Contributor
timestamp: January 04, 2014, 11:50:52 pm
content: nearly finished with my current project. only thing missing is... well, the most important part. i need a time base for my .01sec timer to trigger on (100Hz triggered on the falling edge)ive tried various types of r/c circuits, but none have had any kind of reasonable accuracy. i dont think im asking for much, but the best ive managed to build, id tune to 100Hz, and within 5 min was already out by over 10%. i tried letting it run for an hour to "stabilize" and then calibrated it, but the results were practically the same.ive tried going the crystal route, but any simple, low part xtal osc ive tried i cannot get to work, and any ive got to work have been far too large, especially considering all of the extra circuitry id need to divide the signal down to 100Hz afterwards.ive got both +9vdc battery and a regulated 5vdc power available as power sources. itd be super to get it to fit on a piece of perfboard 10 holes x 10 holes, but i can go slightly larger and still fit in the enclosure.im open to ideas.

author: casper.bang
author_rank: Frequent Contributor
timestamp: January 04, 2014, 11:55:44 pm
content: Too bad you are in the US. In Europe I would've tapped into the DC supply after rectifiers before capacitor.

author: Rerouter
author_rank: Super Contributor
timestamp: January 04, 2014, 11:56:59 pm
content: would a real time clock chip be possible? a number of those give outputs of 1000 or 1 pps, there may be one that can do your magic 100,

author: dannyf
author_rank: Super Contributor
timestamp: January 05, 2014, 12:01:57 am
content: With a little micro, you can easily program it to do that.A more complex solution would be a crystal + counter (HC4060 for example).

author: Frost
author_rank: Regular Contributor
timestamp: January 05, 2014, 12:39:19 am
content: What's with the Maxim DS3231 together with an HC4017?The DS3231 delivers a very accurate 1kHz square wavesignal at it's SQW output Pin and with the HC4017you can divide it by 10But as a con the DS3231 requires a microcontroller tohandle the I2C setup routine and it's not so small.

author: deth502
author_rank: Frequent Contributor
timestamp: January 05, 2014, 12:57:40 am
content: for the frequency division, i actually already had this in mind:http://www.leapsecond.com/pic/picdiv.htmsimple 8 pin dip, no external components. all the hex code is right there so i can cook one myself, or buy one if i choose.but that still leaves the signal to feed into it...im absolutely 100% stupid afa micros. i have a cheap programmer that i could never get to work because you could only use the hex code (^^^ above website has hex code files!!!!) and i JUST bought a pikkit 3 (JUST, as in it came in the mail thursday) so as far as the micro solutions go, please feel free to talk down to me like im an idiot. afaik, arduino can run independently after programming with just an xtal and a cap, but the only ones ive seen were huge 20 pin+ packages. if there is some other way to skin this cat, im all ears.

author: dannyf
author_rank: Super Contributor
timestamp: January 05, 2014, 01:10:11 am
content: QuoteYou sure can feed it something but don't need to: the micro can run on either its internal rc oscillator, or an external crystal (+internal oscillator). It can generate a 100Hz signal stand-alone, with the right code: all it needs is to count 1000000/100/2 = 5000 pulses from its interal 4Mhz oscillator, and then flip a pin.Fairly simple code.

author: deth502
author_rank: Frequent Contributor
timestamp: January 05, 2014, 01:27:21 am
content: Quote from: dannyf on January 05, 2014, 01:10:11 amso your saying that with a 12f675, and NOTHING ELSE, i can get a stable accurate signal? this would be perfect.

author: deth502
author_rank: Frequent Contributor
timestamp: January 05, 2014, 01:29:32 am
content: especially if the hex code already existed and was easily available for it.

author: Rufus
author_rank: Super Contributor
timestamp: January 05, 2014, 01:58:48 am
content: Quote from: deth502 on January 05, 2014, 01:27:21 amYou 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.

author: deth502
author_rank: Frequent Contributor
timestamp: January 05, 2014, 02:02:17 am
content: Quote from: Rufus on January 05, 2014, 01:58:48 aman oscillator that would stay between 98 and 102Hz indefinitely would be fine for my purposes. with my r/c trials i was deviating beyond that after less than a minute of operation.

author: Rufus
author_rank: Super Contributor
timestamp: January 05, 2014, 02:36:41 am
content: Quote from: deth502 on January 05, 2014, 02:02:17 amYou were doing something wrong. You should be able to get 1% stability from a 555 timer oscillator if you use a stable capacitor type. If you are not going to use a crystal a 555 would be a simpler solution than a PIC, however, you would learn less.

author: Rerouter
author_rank: Super Contributor
timestamp: January 05, 2014, 02:58:37 am
content: by chance what capacitor where you using? if its a ceramic or electrolytic i can see it drifting like mad,try a film cap, if you pick a capacitor with a good enough temp and voltage tolerance i could see reaching 0.1% easily,

author: deth502
author_rank: Frequent Contributor
timestamp: January 05, 2014, 06:04:10 am
content: Quote from: Rerouter on January 05, 2014, 02:58:37 amdidnt even bother trying a 'lytic, didnt have any polypropylene on hand. other than that, all of them. ceramic, tantalum, polyester, ect.. best results was a dipped metal polyester film and one of those little box caps (they are all metalized polyester too, right?)i might be mis-remembering how quickly it drifted, but it wasnt an exaggeration. im tempted to board it back up and test again.

author: codeboy2k
author_rank: Super Contributor
timestamp: January 05, 2014, 07:15:55 am
content: Quote from: Rufus on January 05, 2014, 01:58:48 amI 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.

author: owiecc
author_rank: Frequent Contributor
timestamp: January 05, 2014, 09:02:59 am
content: Quote from: Rerouter on January 05, 2014, 02:58:37 amI remember Dave saying in one of his videos that certain types of caps have NTC and other PTC behaviour. Conecting the two in parallel woulc compensate the cap drift.

author: oldway
author_rank: Super Contributor
timestamp: January 05, 2014, 09:05:13 am
content: Quote from: Rufus on January 05, 2014, 02:36:41 amI agree, what you are doing wrong is to use a bipolar 555 and not a Cmos 555. (TLC555 for example.)

author: Jon86
author_rank: Frequent Contributor
timestamp: January 05, 2014, 11:14:45 am
content: Pic with a crystal. If not Pic then almost any other micro should be fine too, but having a crystal in there is going to significantly increase the accuracy.

author: Strada916
author_rank: Frequent Contributor
timestamp: January 05, 2014, 11:35:09 am
content: Go to youtube and search the channel w2aew then look at one of his videos called "Build a crystal oscillator from schematic thru prototype construction and testing - DIY" youtube is blocked from where i am typing this.Then all you need to do is find a suitable crystal and a divide by chip(s).eg A crystal at 1MHz can be divided down to 100Hz with 4 x 4017 daisy chained.That might be a high ic count though

author: dannyf
author_rank: Super Contributor
timestamp: January 05, 2014, 11:49:30 am
content: QuoteYes.

author: dannyf
author_rank: Super Contributor
timestamp: January 05, 2014, 11:51:24 am
content: 555: you can also configure a mcu into external rc oscillator (which would be identical to a 555). But why bother if better alternatives exist?

author: plesa
author_rank: Frequent Contributor
timestamp: January 05, 2014, 12:17:15 pm
content: Quote from: deth502 on January 04, 2014, 11:50:52 pmMake a modification of this for example.http://www.leapsecond.com/pic/picdiv.htm

author: grumpydoc
author_rank: Super Contributor
timestamp: January 05, 2014, 12:31:03 pm
content: QuoteDoes seem a little high, but a PIC seems to be overkill somewhat, though being able to do it all in an 8 pin packagedoesseem attractive.A 1.6384MHz crystal and a CD4020 would do the trick. The only snag is that 1.6384MHz crystals aren't especially common - though a Google did turn up a couple of small suppliers in the UK. 3.2768MHz is much easier to find but the 4020 is only 14 stages so can divide by 16384 max.A 3.2768MHz crystal, a 4020 and the d-type of your choice would fit the bill nicely.

author: jolshefsky
author_rank: Regular Contributor
timestamp: January 05, 2014, 01:09:13 pm
content: Quote from: deth502 on January 04, 2014, 11:50:52 pmI was just thinking your RC oscillator may get so much drift from the type of capacitor. I was looking for a good cap to use for a rather tight filter application, and did some reading and found you can get very stable capacitors that use the NP0 ceramic with a C0G rating. According tothe Wikipedia article, "an 'NP0' capacitor with EIA code 'C0G' will have 0 drift, with a tolerance of ±30 ppm/K". The NP0 ceramic also doesn't change with age:Using a CMOS inverter RC ring oscillator, you can get the capacitor pretty small since the input impedance is so high. For instance, a 0.1µF and 1M? resistor, trimmed as needed, will get you 10Hz.

author: dannyf
author_rank: Super Contributor
timestamp: January 05, 2014, 01:30:28 pm
content: Rc oscillators are not very stable, particularly in terms of phase.if you are not pressured for time, I can write a short piece for 12f675 to generate the pulse, plus allows voltage running - making the chip a vcxo.

author: deth502
author_rank: Frequent Contributor
timestamp: January 05, 2014, 01:47:05 pm
content: Quote from: codeboy2k on January 05, 2014, 07:15:55 amreason 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.

author: dannyf
author_rank: Super Contributor
timestamp: January 05, 2014, 02:03:14 pm
content: 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.

author: codeboy2k
author_rank: Super Contributor
timestamp: January 05, 2014, 02:50:42 pm
content: 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.

author: oldway
author_rank: Super Contributor
timestamp: January 05, 2014, 02:51:30 pm
content: Using a pic for making a simple 100 Hz oscillator ?You are kiddingHere 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)

author: Jon86
author_rank: Frequent Contributor
timestamp: January 05, 2014, 03:09:11 pm
content: Quote from: oldway on January 05, 2014, 02:51:30 pmWhy 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?

author: oldway
author_rank: Super Contributor
timestamp: January 05, 2014, 03:29:41 pm
content: Quote from: Jon86 on January 05, 2014, 03:09:11 pmMore components?01 x TLC555 or equivalent01 x 4049B01 x 0.1µF condensator (c2 is not essential)03 x resistors (if trimpot is not used and replace with ajusted resistors)

author: fcb
author_rank: Super Contributor
timestamp: January 05, 2014, 03:30:31 pm
content: 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.

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: January 05, 2014, 03:30:52 pm
content: 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 SOT232x 0402This is a silicon oscillator based timer. The duty cycle is 50% from built in divider.Link to the datasheet:http://www.linear.com/product/LTC6991I have attached the LTspice model.No programing requiredRegards,Jay_Diddy_B

author: Rufus
author_rank: Super Contributor
timestamp: January 05, 2014, 03:48:55 pm
content: Quote from: oldway on January 05, 2014, 03:29:41 pmYes more components. A PIC needs no other components except a supply decoupling capacitor if you don't already have some.Quote from: Jay_Diddy_B on January 05, 2014, 03:30:52 pm$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.

author: codeboy2k
author_rank: Super Contributor
timestamp: January 05, 2014, 03:50:45 pm
content: Quote from: oldway on January 05, 2014, 02:51:30 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.Quote from: oldway on January 05, 2014, 03:29:41 pmPIC:01 x PIC12F67501 x 0.1u bypass capRE: 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 ]

author: vk6zgo
author_rank: Super Contributor
timestamp: January 05, 2014, 04:28:20 pm
content: 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.

author: Rufus
author_rank: Super Contributor
timestamp: January 05, 2014, 04:31:43 pm
content: Quote from: vk6zgo on January 05, 2014, 04:28:20 pmDividing by 327.68 to get 100Hz isn't so simple.

author: oldway
author_rank: Super Contributor
timestamp: January 05, 2014, 04:40:30 pm
content: 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.

author: vk6zgo
author_rank: Super Contributor
timestamp: January 05, 2014, 04:51:39 pm
content: Quote from: Rufus on January 05, 2014, 04:31:43 pmYep!But you could probably "pull" the crystal to an integral number.

author: oldway
author_rank: Super Contributor
timestamp: January 05, 2014, 05:22:53 pm
content: 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.

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: January 05, 2014, 05:25:52 pm
content: Quote from: codeboy2k on January 05, 2014, 03:50:45 pm$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

author: deth502
author_rank: Frequent Contributor
timestamp: January 05, 2014, 05:37:11 pm
content: Quote from: codeboy2k on January 05, 2014, 03:50:45 pmthis 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.

author: Rufus
author_rank: Super Contributor
timestamp: January 05, 2014, 05:46:46 pm
content: Quote from: deth502 on January 05, 2014, 05:37:11 pmIt has a built in oscillator (like almost all PICs) which needs an external crystal and two small capacitors.

author: codeboy2k
author_rank: Super Contributor
timestamp: January 05, 2014, 07:01:49 pm
content: 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.

author: Zero999
author_rank: Super Contributor
timestamp: January 05, 2014, 08:18:47 pm
content: Quote from: fcb on January 05, 2014, 03:30:31 pmYes, though I think the 74HC4060 would be better as it has a built-on oscillator.

author: fcb
author_rank: Super Contributor
timestamp: January 05, 2014, 08:27:43 pm
content: Quote from: Hero999 on January 05, 2014, 08:18:47 pmQuite 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.

author: codeboy2k
author_rank: Super Contributor
timestamp: January 05, 2014, 08:35:04 pm
content: Quote from: fcb on January 05, 2014, 08:27:43 pmAgreed. There's more than one way to skin a clock

author: dannyf
author_rank: Super Contributor
timestamp: January 05, 2014, 08:42:11 pm
content: QuoteFor 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::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:00000001FFSave 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.

author: dannyf
author_rank: Super Contributor
timestamp: January 05, 2014, 08:46:13 pm
content: QuoteEven 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).

author: mrkev
author_rank: Regular Contributor
timestamp: January 05, 2014, 08:47:45 pm
content: 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)...

author: FrankBuss
author_rank: Unknown
timestamp: January 05, 2014, 09:38:32 pm
content: Quote from: dannyf on January 05, 2014, 08:42:11 pmNice, I just did the same, but only 100 Hz output:http://www.frank-buss.de/PIC100/index.htmlDo you want to share your source code? My version doesn't use a timer, which makes it easer to implement zero jitter (except from the RC oscillator itself).I hope it works for the PIC12F675, I could test it for my PIC12F509 only, and simulated the PIC12F675 with the MPLAB-X simulator.

author: FrankBuss
author_rank: Unknown
timestamp: January 05, 2014, 09:54:06 pm
content: Quote from: dannyf on January 05, 2014, 08:42:11 pmAnother interesting idea would be to implement a calibration function. The PIC12F675 has an EEPROM, which can be used to store the OSCCAL value and this can be trimmed with two external switches.But looks like the factory calibration is already very stable. I can measure 99.6 Hz and even with freezer spray it is still 99.3 Hz and it goes to 100 Hz when heating it with a soldering iron. I guess the 555 circuit is not that precise.

author: deth502
author_rank: Frequent Contributor
timestamp: January 05, 2014, 10:37:44 pm
content: very nice. i cant thank you enough, guys. especially danny and frank for helping with the code!!now im going to have to remember where i stuck that programmer........

author: dannyf
author_rank: Super Contributor
timestamp: January 05, 2014, 10:57:32 pm
content: I tried on a fresh 12F675 (never programmed before). With literally nothing else, I got 100.46hz on the 100Hz line. I recaliberated it in pickit2 and it ended with the same osccal value.Yes, I used timer 0: used it to generate 1Khz, and then divided it down from there to get 100hz and then divided that down to 1hz. 13 lines of code to generate those outputs. All in, flash is 25% utilized.Pin 2/3 not used - it can be further utilized, if you want, to implement other frequencies - like 2hz, or sub 1hz. Or to be used with a crystal for better stability. You can also use GP4 for voltage-controlled output: put a pot on it and adc the pot's position to alter the output. In case rc oscillators are utilized, you can implement a range of +/-2%; In the case of crystal oscillators, +/- 50ppm would be more than sufficient.Pin 4 not yet used - it can be used to implement enable / disable via MCLR or as an gpio pin (for instant start-up).

author: FrankBuss
author_rank: Unknown
timestamp: January 05, 2014, 11:23:25 pm
content: Quote from: deth502 on January 05, 2014, 10:37:44 pmMy pleasure. Another nice usage for cheap PICs, even without a DAC, is to create analog signals, for example a low frequency sine wave:http://www.frank-buss.de/blinker/index.htmlYou should try to code in PIC assembler. PICs are byzantine, sometimes the registers are not intuitive and not easy to use (e.g. for your microcontroller, if you want to use the other GPIOs, don't forget to disable the analog function, see the ANSEL register), the assembler instruction set is a nightmare, compared to e.g. a nice 68k CPU, but they are still very useful for such simple tasks, and it is some kind of geeky fun to wrap your head around it. And you can get the chips forever, even the old ones, unlike some other vendors like Atmel, who sometimes discontinue chips or where it is difficult to get some chips.

author: FrankBuss
author_rank: Unknown
timestamp: January 05, 2014, 11:33:49 pm
content: Quote from: dannyf on January 05, 2014, 10:57:32 pmNice, that's short. And depending on the application, the jitter is no problem for the 100 Hz signal, would be only a few us.

author: mrkev
author_rank: Regular Contributor
timestamp: January 05, 2014, 11:49:26 pm
content: Quote from: FrankBuss on January 05, 2014, 11:23:25 pmWell it's always nice to see non-uC solution, but it's not a surprise that people won't do itthe price of those microcontrolers is just crazy, as some are cheaper than basic passive parts, can't even buy one small beer for that price (and I am tallking here, in CZ where the beer is cheaper than water)...It still feels like using bombs to kill flies tho

author: dannyf
author_rank: Super Contributor
timestamp: January 06, 2014, 12:32:23 am
content: QuoteThe way I implemented it, the jitter does show up on the 1khz signal -> no impact on long-term frequency stability, however. The benefit of this particular approach is the ease to implement calibration down to ppm levels.If that's not important, you can implement it by loading offset (or use a chip with auto reloading) and no jitter - 16f684 for example could be used for that. The calibration, however, can only be done in 1/256 increments, which I think may be too coarse for crystal oscillators.

author: oldway
author_rank: Super Contributor
timestamp: January 06, 2014, 06:48:25 am
content: QuoteSchematic I have proposed is designed to not depend of the supply voltage ( the 4049B ensures that the voltages for charging and discharging the capacitor are exactly 0V and the voltage of the power supply) , nor influenced by the impedance of the 555 input . ( this is the reason for choosing the cmos 555 version) .Therefore, the oscillation frequency depends essentially of the R x C value.For this frequency to be stable , it is necessary that this value does vary as little as possible with the temperature .Two approaches are possible:- Or to choose components with low temperature coefficient ( capacitor Metallized Polyphenylene - Sulphide (PPS) )- Or to choose components with temperature coefficients which compensate each other. (resistance with positive temperature coefficient (TCR) and capacitor with negative coefficient )Given the high variation of frequency allowed (from 98 to 102 Hz) , there is no problem at all getting the required frequency stability in a reasonable range of temperature.

author: plesa
author_rank: Frequent Contributor
timestamp: January 06, 2014, 04:33:13 pm
content: Quote from: FrankBuss on January 05, 2014, 11:23:25 pmI found strange behavioral. The OSCAL value does not affect the frequency and switching on and off can change the frequency ( tested with Pickit2 and two brand new 12F675 )Manytimes the output frequency is set to 92.05.. but after several on/off cycles frequency is changes to 122Hz or other frequency which is quiet odd.

author: dannyf
author_rank: Super Contributor
timestamp: January 07, 2014, 12:28:04 am
content: I can confirm that frank's code does generate a 100hz signal.If it didn't work for me, the issue may be somewhere else.

author: FrankBuss
author_rank: Unknown
timestamp: January 07, 2014, 06:31:36 am
content: Quote from: plesa on January 06, 2014, 04:33:13 pmThat's interesting. Maybe it is related to the _BODEN_OFF setting and slow falling/rising supply voltage and then some registers are not initialized correctly? I can turn it on and off as often as I want and it is always 99.6 Hz, but it is a PIC12F509. I will buy a PIC12F675 with my next order for my DIY bitcoin miner and then test it again.

author: deth502
author_rank: Frequent Contributor
timestamp: January 18, 2014, 11:03:14 pm
content: Quote from: plesa on January 06, 2014, 04:33:13 pmfinally found the programmer and hooked it up. ended up using franks program. i loaded up danys and it was soooooo small on teh chip, i thought i was missing something, lol. so then i tried franks and it was also very small, so i just went ahead and burned it, i guess it was easier than i thought.anyway, imo, works great. i tried it and also had some fluctuations when turning it on and off. mine only varied between 99-104.5Hz though, close enough for me, but the important part for me, is that it STAYS at that. the r/c and 555 circuit drifted so terribly under operation, in the order of more than a few Hz a minute. this one is rock stable once running. and as far as the -1/+4.5 tolerance, again, as long as the error is repeatable, which it is, then it is perfect for my needs.thanks again to dan and frank!!

author: arnold
author_rank: Newbie
timestamp: April 29, 2018, 08:24:20 pm
content: sorry about the delay, however you can use MM5369EST with 3.58 MHz crystal to produce very accurate 100 Hz signal.If you use MM5369AA, it's 60 Hz output.http://www.seekic.com/circuit_diagram/Automotive_Circuit/The_60Hz_time_based_generator_composed_of_MM5369.html