CS3691 Important Questions

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 10

CS3691-EMBEDDED-SYSTEM-AND-IOT

UNIT 1 : 8 BIT EMBEDDED PROCESSOR

8-Bit Microcontroller – Architecture – Instruction Set and Programming – Programming Parallel Ports –
Timers and Serial Port – Interrupt Handling.

Important questions

PART – A
1. Define microcontroller ? and its applications.
A microcontroller is a compact integrated circuit designed to govern a specific operation in an
embedded system. A typical microcontroller includes a processor, memory and input/output (I/O)
peripherals on a single chip.
Application of Microcontroller
Light sensing & controlling devices.

 Temperature sensing and controlling devices.
 Fire detection & safety devices.
 Industrial instrumentation devices.
 Process control devices.
2. Define 8051 microcontroller ? and its applications.
8051 microcontroller is designed by Intel in 1981. It is an 8-bit microcontroller. It is built with 40
pins DIP (dual inline package), 4kb of ROM storage and 128 bytes of RAM storage, 2 16-bit
timers.
3.Compare : microprocessor and microcontroller?[ NOV / DEC 2021]
S.NO Microprocessor Microcontroller

1.
Microprocessor is the heart of Micro Controller is the heart of an
Computer system. embedded system.

2. It is only a processor, so memory and Micro Controller has a processor along


I/O components need to be connected with internal memory and I/O
externally components.
3.
Memory and I/O has to be connected Memory and I/O are already present, and
externally, so the circuit becomes large. the internal circuit is small.

4.Which register has the SMOD bit, and what is its status when the 8051 is powered up?. [NOV /
DEC 2021]
It is 8-bit register. When 8051 is powered up, SMOD is zero.By setting the SMOD, baud rate
can be doubled. If SMOD = 0 (which is its value on reset), The SMOD Bit in the PCON Register is used
to control the Baud Rate of the Serial Port. There are two general purpose Flag Bits in the PCON Register, which can
be used by the programmer during execution.

5.Give the format of the register PSW of 8051 and name each it .[ NOV / DEC 2019]
6.Define the operating model 0 of 8051 serial ports.?[ NOV / DEC 2020 AND APRIL /
MAY 2021]
Mode 0: In this mode, the serial port works like a shift register and the data transmission works
synchronously with a clock frequency of fosc /12. Serial data is received and transmitted through
RXD. 8 bits are transmitted/ received at a time.

7.which register is used for serial programming in 8051 ? Illustrate it


SBUF register:
SBUF is an 8-bit register used for serial communication in the 8051 microcontrollers. For a byte
of data to be transferred via the transmitted line, it must be placed in the SBUF Register.
8. Write a program to find the 2’s complement using 8051? [ NOV / DEC 2020 AND APRIL / MAY
2021]
2000 LHLD 3000H 2A Load HL pair
data from 3000h
2001 00
2002 30
2003
2004 MOV A,L 7D Move the low-order
result from reg.A TO Reg.L
2005 MOV L,A 6F Move the result
from reg.L TO Reg.A
2006 MOV A,H 7C Move the higher order
from reg.H to reg.A
2007 CMA 2F compliment accumulator
2008 MOV H,A 67 Move the result
from reg.A TO Reg.H
2009 INX H 23 Increment HL pair to
find 2’s compliment
200A SHLD 3002H 22 Store the result
at address 3002H
200B 02
200C 30
200D HLT 76 HALT
OUTPUT:
1. Before execution:
2. 3000H:12H
3. 3001H:05H
4. After execution:
5. 3002H:EEH
6. 3003H:FAH

9 . What are the interrupts of 8051? And high light any two functions ? [ NOV / DEC 2019,
APR / MAY 2019]

Let's see the five sources of interrupts in 8051 Microcontroller:


 Timer 0 overflow interrupt - TF0.
 External hardware interrupt - INT0.
 Timer 1 overflow interrupt - TF1.
 External hardware interrupt - INT1.
 Serial communication interrupt - RI/TI.
 Timer 0 overflow interrupt - TF0.
 The TF0 bit is automatically set to 1 when Timer 0 overflows. Your code can read the TF0 bit at any
time to find out if the timer has overflowed. You can also configure the Timer 0 interrupt to
automatically execute code when the timer overflows.
 TF1: The TF1 stands for 'timer1' flag bit. Whenever calculating the time-delay in timer1, the TH1
and TL1 reaches to the maximum value that is “FFFF” automatically. EX: while (TF1==1)
Whenever the TF1=1, then clear the flag bit and stop the timer.
10. list the 8051 interrupts with its priority? [APR / MAY 2017]
Priority to the interrupt can be assigned by using the interrupt priority register (IP)
Priority Interrupt source Intr. bit / flag
1 External Interrupt 0 INT0
2 Timer Interrupt 0 TF0
3 External Interrupt 1 INT1
4 Timer Interrupt 1 TF1
5 Serial interrupt (TI/RI)

11. Explain the interrupts of 8051 microcontroller ?[ NOV / DEC 2019]


INTERRUP INTERRUPT INTERRUPT EXPLANATION
T NUMBER DSECRIPTION
0 &2 External hardware These interrupts can be programmed to either edge-
interrupt - INT0 & triggered or level triggered
INT1

1 Timer 0 overflow The TF0 bit is automatically set to 1 when Timer 0


interrupt - TF0. overflows. Your code can read the TF0 bit at any time to
find out if the timer has overflowed. You can also
configure the Timer 0 interrupt to automatically execute
code when the timer overflows.
3 Timer 1 overflow TF1: The TF1 stands for 'timer1' flag bit. Whenever
interrupt - TF1. calculating the time-delay in timer1, the TH1 and TL1
reaches to the maximum value that is “FFFF”
automatically. EX: while (TF1==1) Whenever the
TF1=1, then clear the flag bit and stop the timer.

4 Serial When the last bit (stop bit) of a byte is transmitted, the
communication TI serial interrupt flag is set, and when the last bit (stop
interrupt - RI/TI bit) of the receiving data byte is received, the RI flag
gets set.

12.How does 8051 differentiate between bit and byte addresses in its internal ram ? [ NOV
/ DEC 2019] .
The 8051 has a bit-addressable area of 16 bytes from byte addresses 20H to 2FH in internal
RAM as shown in fig b, forming a total of 128 addressable bits (i.e., 16-byte location × 8 bits).
Each bit can be accessed by its bit addresses from 00H to 7FH for the byte address location 20H
to 2FH in RAM.
13.Give the format and list the function of the instruction DJNZ for 8051. [ NOV / DEC 2019,
APR / MAY 2017]
An instruction DJNZ reg, label is used to perform a Loop operation. In this instruction, a register
is decremented by 1; if it is not zero, then 8051 jumps to the target address referred to by the
label. The register is loaded with the counter for the number of repetitions prior to the start of the
loop.

14. Explain the operating mode 0 of 8051 ports. [ MAY / JUNE 2016]
Mode 0: In this mode, the serial port works like a shift register and the data transmission works
synchronously with a clock frequency of fosc /12. Serial data is received and transmitted through
RXD. 8 bits are transmitted/ received at a time.

15.List features of 8051 microcontroller? [ MAY / JUNE 2016]


 4KB bytes on-chip program memory (ROM)
 128 bytes on-chip data memory (RAM)
 Four register banks.
 128 user defined software flags.
 8-bit bidirectional data bus.
 16-bit unidirectional address bus.
 32 general purpose registers each of 8-bit.
 16 bit Timers (usually 2, but may have more or less).
16.what is the significance of EA and PSEN pin in 8051 microcontroller? [NOV / DEC 2019]
Pin 29 − This is PSEN pin which stands for Program Store Enable. It is used to read a signal
from the external program memory. Pin 30 − This is EA pin which stands for External
Access input. It is used to enable/disable the external memory interfacing.

17 . List the advantages and disadantages of parallel communication over serial


communication in 8051? [ MAY / JUNE 2016].
Serial mode offers the advantage of fewer traces on the pc board, and fewer pins on the
devices. Parallel offers the advantage of transferring 8 data bits per I/O clock cycle, but at the
disadvantage of many more pins required on the devices.
18. Define baud rate of 8051? [ MAY / JUNE 2016].
Baud Rate is defined as the data transmission rate that determines the symbols per second
for serial communication. It is the number of symbols transmitted per second. It is also
known as symbol rate and is denote by s
baud rate in 8051 is 11.0592 MHz
19. Which port is used as multi function port ? [APR / MAY 2017]
Pins 10 to 17 form the PORT 3 pins of the 8051 Microcontroller. PORT 3 also acts as a
bidirectional Input / Output PORT with internal pull-ups. Additionally, all the PORT 3 Pins have
special functions multifunctional for the 8051 microcontrollers. The port 3 signal are (RXD),
(TXD),(INTO),(INT1),T0,T1,(RD),(WR)
20.Difference between maskable and nonmaskable interrupt ? [NOV / DEC 2019]
Maskable interrupt is a hardware Interrupt that can be disabled or ignored by the instructions of
CPU. A non-maskable interrupt is a hardware interrupt that cannot be disabled or ignored by the
instructions of CPU
21.Illustrate cjne instruction?[APRIL / MAY 2017]
The CJNE instruction compares the first two operands and branches to the specified destination if
their values are not equal. If the values are the same, execution continues with the next instruction.
22.Draw the pin diagram of 8051 ? [NOV/DEC 2019]

23. What are bit manipulation instructions give two examples ?[ APRIL / MAY 2017]
The bit related operations that will be performed on that data, are as follows −
 Complement bit b2
 Move b5to b4
 OR b0and complement of b1 and store to C (b7)
 Set b6
 Reset bit b3
Input is AEH
BitPosition b7 b6 b5 b4 b3 b2 b1 b0

Value 1 0 1 0 1 1 1 0
Output
BitPosition b7 b6 b5 b4 b3 b2 b1 b0

Value 0 1 1 1 0 0 1 0
The output will be 72H
Program
MOV24H,10H;Copy item from 10H to 24H
CPL24.2;Complement bit b2
MOVC,24.5;Copy b5 to C
MOV24.4,C;Move C to b4
MOVC,24.0;Make copy of b0 to C
ORLC,/1;OR C and complement of b1
SETB24.6;Set bit b6
CLR24.3;Reset bit b3
MOV30H,24H; Store the result at 30H
HALT: SJMP HALT

24. What is the different modes in which timer 2 can operate?


The Mode 2 operation is the 8-bit auto reload timer or counter. In the following diagram, we are
using Mode 2 for Timer1. In this case every event for counter operations or machine cycles for timer
operation, the TL1register will be incremented by 1.

25.list the modes of timer in 8051?

In Intel 8051, there are two 16-bit timer registers. These registers are known as Timer0
andTimer1. The timer registers can be used in two modes. These modes areTimer mode and the
Counter mode.

26. state how baud rate is calculated for searial adta transfer in mode 1? [NOV/DEC 2019]
Serial data is received and transmitted through RXD. 8 bits are transmitted/ received at a time. Pin
TXD outputs the shift clock pulses of frequency fosc /12, which is connected to the external
circuitry for synchronization. The shift frequency or baud rate is always 1/12 of the oscillator
frequency.

27. how to program 8051 timers?


Load the TMOD value register indicating which timer (Timer 0 or Timer 1) is to be used and
which timer mode ( 0 or 1 ) is selected. 2. Load registers TL and TH with initial count values 3.
Start the timer.

28.Differnce between Timer and counter ?draw the diagram of TCON in 8051? [NOV/DEC
2019]
S.no TIMER COUNTER
1 A timer uses the frequency of the A counter uses an external signal to count
internal clock, and generates delay. pulses.
2 These enable to precisely time A counter converts the number of input cycles
processes, generate signals and to a binary value using an array of triggers.
count events
29. what is the significance if EA pin
Pin 30 − This is EA pin which stands for External Access input. It is used to enable/disable
the external memory interfacing. Pin 31 − This is ALE pin which stands for Address Latch
Enable. It is used to demultiplex the address-data signal of port.

PART –B
1. Explain the Block diagram of 8051 ? or Explain the architecture of 8051? [MAY/ JUNE
2016 , NOV / DEC 2016, NOV / DEC 2017 ,APRIL/ MAY 2018, , NOV / DEC 2021,
APRIL/ MAY 2018, APRIL/ MAY 2021,]
2. What are the vectored interrupt of 8051? [ NOV / DEC 2019]
3. Explain the Data transfer , Arithmetic and branch instructions with examples . [MAY/
JUNE 2019].
4. Explain the Serial Port Programming with examples .[MAY/ JUNE 2016] (or). Ilustrate
the serial communication in 8051 , with its special function register.
[ NOV / DEC 2017]
5. Describe the different modes of operation of Timer/Counter in 8051 with its associated
registers (or)Explain the timer modes of 8051 microcontroller ? [NOV / DEC 2016,
APRIL/ MAY 2017,APRIL/ MAY 2018, NOV / DEC 2019].
(Or) Illustrate the options available with Timer Mode (TMOD) register of 8051.
[ NOV / DEC 2021]
6. Discuss the ports and its circuits of 8051 ?[ NOV / DEC 2017]
7. List the various instructions available in 8051 microcontroller. [APRIL/ MAY 2021,
NOV / DEC 2017]

8. For microcontroller discuss the following :


a) How RAM is organized and addressed ?
b) How many register banks are present in RAM and how is bank switching executed
? [NOV / DEC 2019]
UNIT 2- EMBEDDED C PROGRAMMING
Memory And I/O Devices Interfacing – Programming Embedded Systems in C – Need For RTOS – Multiple
Tasks and Processes – Context Switching – Priority Based Scheduling Policies.

PART-A

1. What is embedded C programing?

Embedded C is an extension of C language and it is used to develop micro-controller-based


applications. The extensions in the Embedded C language from normal C Programming Language
are the I/O Hardware Addressing, fixed-point arithmetic operations, accessing address spaces, etc..

2, Define memory device interfacing?

Memory Interface means an interface, or portion thereof, between a logic integrated circuit and a
memory integrated circuit, whereby interface shall mean an electrical bus or other similar
information path between integrated circuits that is capable of transmitting and/or receiving
information between two or more.
3. Define I/O device interfacing

I/O interfaces are the mediums in which data are sent from internal logic to external sources and from
which data are received from external sources. The interface signals can be unidirectional or
bidirectional, single-ended or differential and could follow one of the different I/O standards.
4. Define Watch dog ?

A watchdog timer (WDT) is a timer that monitors microcontroller (MCU) programs to see if they are
out of control or have stopped operating. It acts as a “watchdog” watching over MCU operation.
5. List the advantages and limitations of Priority based process scheduling. [NOV/DEC 2017]

S.NO ADVANTAGES DISADVANTAGES

1. Good way to ensure processes with Processes with lower priority may be
higher priorities are handled first starved

2. Good when the resources are limited Difficult to objectively decide which
and priorities for each process are processes are given higher priority
defined beforehand

6.Define context switching in RTOS ? [APR/MAY 2018]

Context Switching involves storing the context or state of a process so that it can be reloaded
when required and execution can be resumed from the same point as earlier. This is a feature of a
multitasking operating system and allows a single CPU to be shared by multiple processes
7. List the memory devices used in the design of embedded system ?or What are the memory
devices used in the design of embedded system ? [NOV/DEC 2018, NOV/DEC 2017]]
Types of Memory , Volatile Memory, Random Access Memory (RAM) Static Random Access
Memory (SRAM) , Dynamic Random Access Memory (DRAM), Non-volatile memory. EEPROM, .
Flash memory ,SD card.
8. How does priority scheduling improve multitask execution ? [APR/MAY 2019]
Following are the benefits of priority scheduling method:
1. Easy to use.
2. Processes with higher priority execute first which saves time.
3. The importance of each process is precisely defined.
4. A good algorithm for applications with fluctuating time and resource requirements.

10.What is the concept of multitasking ?what does it signify . [NOV/DEC 2018]


Multitasking, the running of multiple programs (sets of instructions) in one computer at the same
time. Multitasking is used to keep all of a computer's resources at work as much of the time as
possible .
signify :
Multitasking is the act of doing more than one thing at the same time. Multitasking helps you save
time and money in some cases, though trying to do more than one challenging task at a time may also
decrease overall productivity.
12.What are the basic types of memory components that are commonly used in embedded
systems ? [NOV/DEC 2019]
The main types involved in embedded systems are primary and secondary memory. The primary
memory involves RAM which is a data memory and secondary memory involves an program memory
called ROM. Data memory is classified as SRAM DRAM and SDRAM..

11.Bring out the difference between multiple process and multiple task ? [NOV/DEC 2019]
S.N
O
Multi-tasking Multiprocessing
The availability of more than one processor per
system, that can execute several set of
The execution of more than one task instructions in parallel is known as
1. simultaneously is known as multitasking. multiprocessing.
2. The number of CPU is one. The number of CPUs is more than one.
3. In this, one by one job is being executed at In this, more than one process can be executed
a time. at a time.

13.Define Embedded Programming? [APR/MAY 2019]


An embedded programming language is a programming language that developers use in embedded
systems. In general, the languages offer low-level access to the device hardware. Developers use several
common programming languages for embedded systems. Some people also call these embedded coding
languages.
14. What is RTOS ?
An RTOS will often be used when there are more interrupt sources, more functions, and more standard
communications interfaces that need to be supported. If the application is <64KB in size, an RTOS is not
necessary. Conversely if, the applications is 1 MB, an RTOS will likely be used.
15.Define multitasking.
Multitasking is the process of scheduling and switching the CPU between several tasks. A
single CPU switches its attention between several sequential tasks.
It maximizes the utilization of the CPU and also provides modular construction of
application.
16. . What are the application of RTOS?
A Real time operating system is a multitasking operating system for response
time controlled and event controlled process which has real time programming .
17.. When RTOS necessary and when it is not necessary in the Embedded system?
An RTOS is necessary when scheduling of Multilpe processors
An RTOS is must to monitor the processors that are response controlled and event
controlled processors.

18. What is Variable Scope?

Variables in C programming language, which Arduino uses, have a property called scope. A scope
is a region of the program and there are three places where variables can be declared
19. What are Arduino – Operators?
An operator is a symbol that tells the compiler to perform specific mathematical or logical functions. C
language is rich in the following types of operators −
• Arithmetic Operators
• Comparison Operators
• Boolean Operators
• Bitwise Operators
• Compound Operators

20. Define Sketch.

. A sketch is the name that Arduino uses for a program. It's the unit of code that is uploaded to and
run on an Arduino board.

PART-B

1. Explain about I/O Devices,Timers and Counters, Watchdog Timers APR/MAY


2017]
2. Explain in detail about earliest deadline first scheduling ? [APR/MAY 2017]
3. Compare RMS and EDF ? [NOV / DEC 2018]
4.Explain the context switching mechanism for moving the CPU from one executing
process to another with an example ? [NOV / DEC 2019]
5.Briefly explain the Multiple Tasks and Processes?
6.Explain the Priority Based Scheduling Policies?
7.Describe the Programming Embedded Systems in C .

8. Briefly explain the Multiple Tasks and Processes?


9.Explain the Priority Based Scheduling Policies?
10. Describe the Programming Embedded Systems in C ?

You might also like