Thanks to all who helped me try to fix my crystal circuit before (see here). I said it was fixed but unfortunately this is not quite the case.
Current circuit diagram:
I've replaced the original 33pf capacitors with 18pf (in accordance with a formula I found on a webpage about crystals). The output is first buffered through another NOT gate and then connected to my PIC. I also connected it to a pair of 4040s (to divide-by-2 twelve times and then 3 more times, flashing an LED at what should be 1Hz) to check the frequency and it looks OK.
The problem is that, on starting up the circuit, the PIC is failing to pick up the signal. I can actually "fix" it though by quickly powercycling the circuit (the thing is powered from a wallwart via a voltage regulator, if I pull the connection out and put it back in within about 1 second the circuit works properly).
Any longer than 1sec of powerdown and the "fix" does not work. I am puzzled as to why this powercycling fix would work at all when the 4040s can pick up the signal just fine - whether the PIC sees the signal or not, the output from the 4040s is always 1Hz and it doesn't ever stop flashing the LED.
I've tried changing the crystal in case the first one was faulty, but this didn't fix the problem. In case the PIC was causing too much load on the circuit, I also tried starting the crystal circuit first then the PIC after a few seconds but this also didn't work.
I'm guessing the problem is just a small difference in voltage - the 4040s require < 0.3VDD for a logic 0 and > 0.7VDD for a logic 1. The PIC is less sensitive however and needs < 0.2VDD, > 0.8VDD. So if the voltage is between 0.2 and 0.3 for "off" and/or between 0.7 and 0.8 for "on", it would cause the above symptoms.
Any ideas how can I achieve a working circuit every time, not just after a quick powercycle?
Thanks,
ahydra
Current circuit diagram:
Code:
|-<32768>-----|
| |
--[10M]-[220k]-
| | |
--|>o--| |
| | |
(18) v (18)
| out |
0V 0V
Legend: <32768> = crystal, [ ] = resistor, ( ) = capacitor
|>o = NOT gate (1/6 of a 4069)
All junctions are connections
I've replaced the original 33pf capacitors with 18pf (in accordance with a formula I found on a webpage about crystals). The output is first buffered through another NOT gate and then connected to my PIC. I also connected it to a pair of 4040s (to divide-by-2 twelve times and then 3 more times, flashing an LED at what should be 1Hz) to check the frequency and it looks OK.
The problem is that, on starting up the circuit, the PIC is failing to pick up the signal. I can actually "fix" it though by quickly powercycling the circuit (the thing is powered from a wallwart via a voltage regulator, if I pull the connection out and put it back in within about 1 second the circuit works properly).
Any longer than 1sec of powerdown and the "fix" does not work. I am puzzled as to why this powercycling fix would work at all when the 4040s can pick up the signal just fine - whether the PIC sees the signal or not, the output from the 4040s is always 1Hz and it doesn't ever stop flashing the LED.
I've tried changing the crystal in case the first one was faulty, but this didn't fix the problem. In case the PIC was causing too much load on the circuit, I also tried starting the crystal circuit first then the PIC after a few seconds but this also didn't work.
I'm guessing the problem is just a small difference in voltage - the 4040s require < 0.3VDD for a logic 0 and > 0.7VDD for a logic 1. The PIC is less sensitive however and needs < 0.2VDD, > 0.8VDD. So if the voltage is between 0.2 and 0.3 for "off" and/or between 0.7 and 0.8 for "on", it would cause the above symptoms.
Any ideas how can I achieve a working circuit every time, not just after a quick powercycle?
Thanks,
ahydra