Answer to Question #159301 in Assembler for Hasan Khan

Question #159301

(a) Write about Oscillator and watchdog timer in ATmega32 microcontroller.

(b) What are the major differences between a microprocessor and a microcontroller?


1
Expert's answer
2021-02-01T03:31:25-0500

a)

Oscillator is an important component for all devices, which works based on clock frequency. Oscillator is an electronic circuit that produces a periodic, oscillating electronic signal.

ATmega32. Key Features:

Programmable watch dog timer with separate on-chip oscillator.

Oscillators:

It incorporates internal reset and oscillator which makes it possible to eliminate the need for any external input. The internal RC oscillator is capable of generating internal clock which can run at any frequency of 1MHz, 2MHz , 4MHz or 8MHz as programmed. It also supports external oscillator with maximum frequency of 16MHz.

XTAL1 and XTAL2 are input and output, respectively, of an inverting amplifier which can be configured for use as an On-chip Oscillator. Either a quartz crystal or a ceramic resonator may be used. The CKOPT Fuse selects between two different Oscillator amplifier modes. When CKOPT is programmed, the Oscillator output will oscillate will a full railto-rail swing on the output. This mode is suitable when operating in a very noisy environment or when the output from XTAL2 drives a second clock buffer. This mode has a wide frequency range. When CKOPT is unprogrammed, the Oscillator has a smaller output swing. This reduces power consumption considerably. This mode has a limited frequency range and it can not be used to drive other clock buffers.

 

Watchdog Timer (WDT) can be helpful to automatically reset the system whenever a timeout occurs. A system reset is required for preventing the failure of the system in a situation of a hardware fault or program error.

There are countless applications where the system cannot afford to get stuck at a point (not even for a small duration of time). The system should be robust enough to automatically detect the failures quickly and reset itself in order to recover from the failures and function normally without errors.

One can manually reset the system to recover from errors. But it is not always feasible to manually reset the system, especially once it has been deployed. To overcome such problems, a watchdog timer is necessary to automatically reset the system without human intervention.

The watchdog timer is loaded with a timeout period which is dependent on the application.

The watchdog timer starts its counting independent of the system clock i.e. it has a separate internal oscillator to work independently of a system clock.

The watchdog timer cleared through software each time before the timeout period occurs. Whenever software failed to clear the watchdog timer before its timeout period, then watchdog timer resets the system.

For this purpose, the watchdog timer is used to overcome software failures in real-time applications.

The watchdog timer is also used to wake up the microcontroller from sleep mode.

ATmega32.

The Watchdog Timer is clocked from a separate On-chip Oscillator which runs at 1MHz. This is the typical value at VCC = 5V. By controlling the Watchdog Timer prescaler, the Watchdog Reset interval can be adjusted. The WDR – Watchdog Reset – instruction resets the Watchdog Timer. The Watchdog Timer is also reset when it is disabled and when a Chip Reset occurs. Eight different clock cycle periods can be selected to determine the reset period. If the reset period expires without another Watchdog Reset, the ATmega32 resets and executes from the Reset Vector. To prevent unintentional disabling of the Watchdog, a special turn-off sequence must be followed when the Watchdog is disabled.

b)

A microprocessor is a controlling unit of a micro-computer wrapped inside a small chip. It performs Arithmetic Logical Unit (ALU) operations and communicates with the other devices connected with it. It is a single Integrated Circuit.

A microcontroller is a chip optimized to control electronic devices. It is stored in a single integrated circuit which is dedicated to performing a particular task.

KEY DIFFERENCES:

-         Microprocessors are based on Von Neumann model. Micro controllers are based on Harvard architecture

-         Microprocessor consists of only a Central Processing Unit, whereas Micro Controller contains a CPU, Memory, I/O all integrated into one chip

-         Microprocessor uses an external bus to interface to RAM, ROM, and other peripherals. Micro controllers uses an internal controlling bus

-         As all the peripheral of microcontroller are on single chip it is compact while microprocessor is bulky

-         Microprocessors: Due to external components, the total power consumption is high. Therefore, it is not ideal for the devices running on stored power like batteries. Micro Controller: As external components are low, total power consumption is less. So it can be used with devices running on stored power like batteries

-         Most of the microprocessors do not have power saving features. Most of the microcontrollers offer power-saving mode.

-         Microprocessor has a smaller number of registers, so more operations are memory-based. Microcontroller has more register. Hence the programs are easier to write.

-         Processing speed of microcontrollers is about 8 MHz to 50 MHz, but in contrary processing speed of general microprocessors is above 1 GHz so it works much faster than microcontrollers.

-         Microprocessor: Cost of the entire system is high. Micro controllers: Cost of the entire system is low

-         Microprocessor 's used for general purpose applications that allow you to handle loads of data. Micro controllers . It's used for application-specific systems. Tasks performed by microcontrollers are limited and generally less complex


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS