Nothing Special   »   [go: up one dir, main page]

Esd 1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 40

Unit 1

1. Write short note on


i) Components of Embedded system.
Ans:- Embedded Systems Hardware Components
Power Supply
The power supply is an essential part of any embedded systems circuits. An embedded system may
need a supply of 5 volts or if it is low power then maybe 3.3 or 1.8v. The supply may be provided
with the help of battery or we can use any wall adapter. It will depend on the application need.

Processor
A processor is the main brain inside any embedded systems. This is a major factor that affects the
performance of the system. There are different processors available in the market. An embedded
system may use microprocessor or microcontroller.

Memory
If we are using a microcontroller like AT89s51, AT89s52 or ATmega. The memory is available on-chip.
We generally talk about two types of memory in the embedded systems
Read-Only memory(RAM)
Random Access Memory(ROM)
Electrically Erasable Programmable Read-Only Memory (EEPROM)

Timers-Counters
If you are working in embedded systems you must have heard about
What are timer and counter
Why we use timer and counter
What is difference between timers and counter
In some application, we need to generate some delay. Like for blinking an LED, we need a delay. For
making square pulse we need a delay.

Communication Ports
Embedded systems hardware has different types of communication ports to communicate with the
other embedded devices.

Input and Output


To interact with the embedded systems we need input. The input may be provided by the user or by
some sensor. Sometimes some systems need more input or output. So the processor selection will
be based on I/O.

Application Specific Circuits


Some hardware components are common while designing the embedded systems. But some are
different and depends on the application need.

Software Components
Assembler
When you program in assembly language. This assembly language program is converted into the HEX
code using this utility. Then using some hardware called as a programmer we write the chip.

Emulator
An emulator is hardware or software tool that has a similar functionality to the target system or
guest system. It enables the host system to execute the functionality and other components.
Debugger
Sometimes we are not getting expected results or output due to errors or bug. There are certain
tools that are specifically used for the debugging process. Where we can see the controls flow and
register value to identify the issue.

Compiler
A compiler is a software tool that converts one programming language into target code that a
machine can understand.

2.Draw Microcontroller architecture and compare it with microprocessor


Ans:-

1. A microprocessor requires an external memory for program/data storage.Instruction execution


requires movement of data from the external memory to the microprocessor or vice versa. Usually,
microprocessors have good computing power and they have higher clock speed to facilitate faster
computation.

2. A microcontroller has required on-chip memory with associated peripherals. A microcontroller can
be thought of a microprocessor with inbuilt peripherals.

3. A microcontroller does not require much additional interfacing ICs for operation and it functions
as a stand alone system. The operation of a microcontroller is multipurpose, just like a Swiss knife.

4. Microcontrollers are also called embedded controllers. A microcontroller clock speed is limited
only to a few tens of MHz. Microcontrollers are numerous and many of them are application
specific.
3.A scheduler is a part of real time operating system and it keeps track of the states of each block.
Answer the following question about the scheduler and task states.
i) How does the scheduler know when a task becomes blocked or unblocked ?
ii) What happens if two states with same priority are ready ?
iii) What happens if all the tasks are locked ?
Ans:-1. : RTOS provides functions for tasks to tell scheduler:
„ what events the tasks want to wait for
„ to signal that events have happened

2. Depends on RTOS.
„ Illegal to have two tasks with same priority
„ Time-slice between the two tasks
„ Run one until blocked, then run the other
„ Backup scheduling policy: round-robin, FIFO

3. Scheduler spins in some tight loop in the RTOS.


„ If nothing ever happens, that’s your fault!
„ Make sure something happens sooner or later by having an interrupt routine call some RTOS
function to unblock a task.

4. What are embedded system and explain the challenges encountered during Design.
Ans:- Embedded systems, also known as embedded computers, are small-form-factor computers
that power specific tasks.

Following challenges encountered in embedded system designs


1. Computer Design Requirements
2. System-level requirements
3. Life-cycle support
4. Component acquisition
5. Business model
6. Design culture

5.Explain design cycle in the development phase for an embedded system.


Ans:-
6.What are the main components of an embedded system? Give the advantages and application of
embedded system.
Ans:- Applications of Embedded Systems
Robotic science
Medical
Automotive
Networking
Home Devices
Automobiles
Industrial Control

Advantages of Embedded System


• It is able to cover a wide variety of environments
• Less likely to encore errors
• Embedded System simplified hardware which, which reduces costs overall.
• Offers an enhanced performance
• The embedded system is useful for mass production.
• The embedded system is highly reliable

7.Give difference between microprocessor and microcontroller.


Ans:-

8.List and explain Embedded system project Management's four components


Ans:-
10.What do you understand by microcontroller? Explain.
Ans:- A microcontroller is a small and low-cost microcomputer, which is designed to perform the
specific tasks of embedded systems like displaying microwave’s information, receiving remote
signals, etc.

The general microcontroller consists of the processor, the memory (RAM, ROM, EPROM), Serial
ports, peripherals (timers, counters), etc.

Types of Microcontrollers
Microcontrollers are divided into various categories based on memory, architecture,
bits and instruction sets. Following is the list of their types −

Bit
Based on bit configuration, the microcontroller is further divided into three categories.
• 8-bit microcontroller − This type of microcontroller is used to execute
arithmetic and logical operations like addition, subtraction, multiplication
division, etc. For example, Intel 8031 and 8051 are 8 bits microcontroller.
• 16-bit microcontroller − This type of microcontroller is used to perform
arithmetic and logical operations where higher accuracy and performance is
required. For example, Intel 8096 is a 16-bit microcontroller.
• 32-bit microcontroller − This type of microcontroller is generally used in
automatically controlled appliances like automatic operational machines,
medical appliances, etc.

Memory
Based on the memory configuration, the microcontroller is further divided into two
categories.
• External memory microcontroller − This type of microcontroller is designed
in such a way that they do not have a program memory on the chip. Hence, it
is named as external memory microcontroller. For example: Intel 8031
microcontroller.
• Embedded memory microcontroller − This type of microcontroller is
designed in such a way that the microcontroller has all programs and data
memory, counters and timers, interrupts, I/O ports are embedded on the chip.
For example: Intel 8051 microcontroller.

Instruction Set
Based on the instruction set configuration, the microcontroller is further divided into
two categories.
• CISC − CISC stands for complex instruction set computer. It allows the user to
insert a single instruction as an alternative to many simple instructions.
• RISC − RISC stands for Reduced Instruction Set Computers. It reduces the
operational time by shortening the clock cycle per instruction.
Microcontrollers are mainly used in devices like:
• Mobile phones
• Automobiles
• CD/DVD players
• Washing machines
• Cameras
• Security alarms
• Keyboard controllers
• Microwave oven
• Watches
• Mp3 players

11. What is meant by In-circuit emulator?


Ans:- •An in circuit emulator, often called an ICE, is an invaluable software developers tool in
embedded design.
• The processor or microcontroller of the target hardware will be replaced by the ICE.
•Often a smaller part of the emulator, the pod, is put into the hardware, while the main emulator
functionality resides in a box which is connected to the pod with cables.
•An ICE can emulate the replaced processor or uC in real time.
• The developer loads the program into the emulator and can then run, step and trace into it, much
like it is done on PCs.
Many emulators have more advanced features like performance analysis, coverage analysis, a trace
buffer and advanced trigger and possibilities.
•Inside the ICE, or usually on the pod, is a processor of the kind the emulator replaces, or a special
bond-out version of the same chip.
• Bond-out chips have normally internal signals and/or busses bonded out to its legs.
• This is in order to let the ICE, and the developer, get a more complete picture of the status of the
chip.

Unit 4

1.Explain the following directives used in 8051.


i) DB ii) ORG
iii) EQU iv) END
Ans:-DB (define byte)
The DB directive is the most widely used data directive in the assembler. It is used to define the 8-bit
data. When DB is used to define data, the numbers can be in decimal, binary, hex, or ASCII formats.
For decimal, the “D” after the decimal number is optional, but using “B” (binary) and “H”
(hexadecimal) for the others is required. Regardless of which is used, the assembler will convert the
numbers into hex. To indicate ASCII, simply place the characters in quotation marks (‘like this’). The
assembler will assign the ASCII code for the numbers or characters automatically.

Following are some DB examples


ORG (origin)
The ORG directive is used to indicate the beginning of the address. The number that comes after
ORG can be either in hex or in decimal. If the number is not followed by H, it is decimal and the
assembler will convert it to hex. Some assemblers use “. ORG” (notice the dot) instead of “ORG” for
the origin directive. Check your assembler.

EQU (equate)
This is used to define a constant without occupying a memory location. The EQU directive does not
set aside storage for a data item but associates a constant value with a data label so that when the
label appears in the program, itp constant value will be substituted for the label. The following uses
EQU for the counter constant and then the constant is used to load the R3 register.

END directive
Another important pseudocode is the END directive. This indicates to the assembler the end of the
source (asm) file. The END directive is the last line of an 8051 program, meaning that in the source
code anything after the END directive is ignored by the assembler. Some assemblers use “. END”
(notice the dot) instead of “END”.

2. Mention and explain the 8051 flag bits and PSW register.
Ans:- The program status word (PSW) register is an 8-bit register, also known as flag register. It is of
8-bit wide but only 6-bit of it is used. The two unused bits are user-defined flags. Four of the flags
are called conditional flags, which means that they indicate a condition which results after an
instruction is executed. These four are CY (Carry), AC (auxiliary carry), P (parity), and OV (overflow).
The bits RS0 and RS1 are used to change the bank registers. The following figure shows the program
status word register.

The PSW Register contains that status bits that reflect the current status of the CPU.

CY CA F0 RS1 RS0 OV - P

CY PSW.7 Carry Flag


AC PSW.6 Auxiliary Carry Flag

F0 PSW.5 Flag 0 available to user for general purpose.

RS1 PSW.4 Register Bank selector bit 1

RS0 PSW.3 Register Bank selector bit 0

OV PSW.2 Overflow Flag

- PSW.1 User definable FLAG

P PSW.0 Parity FLAG. Set/ cleared by hardware during instruction cycle to indicate even/odd number of 1 bit i
accumulator.

We can select the corresponding Register Bank bit using RS0 and RS1 bits.

RS1 RS2 Register Bank Address

0 0 0 00H-07H

0 1 1 08H-0FH

1 0 2 10H-17H

1 1 3 18H-1FH

• CY, the carry flag − This carry flag is set (1) whenever there is a carry out from the D7 bit. It is
affected after an 8-bit addition or subtraction operation. It can also be reset to 1 or 0
directly by an instruction such as "SETB C" and "CLR C" where "SETB" stands for set bit carry
and "CLR" stands for clear carry.

• AC, auxiliary carry flag − If there is a carry from D3 and D4 during an ADD or SUB operation,
the AC bit is set; otherwise, it is cleared. It is used for the instruction to perform binary
coded decimal arithmetic.

• P, the parity flag − The parity flag represents the number of 1's in the accumulator register
only. If the A register contains odd number of 1's, then P = 1; and for even number of 1's, P =
0.

• OV, the overflow flag − This flag is set whenever the result of a signed number operation is
too large causing the high-order bit to overflow into the sign bit. It is used only to detect
errors in signed arithmetic operations.

3. Write and explain different addressing modes supported by 8051.


Ans:- In 8051 There are five types of addressing modes.
• Immediate AddressingMode
• Register AddressingMode
• Direct AddressingMode
• Register IndirectAddressing Mode
• Indexed AddressingMode

Immediate addressing mode


In this Immediate Addressing Mode, the data is provided in the instruction itself. The data is
provided immediately after the opcode. These are some examples of Immediate Addressing Mode.
MOVA, #0AFH;

Register addressing mode


In the register addressing mode the source or destination data should be present in a register (R0 to
R7). These are some examples of RegisterAddressing Mode.
MOVA, R5;

Direct Addressing Mode


In the Direct Addressing Mode, the source or destination address is specified by using 8-bit data in
the instruction. Only the internal data memory can be used in this mode. Here some of the examples
of direct Addressing Mode.
MOV80H, R6;

Register indirect addressing Mode


In this mode, the source or destination address is given in the register. By using register indirect
addressing mode, the internal or external addresses can be accessed. The R0 and R1 are used for 8-
bit addresses, and DPTR is used for 16-bit addresses, no other registers can be used for addressing
purposes.
MOV@R1, 80H

Indexed addressing mode


In the indexed addressing mode, the source memory can only be accessed from program memory
only. The destination operand is always the register A. These are some examples of Indexed
addressing mode.
MOVCA, @A+PC;
MOVCA, @A+DPTR;

4. Explain architecture of 8051 Microcontroller with the help of neat sketch.


Central Processor Unit (CPU)
As we know that the CPU is the brain of any processing device of the microcontroller. It monitors
and controls all operations that are performed on the Microcontroller units. The User has no control
over the work of the CPU directly.

Interrupts
As its name suggests, Interrupt is a subroutine call that interrupts of the microcontrollers main
operations or work and causes it to execute any other program, which is more important at the
time of operation. The feature of Interrupt is very useful as it helps in case of emergency operations.

Memory
Microcontroller requires a program which is a collection of instructions. This program tells
microcontroller to do specific tasks. These programs require a memory on which these can be saved
and read by Microcontroller to perform specific operations of a particular task. The memory which is
used to store the program of the microcontroller is known as code memory or Program memory of
applications.

BUS
Basically Bus is a collection of wires which work as a communication channel or medium for transfer
of Data. These buses consists of 8, 16 or more wires of the microcontroller. Thus, these can carry 8
bits,16 bits simultaneously. Hire two types of buses that are shown in below
Address Bus
Data Bus

Oscillator
Generally, we know that the microcontroller is a device, therefore it requires clock pulses for its
operation of microcontroller applications. For this purpose, microcontroller 8051 has an on-chip
oscillator which works as a clock source for Central Processing Unit of the microcontroller.

Input/Output Port
Normally microcontroller is used in embedded systems to control the operation of machines in the
microcontroller. Therefore, to connect it to other machines, devices or peripherals we require I/O
interfacing ports in the microcontroller interface.

5. Explain Timer/counter of 8051 in detail.


Ans:- A timer is a specialized type of clock which is used to measure time intervals. A timer that
counts from zero upwards for measuring time elapsed is often called a stopwatch. It is a device that
counts down from a specified time interval and used to generate a time delay, for example, an
hourglass is a timer.

A counter is a device that stores (and sometimes displays) the number of times a particular event or
process occurred, with respect to a clock signal. It is used to count the events happening outside the
microcontroller. In electronics, counters can be implemented quite easily using register-type circuits
such as a flip-flop.

6. Write a short note on :1) CALL Instructions. 2) 8051 Register Banks. 3) 8051 Counter
Ans:- 1) CALL Instructions
The call instruction transfers the program sequence to the memory address given in the operand.
Before transferring, the address of the next instruction after CALL is pushed onto the stack. Call
instructions are 2 types: Unconditional Call Instructions and Conditional Call Instructions.
2) 8051 Register Banks
A total of 32 bytes of RAM are set aside for the register banks and the stack. These 32 bytes are
divided into four register banks in which each bank has 8 registers, R0–R7. RAM locations from 0 to 7
are set aside for bank 0 of R0–R7 where R0 is RAM location 0, R1 is RAM location 1, R2 is location 2,
and so on, until the memory location 7, which belongs to R7 of bank 0.
The second bank of registers R0–R7 starts at RAM location 08 and goes to locations OFH. The third
bank of R0–R7 starts at memory location 10H and goes to location to 17H. Finally, RAM locations
18H to 1FH are set aside for the fourth bank of R0–R7.

3) 8051 Counter
A counter is a device that stores (and sometimes displays) the number of times a particular event or
process occurred, with respect to a clock signal. It is used to count the events happening outside the
microcontroller. In electronics, counters can be implemented quite easily using register-type circuits
such as a flip-flop.

7.

8.Explain the RAM memory space allocation in the 8051


Ans:- The 128 bytes of RAM inside the 8051 are assigned the address 00 to 7FH. They can be
accessed directly as memory locations and are divided into three different groups as follows −
• 32 bytes from 00H to 1FH locations are set aside for register banks and the stack.
• 16 bytes from 20H to 2FH locations are set aside for bit-addressable read/write memory.
• 80 bytes from 30H to 7FH locations are used for read and write storage; it is called as scratch
pad. These 80 locations RAM are widely used for the purpose of storing data and
parameters by 8051 programmers.

9. The difference between. i) LCALL and ACALL ii) LJMP and SJMP
Ans:-
LCALL ACALL
It is also called long call. It is also called absolute call.
target address for LCALL can be anywhere the target address of CALL is within a 2K-byte
within the 64K-bytes address space of the 8051 range.
It is a 3-byte instruction. it is a 2-byte instruction.

LJMP SJMP
It is also called long jump. It is also called short jump.
Long jump range is 64 kb Short jump, relative address is 8 bit it support
127 location forward
It uses 16 bit address It uses 8 bit address
It is a 3 byte instruction It is a 2 byte instruction

Unit 5

1.Explain Interrupt priority in the 8051.


Ans:- We can change the priority levels of the interrupts by changing the corresponding bit in the
Interrupt Priority (IP) register as shown in the following figure.
• A low priority interrupt can only be interrupted by the high priority interrupt, but not
interrupted by another low priority interrupt.
• If two interrupts of different priority levels are received simultaneously, the request of
higher priority level is served.
• If the requests of the same priority levels are received simultaneously, then the internal
polling sequence determines which request is to be serviced.

- IP.6 Reserved for future use.

- IP.5 Reserved for future use.

PS IP.4 It defines the serial port interrupt priority level.

PT1 IP.3 It defines the timer interrupt of 1 priority.

PX1 IP.2 It defines the external interrupt priority level.

PT0 IP.1 It defines the timer0 interrupt priority level.

PX0 IP.0 It defines the external interrupt of 0 priority level.

2.Discuss the concept of Interrupt Vs. polling.


Ans:-

3.Explain the following register of 8051 used for serial communication. i) SBUF ii) SCON.
Ans:- SBUF register
SBUF is an 8-bit register used solely for serial communication in the 8051. For a byte of data to be
transferred via the TxD line, it must be placed in the SBUF register. Similarly, SBUF holds the byte of
data when it is received by the 8051 ‘s RxD line. SBUF can be accessed like any other register in the
8051. Look at the following examples of how this register is accessed:

The moment a byte is written into SBUF, it is framed with the start and stop bits and transferred
serially via the TxD pin. Similarly, when the bits are received serially via RxD, the 8051 deframes it by
eliminating the stop and start bits, making a byte out of the data received, and then placing it in the
SBUF.

SCON (serial control) register


The SCON register is an 8-bit register used to program the start bit, stop bit, and data bits of data
framing, among other things.
The following describes various bits of the SCON register.

4.Explain serial port control register with proper diagram.


Ans:-

• Mode 0:

o In this mode the serial port function as half duplex serial port with fixed baud rate.
o The 8- bit serial data is received and transmitted through RxD pin and the controller output the

shift clock through TxD pin during reception and transmission.

o The baud rate is fixed at 1 / 12 of the oscillator frequency.

• Mode 1:

o In this mode the serial port function as full duplex serial port with variable baud rate.

o In this mode one data consists of 10 bits, which includes one start bit, eight data bit and one stop

bit. During reception the stop bit is stored as RB8 in SCON register.

o Baud rate in mode-1 depends on the value of SMOD bit in PCON register and the timer1overflow
rate.

• Mode 2:

o In this mode the serial port function as full duplex serial port with a baud rate of either 1/32 or

1/64 of the oscillator frequency.

o In this mode one data consists of 11 bits which includes one start bit, eight data bit, a

programmable 9th data bit and one stop bit.

o During transmission the TB8 of SCON register is added as 9th data bit and during reception the

9th data bit is stored as RB8 in SCON register.

o The baud rate depends on the value of SMOD bit in PCON register.

• Mode 3:

o The mode-3 is same as mode-2, except the baud rate.

o In mode-3, the baud rate is variable. The baud rate depends on the value of SMOD bit in PCON

register and the timer- 1 overflow rate.

• The serial mode bit-2 (SM2) has no effect in mode-0 and when programmed for mode-0, the

SM2 should be equal to zero.

• In mode-1, SM2 is used to check a valid stop bit during reception. In mode-1, if SM2 = 1, then

receive interrupt (RI) is activated only when a valid stop bit is received.

• In mode-2 and mode-3 the SM2 bit is used to enable multiprocessor communication.

• In multiprocessor communication the serial port of a number of microcontrollers can be

connected to a common serial bus. One controller will act as a master and all other controller will

act as slave.

• A unique 8-bit address is assigned to each slave and the SM2 bit in all the slaves is set to 1.

• When SM2 bit is one, the slaves will consider the received byte as address and when SM2 bit is
zero the slaves will consider the received byte as data.

• For communication with a slave the master will first send as address byte and then a data byte.

• The master initiates communication with a slave by sending the address of the slave on the bus.

All the slaves will receive the address byte. Since SM2 = 1 initially in all the slaves, the received byte

will be considered as address and the slaves will verify whether the received address matches with

assigned address. The slave whose assigned address matches with received address will clear its

SM2 bit. Now SM2 bit of only one of the slave will be zero.

• Next the master will send a data byte which is also received by all the slave, but the data byte is

accepted by the slave whose SM2 = 0 and so the receive interrupt is activated only in one of the

slave whose SM2 = 0.

• After reading the received data from SBUF register, the SM2 bit of the slave should be set to one

again to receive next data.

• The REN bit of SCON register can be used to enable or disable the serial reception. When REN =

1, the serial reception is enabled and when REN = 0, the serial reception is disabled.

• The bits TI and RI of SCON register are transmitting interrupt flag and receive interrupt flag

respectively.

• The controller will set the TI bit during the transmission of stop bit of a data character in mode 1

to 3 and during the transmission 0 bit of a data character in mode-0.

• The controller will set the RI bit during the reception of stop bit of a data character in mode 1 to

3 and during the reception of 8th bit of a data character in mode- 0.

5. Write a program for the 8051 to transfer letter "A" serially at 4800 baud, continuously.
Unit 2
1. What is priority inversion problem in RTOS?
Ans:- Priority inversion is a operating system scenario in which a higher priority process is
preempted by a lower priority process. This implies the inversion of the priorities of the two
processes.
Problems due to Priority Inversion
Some of the problems that occur due to priority inversion are given as follows −
• A system malfunction may occur if a high priority process is not provided the required
resources.
• Priority inversion may also lead to implementation of corrective measures. These may
include the resetting of the entire system.
• The performance of the system can be reduces due to priority inversion. This may happen
because it is imperative for higher priority tasks to execute promptly.
• System responsiveness decreases as high priority tasks may have strict time constraints or
real time response guarantees.
• Sometimes there is no harm caused by priority inversion as the late execution of the high
priority process is not noticed by the system.
Solutions of Priority Inversion
Some of the solutions to handle priority inversion are given as follows −

• Priority Ceiling

All of the resources are assigned a priority that is equal to the highest priority
of any task that may attempt to claim them. This helps in avoiding priority
inversion.

• Disabling Interrupts

There are only two priorities in this case i.e. interrupts disabled and preemptible.
So priority inversion is impossible as there is no third option.

• Priority Inheritance

This solution temporarily elevates the priority of the low priority task that is
executing to the highest priority task that needs the resource. This means that
medium priority tasks cannot intervene and lead to priority inversion.

• No blocking

Priority inversion can be avoided by avoiding blocking as the low priority task
blocks the high priority task.

• Random boosting

The priority of the ready tasks can be randomly boosted until they exit the critical
section.
2.Write short note on of the following: 8 i) Semaphores ii) ii) Pipes
Ans:-
3. What is meant by task? Describe different states of task.
Ans:-
4.Explain mailbox functions and give different types of mailbox.
Ans:-
5. The following routines are called by Task A,B and C, but they don't work. How would you fix the
problem? Static int iRecordCount;
Void increment_records (int iCount)
{
OSSemGet (SEMAPHORE_PLUS);
iRecordCount + = iCount;
}
Void decrement_records (int iCount)
{
iRecordCount - = iCount;
OSSemGive (SEMAPHORE _ MINUS)
}
Ans:- . The following routines are called by Tasks A, B, and C, but they don't work. How would you fix
the problems?
static int i RecordCount;
void increment_records (int i Count)
{
OS SemGet (SEMAPHORE_PLUS);
i RecordCount +- iCount;
}
void decrement_records (int i Count)
{
i RecordCount i Count; OSSemGive (SEMAPHORE_MINUS):
)

6. Write a short note on Mutex.


Ans:- Mutex is a mutual exclusion object that synchronizes access to a resource. It is created with a
unique name at the start of a program. The Mutex is a locking mechanism that makes sure only one
thread can acquire the Mutex at a time and enter the critical section. This thread only releases the
Mutex when it exits the critical section.

This is shown with the help of the following example −


wait (mutex);
…..
Critical Section
…..
signal (mutex);
A Mutex is different than a semaphore as it is a locking mechanism while a semaphore is a signalling
mechanism. A binary semaphore can be used as a Mutex but a Mutex can never be used as a
semaphore.

Unit 3
1. How real time operating system differs from a normal operating system ?
Ans:-
RTOS stands for Real-Time Operating System whereas OS stands for Operating System.
1. A real-time operating system (RTOS) specializes in extremely quick reaction times, whereas a
traditional operating system (OS) concentrates on sequentially computing throughout the
whole array of processes.
2. RTOS is user and commands specific whereas an OS is generally used by everyone for daily
processes.
3. An RTOS uses a sophisticated scheduling algorithm, whereas a regular OS uses a standard
approach to solve tasks sequentially.
4. Some examples of RTOS include; Vx works, QNX, RTLinux, etc whereas examples of OS
include; macOS, Windows, ChromeOS, and android too.

2. Explain Real time operating system (RTOS) services in detail.


Ans:-
3.Digital Camera.
Ans:-
4.Give the detail study and discuss about chocolate vending manchine.
Ans:- 1.Alphanumeric keypad on the top of the machine.
2.A child interaction with it when buying a chocolate.
3.Owner commands and interaction with the machine.
4.Three line LCD display unit on the top of the machine.
5.Displays menus, entered text, pictograms, and welcome, thank and other messages, and time and
date.
6.Child as well as the ACVM owner GUIs with the machine using keypad and display.
7.Coin insertion slot so that the child can insert the coins to buy a chocolate.
8.Delivery slot to collect the chocolate,and coins if refunded.
9.Internet connection port so that owner can interact with ACVM from remote.
5. Give the detail description of I/O subsystems.
Ans:-
Unit 6
1. Write a program that continuously gets 8-bit of data from P0 to send it to P1 while simultaneously
creating a square wave of 200 s period on pin P2.1. Use timer 0 to create square wave XTAL =
11.0592 MHz.
Ans:-
2.Explain steps to execute an interrupt.
• Ans:- The microcontroller closes the currently executing instruction and saves the address of
the next instruction (PC) on the stack.
• It also saves the current status of all the interrupts internally (i.e., not on the stack).
• It jumps to the memory location of the interrupt vector table that holds the address of the
interrupts service routine.
• The microcontroller gets the address of the ISR from the interrupt vector table and jumps to
it. It starts to execute the interrupt service subroutine, which is RETI (return from interrupt).
• Upon executing the RETI instruction, the microcontroller returns to the location where it was
interrupted. First, it gets the program counter (PC) address from the stack by popping the
top bytes of the stack into the PC. Then, it start to execute from that address.

3. Give the interfacing of LCD to the 8051. Explain in detail.


Ans:-
4. Generate the sine wave as an example of interfacing A DAC to the 8051. Explain in detail.
Ans:-
5.Explain basic idea of 8051 interfacing the keyboard to 8051 and also draw the flowchart for
detection and identification of key activation.
Ans:-
6.Draw and explain interfacing a DAC to the 8051.
Ans:-
7.Draw and explain 8051 interfacing to the keyboard.
Ans:-

You might also like