Home » Embedded Systems

Oscillator Frequency in Microcontrollers

Oscillator Frequency in Microcontrollers: In this article, we will discuss about what is oscillator frequency in microcontrollers, why are they required and why they are an important aspect of embedded systems development? We will also learn about the basic concept of Timers and Interrupts in embedded system.
Submitted by Sudarshan Paul, on June 19, 2018

Oscillator Frequency in Microcontrollers

The digital computer systems must contain an oscillator circuit for its functioning. The oscillator circuit is often regarded as the ‘heartbeat’ of an embedded system. Any malfunctioning of the oscillator will directly have an impact in the normal functioning of the system. The system depends upon the oscillator for all time-related calculations.

Relation between Oscillator frequency and machine-cycle period

The speed at which microcontroller processes the applications depends upon the oscillator frequency. The frequency forms the basis for comparing two different microcontrollers. The 8051 microcontroller runs with a minimum 12 oscillator cycles in order to execute a machine function. The performance of an 8051 microcontroller can be improved simply by increasing the clock frequency. The performance can also be improved by upgrading the internal components so that fewer oscillator cycles are required in order to complete a machine instruction. The modern desktop PC operate with around 1000 MIPS (Millions of instructions per second) or more. Among that majority of the performance is consumed by the Operating System. Whereas an embedded operating system will consume at most 1% of the full operating frequency, thus leaving a greater percentage of performance to deal with complex embedded operations.

Why a low oscillator frequency microcontroller is preferred?

  • Many people might think that selecting a microcontroller of higher frequency delivers maximum performance. This can be a mistake, because of the following reasons -:
  • Using applications which don’t require the level of performance that modern 8051 device offers.
  • In modern 8051s, the oscillator frequency and power supply current vary linearly with each other. As a result, by choosing a device with the low frequency the power requirements can be brought down.
  • The electromagnetic interference generated by a circuit can be reduced by using a device with low clock frequency.
  • While accessing low-speed peripherals, the cost of peripheral components can be reduced if the chip is operating at low frequency. Also, the design and programming become simplified.

Timers

Members of 8051 families consisting of at least two timers, namely Timer ) and Timer 1. Timers are very important in the development of embedded systems. Timers are properly configured so that they can be periodically incremented after completion of a specific number of cycles. In 8051 timers, the timers are incremented for every 12 oscillator cycles. If we have a 12MHz oscillator, then the timer will be incremented 1 million times per second.

Timers can be used for,

  • Measuring intervals of time
  • Generating hardware delays
  • Generate ‘time out’ facilities

Interrupts

An interrupt is a hardware mechanism through which the process is notified about an event that has taken place. Interrupts help in assisting multiple tasks that are to be performed at a time using a single processor.

Interrupts

In the above figure, we can see that when function 1 is executed an interrupt is raised that is referred to as ISR1 (interrupt service routine). Function 1 resumes its operation after execution of ISR1 is complete.

Now the question comes what is an interrupt service routine?

In terms of C programming, interrupt service routine is a function that is ‘called by the microcontroller’, as a result of a particular hardware event.






Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.
Learn PCB Designing: PCB DESIGNING TUTORIAL




Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates


© https://www.includehelp.com some rights reserved.