Datasheet OscPrscript Datasheet

Page 1
E
Text Script for eLearning course “Oscillators”
Table of contents
Introduction 2 Oscillator Modes 3 High Speed 4 Standard Crystal 5 Knowledge Check #1 6 Low Power 7 External RC 8 Internal RC 9 External Resistor 10 Knowledge Check # 2 11 Closing Slide 12
Text script for “Oscillators” Page 1 of 6
Page 2
*h
Slide 1: Introduction
Microchip Technology welcomes you to the Oscillator module of the PICmicro x14 microcontroller. This module will give you a basic overview, design tips and troubleshooting for PIC MCU Oscillators and is intended for those new to PIC MCUs or those requiring a refresher on PIC MCU Oscillators. It is recommended you have previously taken or are familiar with the PIC MCU x14 architecture and instruction set modules.
Slide 2: Introduction
The oscillator circuit in a PICmicro is what generates the system clock that is required by the MCU to run. While oscillator design and usage is simple in concept, selecting the wrong or unqualified oscillator for your application can lead to difficulties. This presentation explores these issues and the common oscillator modes and attributes so you will have a greater understanding of designing with oscillators on PIC MCUs.
Slide 3: Oscillator Modes Overview
There are 4 common oscillator modes that are available on PICmicro devices; HS, XT, LP and RC. These modes allow the user to create a clock by using crystals, canned oscillator modules, resonators, an RC circuit or even a single resistor. (add pictures of different clock sources) Some PICmicro devices also have the option of an internal RC oscillator. As you would expect, each of these modes has a different set of operating characteristics and constraints.
The oscillator mode is set by the state of the configuration bits, wh ich are non­volatile memory locations, and are written during device programming. These bits are set within the programmer software or by using the _config directive in your source code. Please note here that the config directive has 2 underscore characters, not one.
It should be noted here that no matter what oscillator mode you choose to use, is very important that your design is tested thoroughly to make sure it is stable.
Text script for “Oscillators” Page 2 of 6
Page 3
*h
Slide 4: HS Mode
The first mode that we will talk about is the High Speed (HS) mode, which is designed to be used with crystals and resonators above a frequency of 4Mhz. However, this is only a guideline, the important thing to remember about HS mode is that it provides the highest drive level available. The PICmicro oscillat or design requires the use of a parallel cut crystal. This is true for HS, XT and LP modes.
The diagram shows a typical circuit for use with a crystal or Ceramic resonator. A series resistor Rs may also be required for AT strip cut crystals. You can find information in the datasheet that gives typical capacitor values for a given operating mode and crystal frequency used. This diagram shows a typical configuration, but there are many different circuit configurations that can be used for crystals and resonators, some of which are described in the device datasheet.
Keep in mind that crystals and resonators must be driven by a signal, and the gain on this signal controls whether an oscillation will occur and how strong it will be. Care must be taken not to underdrive or overdrive the crystal or resonator. With crystals, too much drive will cause long-term damage, often causing a failure in a matter of weeks. With too little drive, the product may not start up correctly or may fail to oscillate under certain conditions.
With resonators, more drive is typically required than for crystals so you will find that HS mode is commonly used for resonators.
Keep in mind that as the frequency increases, the drive level required tends to increase, as well as the current consumption.
Slide 5: XT mode
The next mode we will discuss is the standard crystal mode or XT mode. This mode produces a medium drive level and is designed to be used with crystals and resonators from 1 to about 4 MHz. XT mode has moderate power consumption since its drive level is lower than HS mode, and because a lower clock speed is produced.
If your circuit is having problems starting up in this mode, you may want to consider using HS mode which has a higher drive level.
Text script for “Oscillators” Page 3 of 6
Page 4
*h
Slide 6: Knowledge Check # 1 Q: In general, using a higher frequency crystal oscillator will:
a) cause unstable oscillation b) damage components
c) cause higher current consumption (correct answer)
d) require the use of HF mode
Slide 7: LP mode
The Low Power (LP) mode is designed for circuits where low power is a primary concern. LP mode is engineered for use with a 32.768 kHz crystal, although it can function at any frequency below 200 kHz. The 32Khz crystal is commonly used for timing -sensitive applications since this frequency is easily divided down to one that is suitable for timekeeping functions.
It is important to note that in order to produce accurate timing, the system should be as stable as possible with respect to variables like temperature, voltage, etc.
Slide 8: EXTRC mode
There are two RC modes available--one for external components and one for internal components.
The External RC mode (EXTRC) uses a resistor-capacitor network connected to the OSC1 pin. When the device is configured for external RC mode, these components are automatically driven to produce a frequency which will run the PICmicro MCU. The frequency range for EXTRC mode is DC - 4MHz and the power consumed will vary depending on the frequency used. RC mode is designed for very low-cost applications and an RC circuit is typically more rugged than a crystal or resonator.
It is important to note that RC mode will produce an inaccurate clock source. The frequency will vary due to temperature, process variance in the device, types of capacitors and resistors, etc. For these reasons, RC mode is not recommended for timing sensitive applications such as RS-232 communication.
Text script for “Oscillators” Page 4 of 6
Page 5
*h
Slide 9: intRC mode
As mentioned earlier in the presentation, some PICmicro devices offer the use of an internal RC oscillator. For these devices, the Internal RC mode (IntRC) functions much like the External RC mode that we just spoke about, except that the resistor and capacitor are provided on the chip. The frequency range available for the Internal RC mode typically varies by product from 31 kHz to 4 MHz.
PICmicro devices with the IntRC mode often contain an Oscillator Calibration (OSCCAL) register, which is used by the factory to calibrate the internal oscillator as accurately as possible.
Since no external components are needed, IntRC mode is the least expensive oscillator available. Another advantage of this mode is that the OSC1 and OSC2 pins can often be used as general purpose I/O pins.
As with External RC mode, the IntRC mode should not be used for timing sensitive applications such as RS-232 communication.
Slide 10: ER mode
The last mode is the External Resistor (ER) mode which requires only one resistor to operate. The value of the resistor is what sets the frequency range for the ER mode. For information on the frequency resulting from various resistor values, refer to the device datasheet.
Similar to RC mode, ER mode has moderate power consumption and is very low cost. As with the other RC modes, it is not recommended for timing sensitive applications.
Text script for “Oscillators” Page 5 of 6
Page 6
*h
Slide 11: Knowledge Check #2 Q: Matching question - The correct matches are shown here:
HS mode – Highest drive level available RC mode – Has both external and internal modes XT mode – Produces lower clock speeds than HS mode LP mode – Ideal for timing sensitive applications
Slide 12: Closing Slide
This concludes the Oscillator module for the PICmicro MCU. We hope you now have a basic understanding of PICmicro MCU oscillators. Remember that it is very important that you test your oscillator design thoroughly to ensure it is stable.
There are several application notes that you may find useful when designing with oscillators. These are AN588: “PIC16/17 Oscillator Design Guide” and AN606: “Low power Design using PIC16/17”
If you would like to give us your comments on this presentation or the Microchip eLearning Program, click on the “Feedback” link on the left side of the screen.
Text script for “Oscillators” Page 6 of 6
Loading...