Bad 20mhz quartz? (Updated)

What could one expect with a bad quartz?

The OS won’t boot (blank screen and randomly lit LEDs, then nothing happen).

A quartz can be badly soldered or can have the wrong speed/capacity (18pF is required).

Oh and something I’ve learned the hard way: a "good "quartz will behave erratically if you press it. It’s a normal behavior.

That sounds like my problem. Is there any way to check it with a multimeter?

Nothing comes to my mind.

What made you suspect the quartz?

My problem is somewhat detailed in this post . I checked my off-board wiring and everything goes to it’s respective location. I switched out my SIL resistor network and nothing changes, I resoldered all the attachment points for the ATMega socket and the two switch registers and checked to see that they were getting 5V. I purchased the quartz at an electronics outlet store in my area. Their ICs are just in large bins and the quartz looked ok, but who knows. It’s the only thing I can think of at the moment.

If a microcontroller has been programmed to operate from a 20Mhz xtal, if the xtal is defective or not working, it does not work!
If your xtal is defective, does not display or LCD displays meaningless symbols and LEDs come on at random…
You have to desolder it and try to test with a test !

Thanks ilpitu. Doing some googling I’ve found that you can test a crystal with a multimeter IF it has a frequency test option and the range of your multimeter is high enough. Mine isn’t.

I’ll just order another from mouser and hope this clears everything up.

…in theory you can test it with a multimeter …
But most of the multimeter to read the frequency stop at a few Mhz! about 5MHz!
If you try to test a 20Mhz xtal from working even if not read!
Google find different patterns of test xtal …
If you have a digital oscilloscope you can see if you have the leaders of the xtal is a square wave at about 20Mhz …
is an empirical and not very precise but almost always works … :slight_smile:

I switched the crystal and everything powers up now. After some reading, it seems like these things can be somewhat fragile. I read on one site that dropping a crystal is a good way to damage it.

I have had the same weird behaviour on my first shruthi. It was working fine for nearly a week and then suddenly it would not boot. I have tried resoldering various joints and have changed ICs etc. It then booted up intermittently. I have removed the crystal (not without lifting a pad unfortunately) and temporarily inserted a 10MHz crystal and it boots perfectly every time, though it does not make nice sounds any more of course. I’m just on my way to the local electronics store to pick up a proper replacement and will let you know how I get on.

My local store only had 32pF 20MHz crystals so I bought that along with some 22pF capacitors. I am an amateur when it comes to electronics but from reading on the internet and comparing with the Shruthi-1 board, I guessed that the two 18pF capacitors on the Shruthi board that are in parallel along with the 18pF 20MHz crystal would need to be increased. Inserting just the new 32pF crystal works as expected (after a quick test) but I thought I should add the new 22pF capacitors in parallel with the 18pF ones already on the board. My best guess amateur theory is that it will make the crystal oscillate at closer to its specified frequency. I calculated that the load on the original 18pF crystal was ((18*18)/(18+18))~5=~14pF. On the new 32pF crystal I have ((40*40)/(40+40))~5=25pF load.

I have these questions though and was hoping someone would help me. Olivier, are you able to clarify things at all?

1. Have I done things correctly? I was unsure if the Atmel processor expects a certain capacitance across the XTAL pins?
2. Must the crystal be oscillating at the specific frequency?
3. What are the caveats of running a 32pF crystal instead of a 18pF one? Will it affect tuning or stability of the oscillators (I know they are digital but what reference is used for the base frequency)?

I have just been checking things in more detail and have noticed the following - are they normal or bugs or a result of the different crystal? Using v0.91 firmware.

Using ‘init’ patch, disable OSC 2 - change values for OSC 1:

1. There is a large step (not smooth) when changing the squ wave shape parameter from 0 to 1 but it is smooth from 1 to 127
2. Using the pwm wave shape, the parameter seems to change the pulse width from wide to narrow. However, parameter values above 110 have some unusual aliasing effects and value 127 has these effects more pronounced though the pulse width does not quite reach 0.
3. Using the noise wave shape, parameter values 0 to 6 are very ‘stepped’ whereas 6-126 are smoother. Also, there is a large change in noise sound between parameter 63 and 64. Value 127 is again very different from 126.
4. Using the vow wave shape, there is a large step in the sound from parameter values 63 and 64 (similar to noise). Values above 95 give me some random interference in the wave and there is another large stepped change in sound from value 111 to 112.

If anyone can confirm they are experiencing the same it would be a great help!


Regarding the crystal problem:

  1. The crystals I sell with the kits are rated for use with 18pF caps. It might not be the same for some other crystals. I have assembled roughly 30 units now and never had any problem with the combo of 18pF caps and the crystal that goes in the kits.
  2. 20 MHz is the target oscillation frequency. With a difference oscillation frequency what can happen is: 1/ desynchronization of serial MIDI ; 2/ out of tune oscillators. I have never observed anything like that.
  3. None, as long as the caps and the crystals are matched in terms of capacitance.

Regarding the oscillators:

  1. From the user manual : “Note that there’s a slight difference in sound when moving the parameter from 0 to 1. To offer the best sound quality, the pulse width = 50% flavor is read straight from a wavetable at full sample rate, while the pulse width > 50% flavor is obtained from two dephased sawtooth waves, evaluated at half the sample rate. For bass sounds, for which aliasing is not going to be a problem, it is recommended to use pwm instead of square to get a beefier sound.”
  2. From the user manual : “This waveform is a shamelessly naive square wave. The parameter controls the pulse-width. Contrary to square, this waveform stinks aliasing”
  3. Check the code to see why this happens, this is normal. I can “fix” it with 256 bytes to store a table with the right 16 bits coefficients for the filter that color the noise, but would it be worth it?
  4. The positions above 96 are not intended to produce sustained, pitched sounds, but rather transient noises reminiscent of consonants. This works best with the step sequencer patched to the parameter of oscillator 1.

Thanks Olivier. I should have RTFM in regards to my questions about the sound. At least now I know it is not because I am using a different crystal.

Here the official link to the unofficial mutable forums RTFM! Pic:

It’s really weird how I can actually understand the “all caps” internet abbreviations in comments. I’ve never seen this one and it took about 1 or 2 seconds to realize what it meant.