Home
Su
I quarzi

 

si dice risonatori ceramici??????

Oscillatore

Precedente Successiva

Le informazioni contenute in questa pagina sono il risultato di una traduzione molto libera del file "oscillator.pdf" edito dalla http://www.microchip.com e disponibile nella versione originale alla sezione download o direttamente sul sito del produttore.

Esistono diverse tecniche per ottenere il segnale di  clock necessario al funzionamento dei PIC della Microchip. Il progetto e l'uso degli oscillatori è semplice tuttavia un uso errato di questo strumento può essere causa di malfunzionamenti.

In questo documento vengono trattati i seguenti punti:

bulletModi degli oscillatori:
 

I PIC della microchip sono stati progettati per supportare differenti tipi di oscillatori. Il tipo supportato dipende dal dispositivo, alcune modalità sono più diffuse di altre. In questa sezione vengono descritti tutti i tipi di oscillatori che vengono adoperati alla data di creazione del documento originale (Dicembre 2000)

bulletProgetto degli oscillatori:
Descrizione delle differenze tra i vari tipi di oscillatori e indicazioni su quali siano le migliori da   utilizzare. Tips will be broken down to suit each type of oscillator. The pros and cons of each will also be described.
bullet Requisiti dell'oscillatore:
  Vengono prese in considerazione le situazioni critiche per un oscillatore e le migliori soluzioni per risolverli.
bulletTroubleshooting Oscillators:
 
  Descrizione di alcuni tra gli errori più comuni commessi in fase di progettazione e di test.
bulletAltre fonti di informazione
 

Modi degli oscillatori

I modi più diffusi sono:

bulletHS   
HS -High Speed
bulletXT
XTal - Standard
bulletLP
LP Low Power
bulletRC
RC External
bulletIntRC
IntRC Internal RC mode
bulletEr
ER External Resistor Mode

Questi modi di funzionamento prevedono l'uso di cristalli, moduli  oscillatori, risonatori o resistenze e capacità per generare il segnale di colck.

Quando si usano cristalli o risonatori possono servire anche altri componenti come capacità, ma  parleremo meglio di questo in seguito.

[Torna all'inizio della pagina]

HS High Speed

La sigla HS sta per High speed mode. Questa tecnica viene utilizzata per ottenere frequenze dai 3 o 4 Mhz in su. La modalità HS è quella che consente di ottenere

the hi highest drive level available   

I cristalli e i risonatori devono essere pilotati da un segnale. Il guadagno di questo segnale

The gain on this signal controls whether an oscillation will occur and how strong it will be

Bisogna fare attenzione a non Sfruttare eccessivamente oltre i limiti tenere ad una velocità eccessiva sottopilotare o sovrepilotare "underdrive overdrive" il cristallo o il risonatore. In caso di overdrive il cristallo potrebbe danneggiarsi nel lungo termine,   often failing in a matter of weeks    Con un pilotaggio troppo piccolo l'effetto potrebbe non avviarsi correttamente o potrebbe fallire in determinate condizioni =

With too little drive, the product may not start up correctly or may fail under certain conditions.

Se

If these are problems you have encountered, be sure to see

the following sections and try modifying your drive level.

As a general rule, most resonators require more drive than crystals, so you will find

that HS mode is commonly used for resonators.

Two additional tips: Be sure to qualify your design to insure it is stable and does not

damage components. And remember, that as the frequency increases, the drive level

required tends to increase. This is why HS mode is designed for use with resonators

and crystals of 3 to 4MHz and faster.

[Torna all'inizio della pagina]

XTal - Standard

La sigla XT sta per "Cristal" mode e consente di ottenere un medio drive level.

Viene utilizzato con cristalli e risonatori in un range da 1 a 4 MHz. 

 Again, if having problems starting up in this mode, you may want to switch to HS mode and requalify your design with the new mode.

Questa modo di funzionamento è caratterizzato da un modesto consumo di potenza sino a quando il livello di pilotaggio è minore di quello del' HS mode, e perché viene prodotta un clock a frequenza minore =

XT mode has moderate power consumption since its drive level is lower than that of

HS mode, and because a lower clock speed is produced.

Vale la regola generale che più è veloce il clock che si usa, maggiore sarà la corrente richiesta dall'applicazione.

[Torna all'inizio della pagina]

LP Low Power

LP sta per "Low Power" mode. Questa modalità è particolarmente adeguata ai circuiti che richiedono che la potenza sia la più bassa possibile.

LP mode is engineered for 32.768kHz crystal operation =LP mode è progettata per cristalli che operarno a 32.768kHz e puù funzionare a qualsiasi frequenza below 200kHz. LP mode è solitamente impiegata per operare a 32.768kHz.

LP mode è la modalità che è in grado di generare la più bassa frequenza di clock possibile e, di conseguenza, consente di raggiungere il minor consumo.

Questa modalità è ideali per le applicazioni timing-sensitive sino a patto che il cristallo venga usato alla frequenza base in wrist-watches

LP mode is ideal for timing sensitive applications since these same crystals are used

as a time base in wrist-watches.

Note, however, that to produce accurate timing, the system should be as stable as

possible. This refers to stability over temperature, voltage and other factors.

[Torna all'inizio della pagina]

RC External

La sigla RC sta per "External RC" mode. E' importante sottolineare che questa modalità è detta External perché alcuni PIC dispongono di una modalità interna che sverrà descritta in seguito.

Questa modalità prevede l'impiego di una rete di resistenze e condensatori connessi al pin OSC1. Quando il dispositivo viene configurato per questa modalità i componenti vengono automaticamente pilotati per produrre la frequenza per la quale sono stati progettati.

La modalità RC External viene utilizzata in applicazioni a bassissimo costo. La potenza dissipata è molto variabile a causa dell'ampio intervallo di frequenze per le quali questa modalità può essere impiegata.

 For the lowest available power, consider the LP mode discussed previously.

E' estremamente importante ricordare che con l'RC mode si ottiene una sorgente di clock poco accurata. In alcune applicazioni questo non rappresenta un problema, ma in altre, che sono timing-sensitive, si sconsiglia l'uso di questa modalità.

Per queste ragioni l'RC mode è sconsigliata ad esempio per comunicazioni attraverso l'RS-232.

Le variazioni del tempo di clock sono dovute alle variazioni delle capacita e delle  resistenze e per lo stesso circuito stampato. Umidità, interferenze di altri componenti e variazioni di temperatura influenzano il valore della frequenza non garantendone una adeguata stabilita. Nonostante questi inconvenienti l'RC mode è la modalità più economica and molto più resistente agli impact=urti o guasti?  dei cristalli e dei risonatori.

Un'altra peculiarità dell'RC mode è la possibilità di generare un clock 4 volte più lento su OSC2. Questa tecnica e nota come "divide by 4 clock". Consultare il data-sheet del componente per maggiori informazioni.

[Torna all'inizio della pagina]

IntRC Internal RC mode

La sigla IntRC sta per "Internal RC" mode e il suo funzionamento è molto simile a quello dell' "RC External". A differenza di quest'ultimo in questa modalità la resistenza e la capacità sono già predisposte. I dispositivi che supportano questa modalità hanno un oscillatore RC on-chip.

 Current designs run at approximately 4 MHz.

IntRC mode is the least expensive oscillator available since no external components are needed. It is also useful, because devices in this mode can often use the OSC1 and OSC2 lines for general purpose I/O. This feature makes the PIC12CXXX and other 8-pin PICmicro devices very popular.

Often PICmicro devices with IntRC mode contain an OSCCAL register. This register is loaded by user software to calibrate the IntRC oscillator as accurately as possible. As with External RC mode, use IntRC mode for timing sensitive applications. RS-232 is not recommended due to the inherent inaccuracies of an RC oscillator. Details on this can be found in the supporting device datasheet.

[Torna all'inizio della pagina]

ER External Resistor Mode

ER sta per "External Resistor" mode. Questa tecnica è molto simile alla "External RC", ma non ha bisogno di capacità esterne. Una sola resistenza è sufficiente a controllare la frequenza generata.

In modo analogo all'RC mode anche questa modalità è caratterizzata da un modesti consumo di potenza e da basso costo.

Data la natura dell'oscillatore RC, si sconsiglia l'uso in applicazioni timing-sensitive o nell'uso della RS-232.

Per conoscere i differenti valori di frequenza che si ottengono al variare della resistenza si rimanda alla consultazione dei data-sheet dei dispositivi.

[Torna all'inizio della pagina]

Progetto degli oscillatori

bulletQuando usare i cristalli
bullet Crystal or Resonator Based Oscillator
bulletUso dei risonatori ceramici
bulletUso dei moduli oscillatori
bulletUso dell' "External RC" o dell' "External R"
bulletUso dell' "Internal RC"
bulletCapacità per cristalli o risonatori
bulletRegole generali di progetto

[Torna all'inizio della pagina]

Quando usare i cristalli

Quando vengono impiegati i cristalli è necessario impiegare almeno due pin del controllore e due piccoli condensatori. Sebbene l'uso di resistenze non è generalmente necessario, it is still a good idea to leave the pads,

and if it is not needed, a 0 or 1 ohm resistor can be put in its place. The resistor is

needed if you see that clipping of your signal and adjustment of the capacitors was

not enough.

It is a good idea to do all testing and qualification on the final board, since the board

will have stray capacitance and other issues which may affect the oscillator. By

doing the testing on the final board design, it helps to ensure that the behavior will

be similar on all manufactured boards.

Remember, you want to see a sinusoidal wave on OSC2 that is not clipped and of as

maximum an amplitude as possible. If you observe a clipped signal you may need

to add the resistor mentioned above to reduce gain. Again, remember that

measuring the OSC2 pin will load it down a small amount.

[Torna all'inizio della pagina]

Crystal or Resonator Based Oscillator

Questi due diagrammi mostrano come un cristallo o un risonatore devono essere connessi al microcontrollore. Del componente vengono mostrati soli i pin OSC1 e OSC2.

Il condensatore C1 è connesso tra il pin OSC1 e massa. Il condensatore C2 è connesso tra la parte inferiore della resistenza "R" e la massa. Nel caso in cui non venga utilizzata alcuna resistenza il condensatore C2 viene connesso dirattamente al pin OSC2.

Il cristallo, indicato con X-T-A-L nel diagramma, è connesso tra OSC1 e la parte inferiore della resistenza e, se non ci sono resistenze, viene collegato direttamente ai pin OSC1 e OSC2.

La misura delle oscillazioni può essere effettuata con un oscilloscopio connesso a OSC2.

 

Remember that the oscilloscope probe should be a x100 probe or FET amplified.

C2 controls the overall gain of the oscillator, while C1 mainly controls the phase

shift. Often these capacitors are of equal value, but some adjustment of these may

be needed in your design.

[Torna all'inizio della pagina]

Uso dei risonatori ceramici

When using a ceramic resonator, the same rules for crystals apply.

Ceramic resonators are often used as they are lower in cost and less prone to vibration damage. However, as mentioned earlier, they tend to require more drive level.

Resonators with a frequency greater than 3 to 4 MHz can be difficult to drive, due to limitations in the available drive level.

As a general rule, avoid resonators with built-in capacitors. Using built-in

capacitors will prevent you from being able to make changes easily during the

qualification process. Plus, many resonators use capacitors that are too large for the

drive level supplied by the microcontroller.

[Torna all'inizio della pagina]

 

Uso dei moduli oscillatori

I moduli oscillatori esterni sono molto semplici da usare.

Place the PICmicro device into HS or XT as described earlier and feed the signal into the OSC1 pin.

Il pin OSC2 può restare fluttuante. Leggi il datasheet del componente per maggiori dettagli.

Come ogni componente del tuo progetto, è importante che il modulo sia progettato per funzionare entro un range stabilito.

Sono disponibili un gran numero di moduli oscillatori. Alcuni di questi funzionano a 5V, altri sono stati progettati per operare a 3.3V.

Il range di temperature ammissibili è molto ampio =?? oppure può variare di molto

The temperature range can also vary widely.  

Ensure the oscillator module is suitable to your design.

Oscillator modules are ideal for testing code, and for products that you do not wish

to require a lot of oscillator qualification effort. Oscillator module drawbacks are

their higher current consumption, size, and cost. Also, unlike a crystal-based design,

an oscillator module can drive more than just one microcontroller. Frequently it can

drive several PICmicro devices as well as other components of your circuit. They

are ideal for designs that require an oscillator clock in several places.

If you have a design that is not working, try swapping in an oscillator module. You

may find that the oscillator was the cause of your problem. And, if nothing else, it

will tell you that the oscillator is fine, and the problem really does lie within the code

or other parts of your hardware.

[Torna all'inizio della pagina]

 

Uso degli oscillatori "External RC" o "External R"

Le modalità RC e R external sono molto semplici da implementare.

Non è possibile ottenere un temporizzazione precisa e, di conseguenza, non possono essere utilizzate per applicazioni basate sull'uso della RS-232 o con altre applicazioni che prevedono una temporizzazione.

However, it is an inexpensive way of getting almost any clock frequency up to 4MHz maximum. Due to drift in temperature, process variation, and other factors, specifications of what frequency is produced by what combination of R and C are often not available.

This mode requires some trial and error to find the values for the desired frequency. However, the device datasheet will provide you with a range of values that are valid for use with the external RC or external R mode. Since there is little issue with loading and drive level, the frequency can be easily tested with an oscilloscope or frequency counter.

To see the clock rate when using External RC mode, test the OSC2 pin. It will output one-quarter the clock rate the R-C oscillator is producing.

[Torna all'inizio della pagina]

Uso dell' "Internal RC"

La modalità interna RC è molto semplice da usare. Prima di tutto bisogna assicurarsi che sia stata attivata la modalità interna e non esterna.

 Since they are both called RC modes of one type or another, this can be easy to do.

Again, due to the nature of R-C oscillators, this mode is not recommended for

timing sensitive applications or RS-232 use. The frequency from most internal RC

modes is approximately 4 MHz.

Altre opzioni possono essere disponibili per avere dettagliate informazioni su queste, occorre consultare il data-sheet del dispositivo.

Often, the oscillator can be calibrated. While this will not prevent frequency drift, a

calibrated oscillator will be closer to the desired 4 MHz or other frequency than one

that is not calibrated.

Consulta il data-sheet del dispositivo che usi alla voce "OSCCAL" per avere maggiori informazioni sulla callibrazione se questa è disponibile sul tuo dispositivo.

[Torna all'inizio della pagina]

 

Capacità per i cristalli o i risonatori

Some additional tips to remember when choosing capacitors when you are using a crystal or

resonator:

Consult the device datasheet of both the PICmicro MCU and the manufacturer of the crystal or

resonator. They will both give reasonable ranges and suggested values. As a rule, keep within these

ranges during your tests. If using a higher frequency, lean more toward lower capacitance values.

Smaller caps are more appropriate for higher frequencies due to the law of capacitive reactance.

This law states that for any given capacitor, the higher the frequency, the more easily it will pass

though that capacitor. Oscillators require some of the current to pass though, but not too much. As a

general rule, the current must remain fairly constant, so the capacitor changes to match the change in

frequency.

It is a good idea in general to minimize stray capacitance on your board, particularly in the oscillator

area. This helps prevent unwanted capacitance from affecting your oscillator.

Use an AT cut crystal. The gain profile of the PICmicro oscillator is designed to use AT cut crystals.

When having drive level problems, try adjusting the capacitors. C2 controls the gain of the

oscillator. The lower the value of C2, the higher the gain that can be expected. Note that C2 is the

capacitor which connects to the OSC2 pin of the PICmicro microcontroller.

[Torna all'inizio della pagina]

Regole generali di progetto

When designing oscillators of any kind, always remember:

* Check the temperature and voltage specifications of all components, including the

oscillator components.

* Always qualify your initial design, and if you change the oscillator circuit be sure

you requalify your design. This is true even if you change just the microcontroller.

Changing the PICmicro device includes migrations, such as migrating from a

PIC16F84 to a PIC16F84A.

* Check the data sheets for the devices involved to get an idea of what are good

starting values. Use your knowledge of oscillator design to experiment and modify

as appropriate.

* Oscillators will not function correctly if the power supply is not stable. Ensure the

stability of your power supply and use bypass capacitors as appropriate to your

design.

[Torna all'inizio della pagina]

Requisiti dell'oscillatore

bulletGenerale
bulletRequisiti di temperatura e tensione
bulletWake-up from SLEEP

[Torna all'inizio della pagina]

Generale

Quando si progetta un oscillatore esso deve rispondere a particolari requisiti.

 The purpose of qualifying and requalifying an oscillator is to ensure it will work under all the conditions where it is expected and specified to perform. Oscillator designs should be tested just like your software and other hardware.

Quando si verificano i requisiti di un oscillatorie è necessario testarlo ai limiti delle sue caratteristiche =

When qualifying an oscillator, it is a necessary to test it at least to the limits of its

intended purpose. However, it is much better to test it beyond its intended use, to

help ensure that it will function correctly in your design.

Quando usi un cristallo o un risonatore,devi essere certo che i valori delle capacità e del livello di pilotaggio siano adeguati.

Dovresti osservare con un oscilloscopio il segnale sul pin OCS2 e vedere una sinusoide con un'ampiezza = You should observe OSC2 with an oscilloscope. You should see a sine wave with an amplitude as large as possible without clipping.

Remember, since the probe has some capacitance, measuring the signal will affect

it. You should use the highest power probe you can, such as a x100 or FET

amplified probe, for testing oscillator circuits. x10 probes can be used, but they will

load down the circuit considerably and the results may be inaccurate.

Nel caso vogliate adattare un progetto ideato per un dato dispositivo PICmicro ad un'altro vi raccomandiamo di riqualificare l'oscillatore.

Tipici cambiamenti sono:

dal PIC16C74 al PIC16F877, dal PIC12C508 al PIC12C508A, dal PIC16C54 al

PIC16C54C.

[Torna all'inizio della pagina]

Requisiti di temperatura e tensione

 

Il diagramma precedente mostra gli intervalli di tensione e di temperatura che puoi tollerare

 The actual values will depend on what the PICmicro MCU

is specified for, what the circuit is designed for, and what you are willing to test.

However, the general concept is this: The most important places to test the

oscillator design is at the "corners." A corner is a maximum and/or minimum of

temperature and voltage.

The four sections labeled "TEST" in the diagram above represent the ideal places to

test, and are referred to as the "4 corners." It is certainly reasonable to test more,

and recommended.

 

Questo titolo è da togliere perche probabilmente è incluso nel precedente

Oscillator temperature qualification

*****************************************************

As mentioned in the previous diagram, a "corner" represents a minimum and/or

maximum of voltage and temperature.

First test high voltage with low temperature, and low voltage with high temperature.

This part of the four-corner test tends to check the highest and lowest drive levels

the circuit will encounter. Next, test high voltage with high temperature, and low

voltage with low temperature.

The signal on OSC2 should be a sinusoidal wave of maximum achievable amplitude

without clipping. The peaks should approach the ground and VDD potentials of

your application. The device datasheet for the PICmicro MCU you are testing will

specify what a valid high and low is. Your oscillator should meet at least these

specifications. Interfere with the oscillator as little as possible by isolating the test from the circuit

as much as possible. A x100 or FET amplified probe is a good start, and other

methods can be devised. Testing for "wake from SLEEP" is also recommended, which we will explore next.

[Torna all'inizio della pagina]

Wake-up from SLEEP

Il risveglio dalla modalità di sleep è il processo più traumatico per l'oscillatore.

L'oscillatore lavora amplificando il rumore per partire, e quindi risonare alla frequenza desiderata.

Per partire correttamente l'oscillatore ha bisogno di una sequenza di segnali di rumore.

Il  power-on spike (generato quando il circuito viene alimentato per la prima volta) è l'ideale per garantire l'avvio dell'oscillatore. Questo spiega perchè è facile per un oscillatore partire  quando viene alimentato per la prima volta.

Quando il microcontrollore viene messo in modalità di SLEEP, c'è un segnale di rumore molto piccolo per permettere all'oscillatore di funzionare. =  

When the microcontroller is put to SLEEP, there is very little noise to allow the

oscillator to start up.

However, properly designed and qualified circuits should not

have a problem starting up.

High temperature and low voltage also make waking from SLEEP difficult.

Even if you are not using SLEEP in your application, it makes a good "worst case"

test. SLEEP, particularly at high temperature and low voltage, should also be tested

using the corner method described earlier.

These tips will give you insight into the type of testing that can be done to aid

qualification even if you determine that it is not necessary to test this much or this

often.

[Torna all'inizio della pagina]

Troubleshooting Oscillators (Ricerca di un guasto)

Questa sezione descrive alcuni

This final section will discuss a few troubleshooting tips and leave you with some

resources to look at for more information.

Quando ricerchi un guasto nel progetto di un oscillatore accertati prima di tutto che si effettivamente l'oscillatore a non funzionare. Questo può essere verificato invertendo

 This is tested by swapping in an external oscillator

module or an appropriately configured function generator.

Se non l'oscillatore non parte correttamente, decadendo dopo un po di tempo oppure funziona in modo irregolare e stai usando un cristallo o un risonatore il problema potrebbe essere il livello (tension credo) di pilotaggio.

E' opportuno sperimentare diversi valori di capacità e diversi livelli di pilotaggio.

Chances are

start-up and erratic operation is an under-driven oscillator and the capacitors need to be decreased. Failure after some time may suggest that the crystal is being

overdriven. Overdriving a crystal will permanently damage it and the damage can

take weeks or months to become apparent.

The ratio of the two capacitors can also be changed. This is discussed in detail in an

application document titled FACT 1, available from the Microchip website. FACT

1 and other application notes contain more tips that are not covered here. This

guide was created to get you started with your oscillator design and familiarize you

with the options available and key points.

Ricorda che la modalità di default per la maggior parte dei PIC è l' External RC. Quindi se non programmate la modalità dell'oscillatore probabilmente sara l'External RC.

[Torna all'inizio della pagina]

Altre fonti di informazioni

Concludiamo queste brevi considerazioni sugli oscillatori per PIC segnalando che potete reperire maggiori informazioni nei documenti:

Midrange and Enhanced Reference Manuals (Oscillator Chapter).

PICmicro Device Datasheets (Special Features of the CPU or Oscillator

Chapter).

FACT 1, "Basic PIC16/17 Oscillator Design" and Application Note AN588,

"PICmicro Microcontroller Oscillator Design Guide."

Che sono repreribili in formato PDF sil sito:

http://www.microchip.com

Precedente Home Successiva

 

[Torna all'inizio della pagina]

Home ] Su ] I quarzi ]

Se volete gentilmente segnalare errori, se volete contattarmi o se volete semplicemente insultarmi potete scrivere a   pmsp@libero.it
Copyright © 2004 P-M-S-P Laboratory
Ultimo aggiornamento: 29-07-04