Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Embedded Controller Hardware Design (Ken Arnold, 2001).pdf
Скачиваний:
151
Добавлен:
12.08.2013
Размер:
1.22 Mб
Скачать

41CHAPTER TWO

Microcontroller Concepts

compatibility (EMC) covers this noise, as well as others such as electrostatic discharge (ESD). A good summary of EMC concepts as they relate to microcontrollers can be found in the Intel application note AP-125, “Designing Microcontroller Systems for Electrically Noisy Environments.”

Oscillator and Timing Circuitry

Timing generation is completely self-contained on the 8051, except for the frequency reference (which can be a crystal or external clock source). The on-board oscillator is a parallel anti-resonant circuit with a frequency range of 1.2 MHz to 12 MHz for the original 8051. There is a divide-by-12 internal clock counter that gives the standard 8051 an instruction cycle of 1 S with a 12 MHz crystal. Higher speed versions of the processor are also available, which use fewer than twelve clocks per instruction cycle. The Dallas 80C320 uses only four clock cycles for most instruction cycles, so it is three times faster than the original CPU using the same clock frequency. The XTAL2 pin is the output of a high-gain amplifier while XTAL1 is its input. A crystal connected between XTAL1 and XTAL2 provides the feedback and phase

shift required for oscillation. For stability and

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

consistent oscillator start-up, two capacitors

 

 

8051

 

 

 

 

 

 

 

 

 

 

in the range of 10 to 20 picofarads should be

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

XTAL2

connected from the XTAL pins to ground. If

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

XTAL1 is being driven by an external frequency

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

source, XTAL2 should not be connected. An

C

 

 

 

 

 

C

 

 

 

 

 

 

 

XTAL1

 

 

 

 

 

 

 

 

 

 

 

 

external clock can also be applied to XTAL1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

to allow the use of a separate clock frequency

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

source, such as an oscillator module. Figure

 

 

Figure 2-13: Standard

2-13 shows a standard oscillator configuration.

 

 

oscillator configuration.

The oscillator circuit consists of a crystal connected between the XTAL1 and XTAL 2 pins of the processor, along with two capacitors, one from each XTAL pin to ground to improve stability and start-up characteristics of the oscillator. The internal amplifier and quartz crystal form a series resonant oscillator which operates at the at the crystal’s resonance frequency. The amplifier in the original 8051 was an inverting amplifier, but other variants and other processor families make use of non-inverting amplifiers in some cases. All of the processor’s timing is derived from this oscillator. For the standard 8051 compatible parts,