Professional Documents
Culture Documents
Q) 8051 architecture
CPU (Central Processor Unit): Central Processor Unit or CPU is the mind of any
processing machine. It scrutinizes and manages all processes that are carried out in the
Microcontroller.
Interrupts:As the heading put forward, Interrupt is a subroutine call that reads the
Microcontroller’s key function or job and helps it to perform some other program
which is extra important then.
Interrupts:As the heading put forward, Interrupt is a subroutine call that reads the Microcontroller’s key function or job and
helps it to perform some other program which is extra important then.
BusFundamentally Bus is a group of wires which function as a communication canal or means for the transfer of Data.
There are two types of buses:
Address Bus: Microcontroller 8051 consists of a 16-bit address bus. It is brought into play to address memory positions. It is
also utilized to transmit the address from the Central Processing Unit to Memory.
Data Bus: Microcontroller 8051 comprise of 8 bits data bus. It is employed to cart data.
OscillatorAs we all make out the Microcontroller is a digital circuit piece of equipment, thus it needs a timer for its function. For
this function, Microcontroller 8051 consists of an on-chip oscillator that toils as a time source for the CPU (Central Processing
Unit).
UNIT 3
External Interrupt
INT0 and INT1 are external interrupts. The TCON register are for programming external interrupts to edge or level triggered.
Hence, the TCON is Timer Control. TCON is another bit addressable SFR. Then the address of SFR is 88H.
UNIT 2
Q)Clock
Every Timer needs a clock to work, and 8051 provides it from an external crystal which is
the main clock source for Timer. The internal circuitry in the 8051 microcontrollers pro-
vides a clock source to the timers which is 1/12th of the frequency of crystal attached to the
microcontroller, also called Machine cycle frequency.
8051 Timer Clock
For example, suppose we have a crystal frequency of 11.0592 MHz then the microcontroller
will provide 1/12th i.e.
Timer clock frequency= (Xtal Osc.frequency)/12 = (11.0592 MHz)/12 = 921.6 KHz
period T= 1/(921.6 kHz)=1.085 μS
Q) 8085 Timer
8051 has two timers Timer0 (T0) and Timer1 (T1), both are 16-bit wide. Since 8051 has 8-bit architecture, each of these is ac-
cessed by two separate 8-bit registers as shown in the figure below. These registers are used to load timer count.
8051 has a Timer Mode Register and Timer Control Register for selecting a mode of operation and controlling purpose.
these registers are:
TMOD register
TMOD is an 8-bit register used to set timer mode of timer0 and timer1.
Its lower 4 bits are used for Timer0 and the upper 4 bits are used for Timer1
Bit 7,3 – GATE:
1 = Enable Timer/Counter only when the INT0/INT1 pin is high and TR0/TR1 is set.
0 = Enable Timer/Counter when TR0/TR1 is set.
Bit 6,2 - C/->(Counter/Timer): Timer or Counter select bit
1 = Use as Counter
0 = Use as Timer
Bit 5:4 & 1:0 - M1:M0: Timer/Counter mode select bit
TCON Register
TCON is an 8-bit control register and contains a timer and interrupt flags.
Bit 7 - TF1: Timer1 Overflow Flag
1 = Timer1 overflow occurred ; 0 = Timer1 overflow not occurred
Bit 6 - TR1: Timer1 Run Control Bit
1 = Timer1 start.; 0 = Timer1 stop.
Bit 5 – TF0: Timer0 Overflow Flag
1 = Timer0 overflow occurred; 0 = Timer0 overflow not occurred.
Bit 4 – TR0: Timer0 Run Control Bit
1 = Timer0 start.; 0 = Timer0 stop.
Bit 3 - IE1: External Interrupt1 Edge Flag
1 = External interrupt1 occurred.; 0 = External interrupt1 Processed.
Bit 2 - IT1: External Interrupt1 Trigger Type Select Bit
1 = Interrupt occurs on falling edge at INT1 pin.;0 = Interrupt occur on a low level at the INT1 pin.
Bit 1 – IE0: External Interrupt0 Edge Flag
1 = External interrupt0 occurred.; 0 = External interrupt0 Processed..
Bit 0 – IT0: External Interrupt0 Trigger Type Select Bit
1 = Interrupt occurs on falling edge at INT0 pin.; 0 = Interrupt occur on a low level at INT0 pin.
Q) Timer Modes:
Timers have their operation modes which are selected in the TMOD register using M0 & M1 bit combinations.
Mode 0 (13-bit timer mode)-Mode 0 is a 13-bit timer mode for which 8-bit of THx and 5-bit of TLx (as Prescaler) are used. It is
mostly used for interfacing possible with old MCS-48 family microcontrollers.
As shown in the above figure, 8-bit of THx and lower 5-bit of TLx
used to form a total 13-bit timer. Higher 3-bits of TLx should be
written as zero while using timer mode0, or it will affect the result.
UNIT 5
PIC16F877 Microcontroller
QWhat is ARM processor? Draw ARM Architecture with Each Module’s Working Principle
Ans->The ARM microcontroller stands for Advance RISC Machine; it is one of the extensive and most licensed processor cores
in the world. These processors are specifically used in portable devices like digital cameras, mobile phones, home networking
modules and wireless communication technologies and other embedded systems due to the benefits, such as low power consump-
tion, reasonable performance, etc.
Architecture->The ARM architecture processor is an advanced reduced instruction set computing [RISC] machine and it’s a
32bit reduced instruction set computer (RISC) microcontroller. It was introduced by the Acron computer organization in 1987.
This ARM is a family of microcontroller developed by makers like ST Microelectronics,Motorola, and so on. The ARM architec -
ture comes with totally different versions like ARMv1, ARMv2, etc., and, each one has its own advantage and disadvantages.
Difference between
PIC ARM
PIC micro-controller refers to Peripheral Interface Con- ARM micro-controller refers to Advanced RISC
troller. Machine.
It uses SRAM, Flash memory. It uses Flash, SDRAM, EEPROM memory.
It is based on some feature of RISC. It is based on RISC instruction set architecture.
PIC micro-controllers are available in 8-bit, 16-bit and available in 32-bit mostly also available in 64-bit.
32-bit.
Unit 6
What is a Real-Time Operating System (RTOS)?Why use an RTOS?Different features of RTOS
ans->A real-time operating system (RTOS) is an operating system (OS) (often a lightweight OS) that runs multi-
threaded applications and can meet real-time deadlines. Most RTOSes include a scheduler, resource management,
and device drivers.
Examples are: Airline traffic control systems, Command Control Systems, Heart Pacemaker, Robot etc.
It offers priority-based scheduling, which allows you to separate analytical processing from non-critical processing.
The Real time OS provides API functions that allow cleaner and smaller application code.
Abstracting timing dependencies and the task-based design results in fewer interdependencies between modules.
Component of RTOS
The Scheduler: This component of RTOS tells that in which order, the tasks can be executed which is generally based on the pri -
ority.
Symmetric Multiprocessing (SMP): It is a number of multiple different tasks that can be handled by the RTOS so that parallel
processing can be done.
Function Library: It is an important element of RTOS that acts as an interface that helps you to connect kernel and application
code.
Memory Management: this element is needed in the system to allocate memory to every program, which is the most important
element of the RTOS.
Fast dispatch latency: It is an interval between the termination of the task that can be identified by the OS and the actual time
taken by the thread, which is in the ready queue, that has started processing.
User-defined data objects and classes: RTOS system makes use of programming languages like C or C++, which should be or-
ganized according to their operation.
Features of RTOS
Occupy very less memory
Consume fewer resources
Response times are highly predictable
Unpredictable environment
Q)What are different types of RTOS? state its advantage, disadvantage and application?
Types:1.Hard Real Time :In Hard RTOS, the deadline is handled very strictly which means that given task must start executing
on specified scheduled time, and must be completed within the assigned time duration.Example: Medical critical care system,
Aircraft systems, etc.
2.Firm Real time:These type of RTOS also need to follow the deadlines. However, missing a deadline may not have big impact
but could cause undesired affects, like a huge reduction in quality of a product.Example: Various types of Multimedia applica-
tions.
3.Soft Real Time:Soft Real time RTOS, accepts some delays by the Operating system. In this type of RTOS, there is a deadline
assigned for a specific job, but a delay for a small amount of time is acceptable. So, deadlines are handled softly by this type of
RTOS.
Advantages:
1)Maximum utilization of devices and systems.
2)Time assigned for shifting tasks in these systems is very less.
4)These types of systems are error-free.
5)Memory allocation is best managed in these types of systems.
Disadvantages:
1)Limited Tasks 2)Use Heavy System Resources 3)Complex Algorithms
4)It is not good to set thread priority as these systems are very less prone to switching tasks.
5)RTOS performs minimal task switching.
Application->1) Industrial application:Real-time system has a vast and prominent role in modern industries.
2.Medical Science application:In the field of medical science, real-time system has a huge impact on the human health and
treatment.
3.Peripheral Equipment applications:Real-time system has made the printing of large banners and such things very easier.
4.elecommunication applications:Real-time system map the world in such a way that it can be connected within a short time.
5.Defense applications:In the new era of atomic world, defense is able to produce the missiles which have the dangerous powers
and have the great destroying ability.
UNIT 7
What is SDLC?
SDLC is a process followed for a software project, within a software organization. It consists of a detailed
plan describing how to develop, maintain, replace and alter or enhance specific software.
Software Development Life Cycle consists of the following stages −
Stage 1: Planning and Requirement Analysis
Stage 2: Defining Requirements
Stage 3: Designing the Product Architecture
Stage 4: Building or Developing the Product
Stage 5: Testing the Product
Stage 6: Deployment in the Market and Maintenance
Q)Iterative Model:
In this Model, you can start with some of the software specifications and develop the
first version of the software. After the first version if there is a need to change the soft -
ware, then a new version of the software is created with a new iteration.
The various phases of Iterative model are as follows:
1. Requirement gathering & analysis: In this phase, requirements are gathered from
customers and check by an analyst whether requirements will fulfil or not.
2. Design: In the design phase, team design the software by the different diagrams like
Data Flow diagram, activity diagram, class diagram, state transition diagram, etc.
3. Implementation: In the implementation, requirements are written in the coding lan-
guage and transformed into computer programmes which are called Software.
4. Testing: After completing the coding phase, software testing starts using different
test methods. There are many test methods, but the most common are white box, black box, and grey box test meth -
ods.
5. Deployment: After completing all the phases, software is deployed to its work environment.
6. Review: In this phase, after the product deployment, review phase is performed to check the behaviour and validity
of the developed product.
7. Maintenance: In the maintenance phase, after deployment of the software in the working environment there may
be some bugs, some errors or new updates are required.
Advantage:1)Testing and debugging during smaller iteration is easy.2)A Parallel development can plan.
3)It is easily acceptable to ever-changing needs of the project.
Disadvantage:1)It is not suitable for smaller projects: 2)More Resources may be required; 3)Requirement changes
can cause over budget.
Q)Prototype Model
The prototype model requires that before carrying out the development of actual software, a working prototype of
the system should be built. A prototype is a toy implementation of the system. A prototype usually turns out to be a
very crude version of the actual system, possible exhibiting limited functional capabilities, low reliability, and ineffi -
cient performance as compared to actual software.
Steps of Prototype Model
1)Requirement Gathering and Analyst
2)Quick Decision
3)Build a Prototype
4)Assessment or User Evaluation
5)Prototype Refinement
5)Engineer Product
Advantage:1)Reduce the risk of incorrect user requirement; 2)Regular visible process aids management; 3)Reduce
Maintenance cost.
Disadvantag:1)An unstable/badly implemented prototype often becomes the final product; 2)Require extensive cus -
tomer collaboration; 3)Difficult to know how long the project will last.
Q)Spiral Model
The spiral model, initially proposed by Boehm, is an evolutionary software
process model that couples the iterative feature of prototyping with the con-
trolled and systematic aspects of the linear sequential model. It implements the
potential for rapid development of new versions of the software.
Each cycle in the spiral is divided into four parts:
1)Objective setting: Each cycle in the spiral starts with the identification of pur-
pose for that cycle, the various alternatives that are possible for achieving the
targets, and the constraints that exists.
2)Risk Assessment and reduction: The next phase in the cycle is to calculate
these various alternatives based on the goals and constraints.
Development and validation: The next phase is to develop strategies that re-
solve uncertainties and risks.
Planning: Finally, the next step is planned. The project is reviewed, and a choice
made whether to continue with a further period of the spiral.
Advantages: 1)High amount of risk analysis; 2)Useful for large and mission-criti-
cal projects.
Disadvantages: 1)Can be a costly model to use; 2)Risk analysis needed highly particular expertise
Q)What is Embedded prduct development Life cycle (EDLC) and its importance?
It is an Analysis – Design – Implementation based problem solving approach for embedded systems development.
There are three phases to Product development:
1)Analysis involves understanding what product needs to be developed
2)Design involves what approach to be used to build the product
3)Implementation is developing the product by realizing the design.
Need for EDLC
1)EDLC is essential for understanding the scope andcomplexity of the work involved in embedded systems de-
velopment
2)It can be used in any developing any embedded product
3)EDLC defines the interaction and activities among variousgroups of a product development phase.
Example:-project management, system design