Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Generating 1/2 second timeout without buying dedicated RTC chip

Status
Not open for further replies.

mik3ca

Member
I'm trying to make a fairly accurate external timer to use with my microcontroller that expires 1/2 second later using low-priced parts. I have come up with the following schematic:

circuit.png


would this schematic cause the crystal oscillator section to stop working when output Q14 is high? or do I need to instead connect the NPN collector to /PO or the xtal?
 
You are close. Replace Q1 with a signal diode like a 1N914 or 1N4148 from pin 14 to pin 11. The signal output still com3es from Q14.

ak
 
so wait... if I connect anode of diode to Q14, wouldn't that always mess the oscillator? or do I reverse-bias it?
 
Anode to Q14, cathode to P1. For 1/4 second Q14 is low so the diode is reverse biased. You might have to eliminate the 10 pF capacitor at P1 because the diode junction capacitance might be enough. After 1/4 second, Q14 goes high and the diode conducts, holding P1 high and stopping the oscillator.

A potential problem is that the frequency at Q14 is 2 Hz, so each half cycle is 1/4 sec. Without knowing what the output is used for, we can't say if this is good enough.

ak
 
A potential problem is that the frequency at Q14 is 2 Hz, so each half cycle is 1/4 sec. Without knowing what the output is used for, we can't say if this is good enough.

I just need a simple timer where the output stays high after a certain amount of time has elapsed. I want an 8051 microcontroller to detect it. I'm effectively trying to stop the CPU from freezing my program for several hundred thousand cycles at a time
 
The output is only going to go to half a volt. Is that enough?
The 10p's need to be about 33p
 
Your micro doesn't have to " freeze for several hundred thousand cycles" in order to do this. Can't you setup a 1mS interrupt to increment a counter? Then, periodically check the counter and do what is required at the desired time(s).

Mike.
 
Just count in the background.

That's what I do. I sit in the corner and count sheep until its time to go home.
 
The output is only going to go to half a volt. Is that enough?
Obviously not, since the output drives a uC. It would have been nice to explain why, and suggest a solution.

mic - As shown, your initial schematic will work if you add one resistor in series with the base, between the base and the point where the TimeOver signal is picked off. In this way the output signal will be at full CMOS amplitude while the resistor limits the base current and separates the output signal from the base-emitter diode voltage. Without the resistor, the base-emitter diode clamps the output voltage to around +0.6 V. Because the collector current is so low, anything between 10K and 100K should work.

And again, the delay from releasing the Reset input to a positive-going edge on the output is 0.25 s. The output will sit high until the circuit is reset, so you cannot count it twice to get a 0.5 s delay.

ak
 
Ok I followed the diode setup and will use 33pF capacitors to connect the leg of the crystal (not attached to the diode to ground) and for resistors, could I use lower value resistors if I kept the ratio the same (for example, 100K across the crystal leads and 10K for the other resistor to /P0?) and if output voltage isn't high enough, couldn't I just add a resistor between output and VCC to pull the voltage up a bit?
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top