Simple cheap 1Hz Oscillator - low accuracy fine - Page 1
Forum section: electronics / beginners

author: GarthyD
author_rank: Regular Contributor
timestamp: September 01, 2017, 10:52:54 pm
content: I've been struggling implementing a roughly 1Hz (ie. one pulse per second) oscillator as input to a CPLD for general use as a timeout function, and it's driving me crazy. The function is non-critical but would be a nice addition. Accuracy isn't important. 2MHz instead is fine, for example. An accuracy as awful as +/- 50% is tolerable. I need to keep the cost low. I have made multiple attempts at getting this working. I am on the edge of just cutting this functionality entirely due to the low value and the disproportionately large number of hours spent trying to solve it thus far. I could use some guidance and input.I have a couple of pins and very limited resources from an existing MAX V CPLD available. It is being used to implement a timeout period for a reset function that resets a malfunctioning MCU, with the timeout being measured in seconds. As such, I can't rely on the MCU, which would make this a ten minute problem.The CPLD has an internal oscillator in the order of 4MHz or so. I cannot spare the CPLD resources for a 22-bit counter to convert this into a 1Hz signal.My first major attempt was to use a Schmitt Trigger Oscillator.http://en.wikipedia.org/wiki/Schmitt_trigger#Use_as_an_oscillatorFor the Schmitt Trigger, I used two CPLD pins. The input pin was configured as a Schmitt Trigger Input, and the output pin was simply the inverted value of the input. It kind-of worked, but for some reason was susceptible to other signals going through the board/CPLD. Basically, I could press a button in an unrelated part of the circuit and it would sometimes cause multiple additional pulses to be emitted. I tried several things on the CPLD to work around it, including buffering the last seen input via the internal oscillator, but it did not help.My second major attempt was to use the output of an Astable multivibratorhttps://en.wikipedia.org/wiki/Multivibrator#Astable_multivibratorThis is in place at the moment. I am using C1=C2=10uF ceramic caps and R1=R4=100k R2=R3=470k resistors. When hooked up to a buffer and a LED I am able to observe what looks like a perfect signal- on for about 3/8 second, off for 3/8 second. Unfortunately, when I try to use it in the CPLD to increment a counter (via Schmitt Trigger input, rising edge), and send that counter to external pins, the result is disastrous. Depending on the pin, I see either a steady LED, or a mostly-off LED with occasional dim pulses. I can only guess at the meaning (no oscilloscope) but if I had to guess, at least one bit of the oscillator counter is cycling rapidly and unevenly, which would suggest a very unstable oscillator input. Simulation of the VHDL code used gives perfect results, simulation of the circuit gives perfect results, but it is not behaving on real hardware. The slow rise time of the pulse should be handled by the Schmitt Trigger input, but perhaps my understanding is flawed? Perhaps my code only works in the sim? Here are the relevant bits:Code:sosc: in std_logic; -- This is the input....signal soscc: unsigned(2 downto 0) := (others => '0');signal soscr : std_logic;signal soscx : std_logic;soscx <= (to_x01(sosc));soscr <= (something that will be '1')...uxo(0) <= std_logic(soscc(0)); -- Lit LEDuxo(1) <= std_logic(soscc(1)); -- Dim light pulsing LEDuxo(2) <= std_logic(soscc(2)); -- Dim light pulsing LEDuxo(3) <= soscc(0); -- Lit LEDuxo(4) <= soscc(1); -- Dim light pulsing LEDuxo(5) <= soscc(2); -- Dim light pulsing LEDuxo(6) <= soscx; -- Visually fine. 3/4 second blinking.uxo(7) <= sosc; -- Visually fine. 3/4 second blinking....process(soscx, soscr) isbeginif soscr = '0' thensoscc <= (others => '0');elsif rising_edge(soscx) thensoscc <= soscc + 1;end if;end process;My fallbacks are: (i) remove all functionality relying on it from the CPLD and put it on the MCU, and drop the emergency reset functionality; or (ii) use a 555 timer for the sole purpose of producing a 1Hz output (I haven't done this before, but it sounds easy).Input welcome and really needed.

author: GarthyD
author_rank: Regular Contributor
timestamp: September 02, 2017, 01:11:45 am
content: Thankyou for your thoughts. Firstly, a quick note: I'm quite fine with the software side of things but only an electronics novice, so I do struggle with some electronic concepts. Even finding potential oscillators was a struggle.On the signal integrity front: I'm prototyping on a breadboard with wires so the quick answer to that is that it is probably riddled with signal integrity issues. Still, we're looking at 1Hz not 1MHz+. But then again I'm using up to 470k resistors to get the required timing, so perhaps that is going to limit me here. EDIT: On breadboard only until it becomes a real PCB, this is the next iteration of an existing design.Thankyou for the various ideas you have given to further diagnose the problem. Some I am having trouble following due to my inexperience, but it has also given me a few ideas. Thankyou.Quote from: evb149 on September 01, 2017, 11:16:57 pmI understand and agree with your point. Point me toward a DeLorean and I'll pick up an oscilloscope and other kit on my way back. Had I known in advance the time I'd waste on diagnosing this problem I'd have come out ahead if I'd purchased a new oscilloscope first.I don't know enough about oscilloscopes to not get ripped off when purchasing one secondhand, but I'd love a dirt-cheap secondhand low-end one. Unfortunately the ability to make an informed purchase on a low-end secondhand oscilloscope is probably held mostly by those who no longer need one.Quote from: evb149 on September 01, 2017, 11:16:57 pmIndeed it does. My present finances dictate that I need to prioritise purchases carefully. The problem however has annoyed me enough that I'm considering getting one anyway. It's not the first time one would have helped, but it is the first time I've wasted so much time on a problem that I may have been able to avoid with an oscilloscope.Quote from: evb149 on September 01, 2017, 11:16:57 pmRe low cost: Development of a low volume prototype which is a second iteration of a design that might be produced in larger volumes in the future, and I'd like the fundamentals of the design to be similar. The result is beneficial and a nice feature but ultimately of low importance and on the edge of getting cut. This leads to the low cost goal. That's the short version.Quote from: evb149 on September 01, 2017, 11:16:57 pmSeems to be pricier than a 555 but could be a good backup in case I'm wrong about the 555.Quote from: evb149 on September 01, 2017, 11:16:57 pmApproaching 555 costs but needs more board space.Quote from: evb149 on September 01, 2017, 11:16:57 pmConsidered that approach. Would still need about 15-bits to get this to down to 1Hz. There just aren't enough bits left....One thing I am wondering is if there is perhaps a design that would fit my problem better than the two I have been experimenting with? Or am I headed in the right direction, I just need to find and eliminate the issues I am encountering?Update: I hooked the CPLD oscillator input pin up to a button instead of the oscillator and manually inserted some pulses by just pressing and releasing the button. The counter outputs started working perfectly. It's down to whatever is happening at the output of the oscillator and the input to the CPLD. I'm guessing if I could see this on an oscilloscope it'd be a complete mess.

author: Old Don
author_rank: Regular Contributor
timestamp: September 02, 2017, 01:35:06 am
content: How about a cheap as chips Chinese watch module - one pulse per second/1Hz for the second hand?

author: Brumby
author_rank: Unknown
timestamp: September 02, 2017, 01:52:42 am
content: Personally, if deriving the 1Hz from the existing circuitry is in any way problematic, I would have gone for the 555 timer option.The 555 is ubiquitous. It is used in all manner of equipment and has been found on some pretty significant boards - not just a beginners breadboard. You only need the 555, 2 resistors and a capacitor to get it working - plus another capacitor on the "control" pin, just to bypass any spurious signals.Yes, they are easy to use, are very flexible and do a great job. It is probably the first IC many beginners start playing with. There is even a publication called the 555 Timer Cookbook ... which is all about that little chip.

author: GarthyD
author_rank: Regular Contributor
timestamp: September 02, 2017, 01:55:20 am
content: Quote from: Old Don on September 02, 2017, 01:35:06 amAn interesting idea. If there was a part from a reputable manufacturer that I could purchase, yes. Otherwise, definitely not. Low accuracy is fine, low reliability is not.

author: Brumby
author_rank: Unknown
timestamp: September 02, 2017, 02:00:25 am
content: To show you how easy they are to use - I came across this short video.Be prepared, though. If you have any respect for an analogue multimeter, this is cringeworthy....If he can do that to a meter, his skills aren't refined.

author: GarthyD
author_rank: Regular Contributor
timestamp: September 02, 2017, 08:04:01 am
content: Quote from: Brumby on September 02, 2017, 02:00:25 amWhilst I've never used a 555 myself (I jumped straight to microcontrollers), I have read a fair bit about them, and they seem very versatile, and quite applicable to this sort of problem.Quote from: Brumby on September 02, 2017, 02:00:25 amThey do sound very interesting. If higher accuracy were my priority, or if this was feeding into something more substantial, I would probably have started with one.Quote from: Brumby on September 02, 2017, 02:00:25 amThat poor multimeter....Now, some news:Bad news: I've just discovered that the cheaper 555 ICs I've seen run on 5V. I should have mentioned in my original post that the part of the circuit I'm hooking this up to runs on 3.3V I/O. Sorry for not mentioning this before. It seems that 555s that are fine with 3.3V cost at least twice as much.Good news: I hooked the emitter of the right transistor to the base of another transistor instead of ground, emitter to ground, and collector to: (i) the oscillator input pin, (ii) a strong (1k) pullup to VCC, and (iii) a 100nF cap. The idea is that the clock input drives a transistor that pulls the input pin down to ground, and otherwise lets it be pulled up to VCC. The cap slows transitions. Being behind a transistor stops it messing with the main circuit. The counter is now functioning reasonably reliably. Sans oscilliscope, I'm doing this blindly and just guessing values, but it seems to be working. It is also probably very wasteful, but I haven't measured it.I'll have to weigh up my options re this functionality. I'm having some serious second thoughts re the unexpected difficulty in getting something cheap and simple going. I am uncertain as to the best way to proceed.

author: newbrain
author_rank: Super Contributor
timestamp: September 02, 2017, 11:13:29 am
content: Have you considered a Schmitt Trigger oscillator based on a single gate chip?Something as this:SN74AHC1G14, 2-5.5V, SOT23 so not incredibly small to hand solder.At about 10 cent apiece even in smallish quantities (in EU e.g. onRS, don't know in AU), you just need to add a couple of passives (possibly three, if we include a decoupling cap)..Any 555 will be more expensive, require more PCB real estate and more passives.Of course, if the problem is signal integrity, this might not be the right cure.

author: Ash
author_rank: Regular Contributor
timestamp: September 02, 2017, 01:25:11 pm
content: Hi,Have you considered any of the microprocessor supervisor ICs, commonly called watchdogs? you don't describe the timeout you're trying to detect, but you might be able to directly apply a watchdog chip. They are the classic implementation for detecting wonky micros...A very quick search found STWD100 from ST - this comes in a few (fixed) timing varieties, but more interestingly has a mode where you can have it constantly re-triggering which could give you a single part low frequency oscillator. Just an idea and probably not fully baked..Not the cheapest solution probably though at about $1, but I'm sure there are many other options..Ash.

author: Ian.M
author_rank: Super Contributor
timestamp: September 02, 2017, 01:48:02 pm
content: Another idea: If your design needs a real time clock, many RTC chips have a 1Hz output option.

author: Zero999
author_rank: Super Contributor
timestamp: September 02, 2017, 03:10:59 pm
content: Quote from: newbrain on September 02, 2017, 11:13:29 amI agree. That would be what I would have suggested too. If a buffered output is required, then there's a two gate variant, which doesn't take up much more room and only costs a little more.https://assets.nexperia.com/documents/data-sheet/74HC_HCT2G14.pdf

author: tggzzz
author_rank: Super Contributor
timestamp: September 02, 2017, 03:38:41 pm
content: Quote from: GarthyD on September 02, 2017, 01:11:45 amI will assume you have good quality decoupling. If you are using solderless breadboards, then it is traditional that you will spend more time debugging the breadboard than your circuit.The period (1s) is almost irrelevant from a signal integrity PoV. Whatdoesmatter is the rise/fall time, which is probably 1ns or so. Realise that a traditional rule-of-thumb is BW=0.35/tr, and you will start to understand.Back of envelope calculations...Work out the capacitance, C, that an output is driving through voltage V. Work out the transition time, t. The current required to charge/discharge the capacitor is i = CV/t (from C V = Q = i t, ignoring exponential voltage rise)Wires are inductors; assume 1nH/mm and work out the inductance in a ground or Vcc lead, L.The voltage induced by the current spike charging/discharging the capacitor is v = Li/t (from v= Ldi/dt). That voltage appears in series with the signals on inputs.Don't forget that you will probably be having several outputs changing simultaneously, which increases i and v

author: GarthyD
author_rank: Regular Contributor
timestamp: September 02, 2017, 11:14:52 pm
content: Quote from: newbrain on September 02, 2017, 11:13:29 amYes. I did consider using a separate IC for the Schmitt Trigger for my first attempt, but I didn't have one on hand. :} I thought I'd start out using a couple of CPLD pins due to the integrated optional Schmitt Triggers on inputs. That really didn't turn out well, so going back to a single-gate Schmitt trigger could make it more workable. I could pop a SN74AHC1G14 on a small breakout, solder the resistor and cap directly on top, and probably avoid most of the breadboard-related issues I'm running into. The big plus is that I can control the layout of a separate IC, as opposed to in the CPLD where I can't help that there are either going to be wires (when breadboarding) or traces (when on a PCB) that are going to be positioned fairly close to what I imagine to be a very low current signal coming in. Thanks for the suggestion.Quote from: newbrain on September 02, 2017, 11:13:29 amMostly around 30c or so in smallish quantities, which seems to be the price point of a lot of the simpler ICs.Quote from: newbrain on September 02, 2017, 11:13:29 amI could well run into similar problems as my first attempt, and I'd be diagnosing them blind until I can get my hands on an oscilloscope. Or it could work perfectly. I'll likely get one to experiment with.Quote from: Ash on September 02, 2017, 01:25:11 pmSorry about that.The driving need is an emergency reset, which is for when the attached components (including MCU) get into an unrecoverable state. The idea is that you hold down all of the buttons for a few seconds, and it forces a reset. The "few seconds" bit is driving the need. My thinking was that it would also be useful for controlling anything else that requires long presses, timeouts, or similar.On the other hand, when the MCU is working fine, which it will be most of the time, all of this logic except the emergency reset can be done far more easily on the MCU. So on the other side of the equation is me questioning how essential this functionality even is, and if I should drop it, and just say that if things are so bad and the MCU is so messed up that it is stuck and even the watchdog isn't kicking in, then it's time to open the case and short reset to ground or plug in the debug cable.Quote from: Ash on September 02, 2017, 01:25:11 pmIt's an interesting idea with additional benefits. I like the idea of cheating and using the reset signal as a clock source, that is very clever.Thanks for that.Quote from: Ian.M on September 02, 2017, 01:48:02 pmThat's something I was considering as well, but the price was an issue. Unfortunately I would have no use for an RTC chip in this case as the MCU I am using has one included. On the other hand, if the MCU did not include one, this would be a superb addition as an RTC clock is a neat thing to include and such an IC would give me that plus a 1Hz signal. Thanks for that.I agree. That would be, what I would have suggested too. If a buffered output is required, then there's a two gate variant, which doesn't take up much more room and only costs a little more.Quote from: Hero999 on September 02, 2017, 03:10:59 pmNeat.Quote from: tggzzz on September 02, 2017, 03:38:41 pmI believe so. The CPLD and MCU in my design are on breakouts, but every power input has a cap soldered directly onto the board and attached to the closest ground. Every IC in the breadboard itself has a cap physically adjacent to the power in and a wire cut to the right length to go over the top and end adjacent to the ground.Quote from: tggzzz on September 02, 2017, 03:38:41 pmThat seems to be the general rule.Quote from: tggzzz on September 02, 2017, 03:38:41 pmTo get a 1s period I'm using some fairly large resistors (470k+), and I've tended to associate them with pending trouble when using them with breadboards, even if I don't completely understand the cause.If I'm understanding correctly, the rise and fall time for the first solution I used should be very slow and for the second, at least when simulated, it has a slightly weird but slowish rise time (a very rounded corner), but a very fast fall time.Quote from: tggzzz on September 02, 2017, 03:38:41 pmMuch of this is beyond my current understanding, but I'll do some reading and try to gain enough knowledge to put this to use. Many thanks for your thoughts on this one....Now, a few additional comments.Firstly, I was somewhat tired yesterday and not firing on all cylinders, so I just wanted to add a few things to previous comments:evb149: Thanks for all of the detail in your post, it has given me many leads to follow. I may have written off some of your chip suggestions a bit quickly as I had thought I could get a 555 for about the same price, but it turned out I was basing this on the 4.5V+ 555, which I can't use.Old Don: Thanks for the interesting suggestion. Whilst it might not I cannot use in this case, sometimes these sorts of suggestions can lead to creative solutions.Brumby: Thanks for all of the information on the 555 IC. I do have one buried away somewhere, and whilst I can't use it directly for this problem, I can set up a 5V playground and experiment with it, and get a 3.3V variant if I do decide I want to add itI also ran into some interesting low-cost ICs while looking around:TI CD4151B: An low-cost oscillator IC that uses two resistors and a capacitor to produce a basic signal, and then feeds that into a configurable on-chip counter (up to 16-bit) to produce the output signal. Downside is the large voltage range, size, weird startup conditions, and it's not really designed for lower voltages specifically, even if it supports them.Micrel PL611-01: A low-cost programmable clock generator that can use a crystal or other input signal and from the looks of it *effectively* has a 13-bit counter. With a 32.768KHz crystal I could get a very accurate 4Hz signal, which is really close to what I'm after. Downside is combined cost of parts, I'm not sure it actually supports a 32.768KHz crystal, and I can't seem to find any information as to how you perform its initial programming.This discussion has given me a lot of leads to follow and a whole bunch of information that I can use in the future, which I greatly appreciate. Thankyou to everyone who has shared their thoughts. I think the problem was a little harder and expensive (resources, parts, time) than I realised. When held up against the benefit it provides, it is hard to justify including, at least in the short-term. In the medium-term, and especially when I get some proper tools (ie. an oscilloscope), I'd like to experiment with some of the parts mentioned here, and perhaps there will be a way to integrate the results into my design.

author: Beamin
author_rank: Super Contributor
timestamp: September 02, 2017, 11:49:37 pm
content: Would a simple multi vibrator circuit with some big electrolytics work? Like 470 or 47uf?

author: GarthyD
author_rank: Regular Contributor
timestamp: September 03, 2017, 12:10:02 am
content: Quote from: Beamin on September 02, 2017, 11:49:37 pmThanks for the suggestion. I experimented with lower resistances and higher capacitance with electrolytics while I was setting up the multivibrator circuit, mostly so that it would oscillate slow enough for me to observe the charge/discharge cycle on a multimeter. At that point I didn't have the CPLD counter set up, but I imagine with the lower resistance the problems I encountered might be reduced. Still, sans oscilloscope I'd be running blind.

author: mathsquid
author_rank: Frequent Contributor
timestamp: September 03, 2017, 12:15:44 am
content: What about using a flashing LED as the signal source?

author: GarthyD
author_rank: Regular Contributor
timestamp: September 03, 2017, 03:05:37 am
content: Quote from: mathsquid on September 03, 2017, 12:15:44 amI can't tell if you're making a joke or if I'm missing the point. If the latter, could you elaborate?

author: Ian.M
author_rank: Super Contributor
timestamp: September 03, 2017, 06:21:33 am
content: Why not get away from all the mess of sensitive high impedance circuits and large passives and program a PIC10F200 to produce the desired signal, either from its own internal oscillator, or by dividing down whatever faster clock you have available. You cant get much smaller than a single SOT23-6 or DFN package to do the job, and they are under $0.50 each in reel quantities, even after you add in the cost of factory programming with your code, so are fairly good on the cheapness as well.

author: IanMacdonald
author_rank: Frequent Contributor
timestamp: September 03, 2017, 06:40:15 am
content: If component count is critical, 555 with resistor from pin 3 to pins 2&6 joined, cap from there to -ve. 3 components. Gives nearly equal mark/space, which is hard to achieve with standard circuit using pin 7. Limitation (of all 555 arrangements) is that it starts on an offbeat since the cap takes extra time to charge from 0v into the working range. If it's going to run continuously not an issue though.The astable didn't work because the component values aren't very suitable. You need much lower collector resistors. It will work with base resistors in the range 10 to 100 times higher value than the collector resistors. Also, the Vcc must be less than 6v unless you have base protection diodes.

author: Zero999
author_rank: Super Contributor
timestamp: September 03, 2017, 08:50:54 am
content: Quote from: IanMacdonald on September 03, 2017, 06:40:15 amThe 74HC14 circuit also has that issue too. The solution is to use two capacitors, to both supply rails.LTSpice simulation

author: stmdude
author_rank: Frequent Contributor
timestamp: September 03, 2017, 09:18:31 am
content: Quote from: GarthyD on September 02, 2017, 11:14:52 pmAre the buttons connected to the CPLD? Can you spare enough gates for a N-input AND-gate? (N being the number of buttons)If so, and output-pin from the CPLD, via an RC filter, back into the CPLD should do the trick, no?

author: tggzzz
author_rank: Super Contributor
timestamp: September 03, 2017, 09:49:22 am
content: Quote from: GarthyD on September 02, 2017, 11:14:52 pmAssume C=5pF (one gate load, quite probably an underestimate), V=3V (might be 5), t = dt = 1ns (reasonable for a tp=7.5ns), L=50nH (2" of wire) in the ground lead.Then the current spike from switchingoneoutput is around 3*5e-12/1e-9 = 15mA.Then the voltage induced in the ground lead is 50e-9*15e-3/1e-9 = 0.75V.So, can your circuit tolerate0.75V spikes on the inputs, or will they cause internal logic to change state?Don't forget that if you have more than one output changing in the same direction simultaneously, the spikes will be proportionately larger.W.r.t. decoupling, ensure you have the right kindsof capacitor and that the leads are short and wide. Failure here will reduce the CPLD's PSU voltage, possibly causing internal state corruption.

author: GarthyD
author_rank: Regular Contributor
timestamp: September 03, 2017, 01:22:53 pm
content: Quote from: Ian.M on September 03, 2017, 06:21:33 amThanks for the suggestion. Going the low-cost secondary MCU route is tempting, and something I have weighed up and still constantly debate with myself. I was considering an ATTINY instead both for the price and the fact that I am familiar with AVRs, but the basic idea is the same. There are pros and cons for the overall design and I would have to talk at considerable length to go through them all. If I did use one, it probably wouldn't be to generate the clock signal any more. I'd move the functionality to manage the reset process over to it instead. It might be able to absorb a number of other components on the board and support some interesting reset- and flash-time functionality. The burden would be greater on the software side, especially as there is a support library involved, but that is precisely where my experience lies. I don't want this one issue to drive this change, but it is something that if driven for the right reason, would make handling this functionality considerably easier. I've got a fair bit to think about here.Quote from: IanMacdonald on September 03, 2017, 06:40:15 amExcellent, thankyou.Quote from: IanMacdonald on September 03, 2017, 06:40:15 amThanks for the heads-up. Startup glitches or weirdness shouldn't cause any issues for this particular application.Quote from: IanMacdonald on September 03, 2017, 06:40:15 amThankyou.Finding this sort of solid information has been difficult. I've disassembled the astable multivibrator at present so I can't try it out immediately. I quickly ran some values through the sim I'm using and it gave messy results, but after decreasing the simulation timestep it started producing a sensible output again. In any case I can't fully trust the sim here. When I next assemble it I will be using your guidance here to select more appropriate resistors. VCC will be 3.3V so I should be safe here....Many thanks all for your input everyone, much appreciated. Sorry that I haven't been able to reply to it all yet, I am still working my way through it.EDIT: stmdude: All buttons connected to CPLD, enough LEs for an AND-gate.

author: stmdude
author_rank: Frequent Contributor
timestamp: September 03, 2017, 03:24:36 pm
content: Quote from: GarthyD on September 03, 2017, 01:22:53 pmOk, cool.So, the MAX V (in 3.3V LVTTL) needs at least 1.7V to register an IO pin as high. If you can get a pin on the CPLD to go high when all buttons are pressed, all we need is some external analog circuitry that takes (about) a second to rise from 0 to 1.7V.This sounds a lot like an RC filter to me, and would be _a lot_ cheaper than using 555s or other chips.I've attached a basic LTspice simulation of what I'm talking about. I have a voltage source that rises from 0V to 3.3V, an RC filter, and a graph on the output (the point between the resistor and capacitor) that you would feed back into the CPLD.Now, there is a slight downside to this approach. There's no "reset" of the charge in the capacitor, so if the user presses the keys for 0.5s, lets go of them for a very short time, and then press them again for 0.5s, it would count as a "1"/reset.( It does discharge/reset though, but it takes a second or two before all the energy in the capacitor has drained )( This is also typically how you delay a reset-signal to an MCU, so that the voltage-rails can stabilize before you start executing code )

author: Benta
author_rank: Super Contributor
timestamp: September 03, 2017, 08:49:33 pm
content: 74HC4060 oscillator/divider. The RC oscillator is two resistors and a cap. Set the oscillator frequency to 16 kHz and you'll have manageable (and cheap) component values. Runs fine at 3.3 V, consumes almost no current and costs a few cents.I challenge you to find a cheaper and easier solution.

author: mathsquid
author_rank: Frequent Contributor
timestamp: September 03, 2017, 10:43:44 pm
content: Quote from: GarthyD on September 03, 2017, 03:05:37 amSorry about that. I wasn't very clear with my explanation. Get a blinking LED, like the one in the picture I attached. Put a resistor on the low side and put your probe between the resistor and LED. You're stuck with the frequency and duty cycle of the LED, but it's a pulse generator with two components.

author: Benta
author_rank: Super Contributor
timestamp: September 03, 2017, 10:54:49 pm
content: QuoteRight... so with the LED and the resistor and a supply of 3.3 V, there's a signal of perhaps 0.5 VPP(best/optimistic case)? Not really useful, in my opinion.

author: mathsquid
author_rank: Frequent Contributor
timestamp: September 03, 2017, 11:22:21 pm
content: Quote from: Benta on September 03, 2017, 10:54:49 pmI used a 5V power supply and a 1K resistor and get a V_{pp} around 3V.

author: GarthyD
author_rank: Regular Contributor
timestamp: September 04, 2017, 12:02:45 am
content: Quote from: Benta on September 03, 2017, 08:49:33 pmThankyou for the additional detail. Some of these concepts are still a little hard for me to follow, but stepping through it as you have makes it easier to understand.Quote from: Benta on September 03, 2017, 08:49:33 pmThanks. I do the best I can on a breadboard (as described). On a PCB I keep them nice and close to the IC in question, practically adjacent where possible.Quote from: stmdude on September 03, 2017, 03:24:36 pmCheers for being fine with my rapid and minimal response yesterday. I had run out of time but I did still want to provide an answer to your questions. The slightly longer answer is: All of the buttons are connected to one pin CPLD each and can be read directly by the CPLD. I've got spare LEs, a handful of bits of storage, and some pins. Each resource I use takes away from something else I can do, but they are available. An all-buttons AND-gate is very, very cheap compared to what I was expecting.Quote from: stmdude on September 03, 2017, 03:24:36 pmThanks for this.There is a lot of appeal in your solution. Downsides I can see are:- It'll take time to discharge enough to release the reset. But maybe this won't be too long, and besides, this is an emergency reset, it shouldn't happen too often.- The desire for a 1Hz clock was to let it count a few ticks to make it take a few seconds to activate. I'd need a resistor/capacitor combo that would cover a few seconds. I'm worried I might run into similar signal integrity problems similarly to the other solutions I've used, and until I have an oscilloscope, I'm blind.- It would dedicate one or two pins to just this solution (one pin if the output was to an NMOS that grounded the reset line). As there would now be no clock, I can't use it to solve other problems. But then again, maybe I'm better off just sticking with a specific solution. Once the MCU is up it is going to be a better candidate for clock-related tasks. Something to consider.Many thanks for your thoughts on this.Quote from: stmdude on September 03, 2017, 03:24:36 pmThis did initially help turn me away from this approach, but thinking about it it's *probably* not a big deal.Maybe I can tweak the parameters a little by including a parallel resistor across the cap? If I'm guessing correctly, this would slow the charge, reduce the maximum voltage, but speed the cap discharge when not in use. I did something similar with a 1-pin hardware version solution, but I did also run into timing issues that changed day-by-day, so I'm not sure if it is a good idea.Quote from: Benta on September 03, 2017, 08:49:33 pmThanks. evb149 made a similar suggestion. I'm guessing the basic idea is that it is driven by a less troublesome oscillator, and I'd just take the appropriate line (probably the highest counter bit) as the signal.Quote from: mathsquid on September 03, 2017, 10:43:44 pmThankyou. I'm not sure this is something I will be able to use in my solution for a number of reasons, but I appreciate the creative suggestion.....Thankyou everyone for all of your suggestions and detail and the wealth of knowledge shared. I now have plenty of options, and my main limitations at this stage are: (i) lack of oscilloscope to properly evaluate and diagnose; (ii) concerns on the value of the feature when considered in isolation; (iii) lack of some of the mentioned components; and (iv) external factors that are not yet resolved that might make certain solutions more appealing than others due to the additional benefits of the specific solution.At this point I am going to move on to other parts of the design that feed into this, and see what I can do about an oscilloscope and the missing parts. There should be no shortage of options when I am better placed to make this decision, thanks to all of the input in this thread.

author: Old Don
author_rank: Regular Contributor
timestamp: September 07, 2017, 05:09:24 pm
content: Quote from: GarthyD on September 02, 2017, 01:55:20 amMovements are quartz tuned and work fine for a long time plus are dirt cheap. But here's a link to someone else's take on this:http://sound.whsites.net/clocks/timebase.htmlplushttps://www.google.com/search?q=using+a+quartz+watch+movement+circuit+board+for+electrical+output&tbm=isch&tbo=u&source=univ&sa=X&ved=0ahUKEwi4lIvIx5PWAhUj2oMKHREsCBMQ7AkIPA&biw=1536&bih=740

author: grifftech
author_rank: Frequent Contributor
timestamp: September 07, 2017, 05:34:13 pm
content: CRAZY IDEA use a motor that spins at 60 rpm and put a cam on the shaft to activate a switch

author: KMoffett
author_rank: Regular Contributor
timestamp: September 07, 2017, 07:36:29 pm
content: I use the guts of 1.5v wall/desk clocks. The two outputs for the coil can be diode-ANDed for 1Hz, 30mS pulses.Ken

author: GarthyD
author_rank: Regular Contributor
timestamp: September 08, 2017, 12:19:13 am
content: Quote from: grifftech on September 07, 2017, 05:34:13 pmPerhaps I could use a sturdy cable attached to an airplane wound around a suitably large wheel(*), with a small protruding board that flicks a switch on each cycle, with a rubber-band that snaps the switch back in place each time. But selecting the right components would be important, and I just don't know enough about rubber-bands.(*) - Approximately 80m diameter.Quote from: KMoffett on September 07, 2017, 07:36:29 pmQuote from: Old Don on September 07, 2017, 05:09:24 pmThe teardown and use of the unidentified clock ICs is interesting and clever. It will not be a suitable solution to my specific problem though. Perhaps if the parts used were identifiable and readily available from a reputable supplier it could present an excellent solution.

author: Ian.M
author_rank: Super Contributor
timestamp: September 08, 2017, 12:27:26 am
content: While ridiculous and impractical 'solutions' are on the table what about abimetallic flasher bulbdriving the base of a power transistor?

author: GarthyD
author_rank: Regular Contributor
timestamp: September 08, 2017, 12:32:56 am
content: Quote from: Ian.M on September 08, 2017, 12:27:26 amI have no-one to blame but myself for derailing my own thread.

author: tpowell1830
author_rank: Frequent Contributor
timestamp: September 08, 2017, 03:11:55 am
content: Many good suggestions for you to sort through.I bought this scope on Bangood and I am well impressed. Will work well enough for you to see your signal for $69 US.https://www.banggood.com/search/dso112a-upgrade-version-2mhz-touch-screen-tft-digital-mini-handheld.html

author: jh15
author_rank: Frequent Contributor
timestamp: September 08, 2017, 04:49:15 am
content: Peaceful zen or other psycho mantra thing. Bi.

author: GarthyD
author_rank: Regular Contributor
timestamp: September 08, 2017, 10:08:41 am
content: Quote from: tpowell1830 on September 08, 2017, 03:11:55 amThanks for the starting point. I've some learning to do about oscilloscopes and then hopefully I can at least make a basic purchase.Quote from: jh15 on September 08, 2017, 04:49:15 amThat contest has some very interesting entries....Okay, I've implemented a temporary solution- *perhaps* permanent, depending on the rest of the design.For the time being I've gone with a highly problem-specific solution. Based on logic on the CPLD (eg. all buttons being pressed), a single pin (SLRST) is used to output a slow reset signal. That signal charges a cap connected to the gate of an NMOS. The drain is connected to an active-low reset line which goes to the rest of the circuit (via ENRST), including the CPLD. A pulldown speeds discharging, slows charging, and lowers the voltage it charges to. It presently looks like this:Note that the reset line (which ENRST leads to) has a pullup on it already.The advantages are that it is dirt-cheap, requires only one CPLD pin, a tiny amount of CPLD logic, and I can change the trigger condition later if I choose.The disadvantages are numerous, including: a variable reset time, a poor understanding of operation involving very large resistances, some uncertainty over the NMOS behaviour during the slow voltage rise, a reset signal that transitions between high and low a bit more slowly than I'd like, and that no actual clock is generated by the solution.Whilst I don't get a clock with this solution, it is enough to make sure that the attached MCU can be reset, and then the MCU can provide a clock with whatever characteristics I need to to the CPLD directly.Depending on the needs of the rest of the design I might move to another solution, or perhaps tweak this one a bit. Thanks to all of the input in this thread I have no shortage of options.

author: tggzzz
author_rank: Super Contributor
timestamp: September 08, 2017, 10:17:08 am
content: Quote from: GarthyD on September 08, 2017, 10:08:41 amBut is it?Personally I'd replace the FET with a schmitt-trigger input logic gate, e.g. a 74*14, where * can be almost anything including 74*1g14. That will circumvent some of the problems you mention.

author: GarthyD
author_rank: Regular Contributor
timestamp: September 08, 2017, 01:17:59 pm
content: Quote from: tggzzz on September 08, 2017, 10:17:08 amThere is definitely some uncertainty in the solution. I'm not thrilled about the idea of a slowly changing voltage on a reset line- even if the MOSFET speeds it up considerably from what is happening on the gate. Everything else on the reset line tends to change its state fairly quickly.Quote from: tggzzz on September 08, 2017, 10:17:08 amThanks for the suggestion. I was thinking it might become necessary to do something like this. Unfortunately it starts to push the cost into the territory of the clock-based solutions.I'll have to give this some further thought.

author: tggzzz
author_rank: Super Contributor
timestamp: September 08, 2017, 01:37:36 pm
content: Quote from: GarthyD on September 08, 2017, 01:17:59 pm£0.20 for 5 down to £0.03 in larger quantities, e.g.http://uk.farnell.com/fairchild-semiconductor/nc7s14p5x/ic-nc7s-smd/dp/1467334Don't forget the cost of subtle malfunctions discovered after shipping.

author: IanMacdonald
author_rank: Frequent Contributor
timestamp: September 08, 2017, 02:00:20 pm
content: Quote from: Hero999 on September 03, 2017, 08:50:54 amThe two caps idea is neat, however aren't the two resistors going to form a potential divider such that the trig/thrs voltage can only be pulled down to about 1/3 Vcc? Since the internal schmitt resets at about that voltage it's going to be marginal as to whether it does, or not. If you take your feedback from OUT you don't have that issue.If you're worried about output loading affecting the frequency that way, use DIS as an open collector output instead of OUT. Call it a role reversal if you like.

author: cdev
author_rank: Super Contributor
timestamp: September 08, 2017, 07:51:37 pm
content: many GPS modules now are under $10 or - my most recent one was ~$6 and came in a form factor that would require almost no additional parts.Typically they offer two outputs, a 1 pulse per second output that could in some cases (ublox) be adjusted to supply 50% duty cycle.. so thats a precise 1 hz square wave with the rising edge lockable to the beginning of the UTC second if desired. Many GPSs also offer a 0.5 PPS signal when various conditions apply, basically the point where the signal crosses zero is usually officially free running but usually coincides with either GPS time or the UTC second. (both are extremely close, certainly close enough for your application)You can in many cases tell them to deliver one of these signals all of the time and try to discipline it to the GPS signal as closely as possible. It sounds as if a simple wire antenna would likely be fine for this. They will do that and do it exceedingly well. I bet it would be possible to figure out a way to make this pulse independent of actual GPSs input except very occasionally if thats what you desire and you find and pick the appropriate combination of settings.You may see it as overkill but the fact is, silicon chip's savings has produced the ideal 1 Hz oscillator solution - its cheap because of mass production. Take advantage of it if its not likely to cause some problem (it may it depends on a lot of things) But if it doesnt you then get accuracy "for free" that you couldn't even begin to dream about before.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: September 08, 2017, 08:30:54 pm
content: CD4060 oscillator/counter

author: Zero999
author_rank: Super Contributor
timestamp: September 08, 2017, 09:04:12 pm
content: Quote from: IanMacdonald on September 08, 2017, 02:00:20 pmIt pulls it down to 0.297Vcc, which is below the1/3Vcc specified. It may be marginal. I haven't checked the data sheet. The resistor in series with the discharge pin wasn't my idea. I found it on another site, but can't remember. I'm normally good with siting references. Sorry, I let myself down on this occasion.Taking the feedback from the output will only work with the CMOS 555 variants. It's no good with the bipolar parts.

author: GarthyD
author_rank: Regular Contributor
timestamp: September 08, 2017, 11:02:01 pm
content: Quote from: tggzzz on September 08, 2017, 01:37:36 pmA number of Schmitt trigger inverters do seem to drop in price a fair bit more than you'd normally expect in larger quantities. I hadn't noticed that.Some things I will have to consider:- Component cost is directly comparable to a Schmitt trigger oscillator, no matter the price of the IC.- Cost is getting close to the other solutions.- I'll need an open-drain output for the reset line. It is shared and multiple devices can trigger. Although I did notice a few Schmitt trigger inverters do have open-drain outputs.- There is the possibility of pinching a pin from the CPLD to provide the Schmitt trigger, but I may well run into similar problems to those that occurred when I tried to use it as part of a Schmitt trigger oscillator.Quote from: tggzzz on September 08, 2017, 01:37:36 pmYeah.Quote from: mikeselectricstuff on September 08, 2017, 08:30:54 pmA popular suggestion in this thread.

author: tggzzz
author_rank: Super Contributor
timestamp: September 08, 2017, 11:11:07 pm
content: Quote from: GarthyD on September 08, 2017, 11:02:01 pmA series diode can emulate open drain behaviour.Ensure circuit behaves well with a slowrisingedge on the /reset signal, determined by RC time constants.

author: Zero999
author_rank: Super Contributor
timestamp: September 08, 2017, 11:15:21 pm
content: Quote from: tggzzz on September 08, 2017, 11:11:07 pmYou beat me to it. I'd recommend a Schottky diode, such as the BAT54, as the voltage drop will be much lower, than a silicon diode (around 300mV, rather than 600mV at 1mA), which will make the low logic level more reliable.

author: GarthyD
author_rank: Regular Contributor
timestamp: September 08, 2017, 11:38:00 pm
content: Quote from: tggzzz on September 08, 2017, 11:11:07 pmCheers, yes, that's quite true. I should have mentioned this. I even have one already on the exact same reset line to cover for software that thinks "open-drain" means "feel free to output high when you're done".Quote from: tggzzz on September 08, 2017, 11:11:07 pmWith respect to the temporary solution I am using at the moment, or that the reset line itself is open drain and pulled up and will take time to rise? For the former, I think I'm about to admit defeat on that solution being anything but temporary.Quote from: Hero999 on September 08, 2017, 11:15:21 pmCheers. I'm using a Schottky for my current workaround for that reason.

author: daddylonglegs
author_rank: Contributor
timestamp: September 09, 2017, 04:15:08 pm
content: Could you not use an external divider to divide the CPLD's clock down most of the way? A pair of SN74HC4020s for example? With a 1Hz clock you then need to trigger a reset pulse of the appropriate length.

author: GarthyD
author_rank: Regular Contributor
timestamp: September 10, 2017, 02:49:49 am
content: Quote from: daddylonglegs on September 09, 2017, 04:15:08 pmThankyou for the suggestion. It might be a bit costly compared to the other solutions mentioned, both in terms of price and space. However, it could work well on a project that needed multiple power-of-two clocks.

author: Beamin
author_rank: Super Contributor
timestamp: September 23, 2017, 04:21:17 pm
content: Quote from: GarthyD on September 10, 2017, 02:49:49 amSo I have been watching this for a while didn't know there was so many ways to do it. I would have done the multivibrator but I like to make analoge things. Which worked best for you?

author: GarthyD
author_rank: Regular Contributor
timestamp: September 23, 2017, 09:46:59 pm
content: Quote from: Beamin on September 23, 2017, 04:21:17 pmNo final decision yet. I should be posting an update "soon". The two main causes for delay are: Waiting for the parts to arrive (I ordered many mentioned in this thread, and they only recent arrived), and researching and experimenting with a secondary MCU solution to see how it fits in with the rest of the design (if it fits well, the timing aspect is provided as a side benefit). I'll go into more detail in the update as there are too many unknowns right now.

author: BrianHG
author_rank: Super Contributor
timestamp: September 23, 2017, 10:12:31 pm
content: I'd vote on the secondary 40cent 8 pin PIC. You can use it to provide your 1 second watchdog reset, and, also a low voltage supervisory reset by using an ADC input to monitor your voltage source which in my designs, I find useful to stop other electronics when necessary.

author: GarthyD
author_rank: Regular Contributor
timestamp: September 24, 2017, 03:38:51 am
content: Quote from: BrianHG on September 23, 2017, 10:12:31 pmFunny you should mention that. Part of what I'm experimenting with is replacing voltage monitoring and power control with the secondary MCU. Being able to replace some of this is what could make the MCU approach (otherwise the most expensive solution) viable.Anyway. update "soon".

author: stj
author_rank: Super Contributor
timestamp: September 24, 2017, 05:58:31 pm
content: i would just use a pic 10F series 6pin smd microcontroller.

author: Raj
author_rank: Frequent Contributor
timestamp: September 25, 2017, 05:55:47 pm
content: get an attiny ,write a code like-LDI R16, 0XFFLDI R17, 0X00OUT DDRx, R16L1: OUT PORTx, R16nopnopnopOUT PORTx, R17nopnopnopJMP L1keep adding the nop(s) till the frequency is ok

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: September 25, 2017, 06:43:52 pm
content: Quote from: Raj on September 25, 2017, 05:55:47 pm

author: Raj
author_rank: Frequent Contributor
timestamp: September 25, 2017, 06:49:50 pm
content: Quote from: mikeselectricstuff on September 25, 2017, 06:43:52 pmTrolling aside, a loop is must,attiny doesn't have that much space, use "brne" command to set up a loop

author: Beamin
author_rank: Super Contributor
timestamp: September 25, 2017, 09:56:06 pm
content: Quote from: mikeselectricstuff on September 25, 2017, 06:43:52 pmPlease explain besides it seems really lazy but I only know how to copy and paste code into the Arduino so I want to learn.

author: MattHollands
author_rank: Frequent Contributor
timestamp: September 25, 2017, 10:10:22 pm
content: ...now that you've introduced the attiny, you need a secondary watchdog to make sure that the attiny doesn't get stuck. A watchdog watcher. Luckily attinys often have them built in but it feels superfluous and just another device to program.

author: GarthyD
author_rank: Regular Contributor
timestamp: September 25, 2017, 10:26:35 pm
content: So it's ATtinys all the way down then?

author: MattHollands
author_rank: Frequent Contributor
timestamp: September 25, 2017, 11:33:12 pm
content: Quote from: Beamin on September 25, 2017, 09:56:06 pmNOP is the "no operation" command for a cpu. It consumes a clock cycle, but achieves nothing other than killing time. Therefore if you want to achieve a 1Hz pulse from a 1MHz clock (for example), you can set the pin high in the first instruction, perform 499,999 NOPs, set the pin low, do 499,999 NOPs. However, this obviously takes a ridiculous amount of memory that the attiny doesn't have if you write out each NOP (at least one byte per command comes out to a megabyte of instructions).The way to do this in reality would be to make a loop which compiles to a much shorter program, for example:for(int i = 0; i < large_number; i++){//do nothing}In reality, you're better of using hardware timers inside the attiny so the attiny can go to sleep or do other things while the hardware timer generates the pulse.Atmel AVRs, such as the attiny are generally programmed (at least this is how I do it) using Atmel Studio and compiled using the avr_gcc compiler.

author: GarthyD
author_rank: Regular Contributor
timestamp: September 25, 2017, 11:54:56 pm
content: I think they're just having a little fun. Personally, I'm actually quite familiar with low-end AVRs, although I guess someone else reading it might be sent off on the wrong track.For an ATtiny as a pure clock generator and nothing else, I'd set up one of the timer counters with an appropriate prescale and count, then use the ISR to write to PINx (not PORTx) so that it toggles rather than sets. Then I'd SLEEP to Idle endlessly.Or if I was lazy (untested):Code:DDRx |= 1 << whatever;for (;;){_delay_ms(1000);PINx |= 1 << whatever;}But this would be grossly underutilising the MCU and is probably the most expensive solution.Anyway, more "soon".

author: GarthyD
author_rank: Regular Contributor
timestamp: September 29, 2017, 06:47:04 am
content: Okay, I'm finally able to provide a solid update.For my project, I've settled on using a secondary MCU to handle the functionality I was after. I am fairly confident this will be the solution I will use in the end. By way of explanation:Using a MCU to provide a clock on its own is overkill and is one of the weakest solutions for the clock problem on its own. However, if the MCU can also provide other functionality, perhaps replacing or simplifiying enough other circuitry, then the effective cost of the MCU can be reduced to the point where it is competitive. My aim was to eliminate this as an option early on, but it ended up being useful enough that is became the strongest solution.Having worked with AVRs in the past, I looked at the ATtiny series. Cost-wise, they are fairly good for MCUs, but unfavourable when compared to most of the clock solutions in this thread. There are a number of problems with existing solutions in my project that a MCU could potentially improve: Battery monitoring, low-power mode, and power management. Battery monitoring is the easy one: Use ADC and act accordingly. Running the MCU at battery/input power directly makes power management simple. As for low power, I was able to get battery use way down by simply using the MCU to switch off the voltage regulators that go to the rest of the circuit, and then drop to the lowest power mode for the MCU. Getting battery use down to 1uA (of which 800nA was power flowing backward through a diode and out via a pulldown) was probably the tipping point for me.In the end, there is no clock signal sent out to the CPLD. Instead, the CPLD indicates when the emergency reset is activated (ie. four buttons down), and the MCU decides when it has been held long enough. I actually changed this in the end to treat the four-button long-press sequence as an escape that puts you into a mode in which you can select an option, one of which is an emergency reset.As mentioned previously, I ended up purchasing a number of components that were raised in the thread to experiment with, and can share my experiences with these.Due to my unusual start into electronics (I went straight to AVRs) I've never had a chance to play with a 555. I took the opportunity to rectify this deficiency and had a bit of a play around with one. I made a 50% duty cycle oscillator both slow enough to drive a LED blinker, and then one too fast to see. I finally got some use out of my multimeter's frequency measurement mode with this last one.I next had an experiment with a 4060. I fed in the output from the 555 and hooked numerous outputs to my LED board, and admit to just admiring the result for a while. How odd that it doesn't have a Q11 output though. I hadn't realised/understood that you could supply two resistors and a cap directly to generate the input signal. Once I realised this, I hooked that up too and it worked great. Whilst I haven't tried two 4060s in tandem, I can imagine how it'd work. I think this would be an excellent solution if you needed multiple power-of-two clocks in a design. It's not expensive either- no wonder this was a popular solution.I picked up, but haven't hooked up a MC1451B. I imagine the results would be similar to the 4060. The tradeoffs would be: Slighly smaller IC, can dynamically change the clock rate, can divide the clock further, but there is one clock out rather than ten, and it is more expensive.I now have some standalone single-gate Schmitt triggers. I have reimplemented the delayed direct reset circuit I'd outlined previously using one of these. I haven't tied it all together to the CPLD, but adding in the Schmitt trigger should in theory eliminate the issues I was facing. Driving a MOSFET with a slowly discharging capacitor was never really a good idea. Having had a lot more time to search around for prices, it appears that this is one of the cheapest reliable solutions available (at the cost of accuracy). I think if the MCU solution falls over, this is probably the solution that fits in best with my project. It's also nice to have some standalone Schmitt triggers now- I didn't have any before.I reimplemented the Schmitt trigger oscillator using a single gate Schmitt trigger rather than use the CPLD and a Schmitt trigger input. I haven't tied it all together to the CPLD, but the output of the circuit is digital, and in theory if I kept the relevant components out of the way of everything else I would be unlikely to run into the same problems I ran into previously, especially while breadboarding. I think that this is probably the strongest solution to the question originally posed at the start of the thread (cheap inexpensive low-accuracy 1Hz clock generator).This thread has become an absolute treasure trove of information on oscillators and I really appreciate all of the input based on my initial simple question. I've learnt a lot, and I'm sure that others reading the thread have too. I have a collection of fallback solutions if the MCU idea doesn't work in the end. And most importantly, thanks to this thread, if I do need a standalone clock in the final design, or any other design I work on in the future, I have multiple viable options to choose from.Thankyou all.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: September 29, 2017, 08:31:02 am
content: Something else to consider - one common objection to using an MCU for simple functions is the hassle of programming it.Now that Microchip own Atmel, you can use their programmming service to very cheaply pre-program ( and mark) parts, so they can be treated just like other off-the-shelf part.

author: GarthyD
author_rank: Regular Contributor
timestamp: September 30, 2017, 11:29:20 am
content: Quote from: mikeselectricstuff on September 29, 2017, 08:31:02 amThanks for the tip. Mass-programming is a problem that I really hope that I need to deal with one day.As-is I can do in-system programming of the chip easily enough (I'm designing this in from the start). There are two other ICs on-board that need programming as well, so whatever I come up with will likely handle the three together.