Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

oscillators VS Crystals for CPU microcontrollers or Lattice chips

Status
Not open for further replies.

danny davis

Banned
Advanced Member level 2
Joined
Mar 1, 2013
Messages
627
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Location
Hollywood
Activity points
0
What is the difference between using an oscillator chips vs using a crystal?

At work they use a SG531P oscillator at 2.0Mhz or they use a 2.0Mhz Crystal

I'm confused as to why they would use either an oscillator or a crystal

I haven't found any bad crystals but I have found bad oscillator SG531P chips that would output a triangle waveform at 50nSecs. when it was to be 500nSecs squarewaveform

Did temperature do this or is it the internal capacitance?

My Manager said that crystals are used for timing circuits and real time systems, what does this mean? and that oscillators have a 20% capacitance tolerance drift , which means that the output is not constant all the time

I never saw any drift , but I have seen the SG531P chips output different waveshapes from either manufacturing errors or temperature has caused this , i'm not sure, do you guys know?

The crystal or the SG531P chip at 2.0Mhz goes to a LATTICE chip which is ISPLSI 1016E, do you know what Lattice chips do and how are they different than microcontrollers?

The crystals we use are #MP080
 

A crystal is a passive resonator that can pass energy over a very narrow range of frequencies (and harmonics of the frequencies). By itself it does nothing, there has to be an amplifier or other gain stage to complete the circuit and make an oscillator.

An oscillator like the SG531P is a amplifier or other gain stage with a resonator such as a crystal in the feedback path. Apply power to the device and a signal at the desired frequency can be seen at the output pin.

Some devices like microcontrollers have the amplifier or other gain stage internal so all you need is the crystal or other resonator. Many of these devices will work with a crystal or external oscillator. It is typically best to use a crystal for the following reasons:
1.) to take advantage of the microcontroller's ability to control its internal oscillator circuits during low power or sleep modes
2.) crystals usually cost less than oscillators
3.) a crystal take less board space
If there are multiple devices (e.g. 2 microcontrollers and a FPGA) that must be synchronous then using a single oscillator and a clock management device to route the clock signal to all of the devices may be necessary. in this case the devices are configured to us a external oscillator input.

Some devices like many FPGAs, audio CODECs, etc do not have the amplifier or other gain stage internal so just a crystal will not work. For these you have to use a oscillator to provide the clock.

The ISPLSI 1016E is a CPLD (complex programmable logic device) which is somewhat similar to a FPGA.
To show the difference between this type of device and a microcontroller lets look at an example.

CPLD vs Microcontoller:
The CPLD has a large number of logic elements like ANDs, ORs, flip-flops, inverters, buffers, etc. and a way to interconnect these elements via programming. It is like having a bunch or ORs, ANDs, etc on a bread-board that you can connect to make something. We can make a 4 input AND using 2 input ANDs. With logic devices the instant (<2ns) all 4 input are high the output is high. Just like on the bread board we can make another 4 input AND with 3 more 2 input ANDs and just like first circuit the instant (<2ns) all 4 input are high the output is high, even if it is happening at the same time as the first circuit. We can make other circuits and they too will work in parallel and independent from the first two circuits.

Now consider the microcontroller. We can make the same 2 circuits by using 4 inputs and a output for each circuit. The difference is a microcontroller does things in steps. If it is a single step instruction and the clock rate is 20MHz then a step is 1/20MHz = 50ns. There may be 4 to 40 steps which is 200ns to >2us. The steps might include a step to get the address in memory to get the instruction to compare 4 inputs, a step to get the 4 input pin high or low state, a step to compare them to see if they are all high, and a step to set the output pin high if they are. Now this has to be repeated for the second 4 input AND circuit. So unlike the CPLD, in the microcontroller one circuit is updated and then the next and this only happens when the microcontroller is finished doing whatever it was doing before it got to this part of the code.

CPLD/FPGA is faster but not as flexible as a microcontroller. The application determines which approach is better.
 

CPLD doesn't do it in steps? How does it work differently than a microcontroller does things in steps which is more nanoseconds
 

Re-read my example. If the CPLD is configured as two 2 input ANDs followed by another 2 input AND the instant the 4 inputs are high the output goes high, if any or all of the 4 inputs go low then the output goes low. There can be other configurations on the CPLD also working independently. The "software" for the CPLD configures it for the functions you want, then it is finished. If the inputs are all high for 10ns the output will also go high.

The microcontroller (MCU) runs through the software program a step at a time. If it does not run it is hung and nothing happens. It takes several steps to perform the same 4 input AND operation when the MCU finishes whatever it is doing before and runs the code line to look at the 4 inputs. All 4 inputs can go high but the output pin will not go high until the MCU runs the multiple code steps that gets and compares the 4 inputs and then sets the output high. If the inputs are all high for only 10ns the output will probably not go high because the MCU will missed it.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top