Electronic – arduino – DIY Pierce Oscillator not working

arduinocapacitoroscillatorresonatortimer

I'm building a simple pierce oscillator for fun and trying to read the frequency using an arduino uno and the freqcount.h library (I don't have an oscilloscope). However, I'm consistently getting a reading of 0 Hz when the resonator I'm using is labeled as 4.096MHz. Below is the circuit I put together, the top part is a simple inverter and the rest is from a diagram of the pierce oscillator I found on wikipedia. I calculated the values for the capacitors based on the 20pF capacitance of the resonator (and assuming 5pF capacitance of the inverter and stray capacitances). Even if my values were off, however, why would I get a reading of 0Hz? Please be gentle, I'm a beginner. Thanks.

schematic

simulate this circuit – Schematic created using CircuitLab

Best Answer

You would get a value of 0Hz, if the circuit is not oscillating at all, or if it oscillates, it may oscillate with too low amplitude for the Arduino to detect it.