MAHARASHTRA STATEBOARD OF TECHNICAL EDUCATION (Autonomous) (ISO/IEC - 27001 - 2005 Certified) Winter – 14 EXAMINATION Subject Code: 12262 Model Answer Page 1/ 23 Important Instructions to examiners: 1) The answers should be examined by key words and not as word-to-word as given in the model answer scheme. 2) The model answer and the answer written by candidate may vary but the examiner may try to assess the understanding level of the candidate. 3) The language errors such as grammatical, spelling errors should not be given more Importance (Not applicable for subject English and Communication Skills. 4) While assessing figures, examiner may give credit for principal components indicated in the figure. The figures drawn by candidate and model answer may vary. The examiner may give credit for any equivalent figure drawn. 5) Credits may be given step wise for numerical problems. In some cases, the assumed constant values may vary and there may be some difference in the candidate‟s answers and model answer. 6) In case of some questions credit may be given by judgement on part of examiner of relevant answer based on candidate‟s understanding. 7) For programming language papers, credit may be given to any other program based on equivalent concept. 1. A. Attempt any THREE of the following: (12 M) (i) State the function of , , XTAL1 pins in 8051. Ans:- ( Each function 1 marks ) 1) PSEN (bar) : Program store enable it is active low O/P signal. It is used to enable external program memory (ROM). When [PSEN(bar)]= 0, then external program memory becomes enabled and microcontroller read content of external memory location. Therefore it is connected to (OE) of external ROM. It is activated twice every external ROM memory cycle. 2)EA(bar):External enable It is and active low I/P to 8051 microcontroller. When (EA)= 0, then 8051 microcontroller access from external program memory (ROM) only. When (EA) = 1, then it access internal and external program memories (ROMS). 3) and 4) XTAL1 and XTAL2 These are two I/P line for on-chip oscillator and clock generator circuit. A resonant network as quartz crystal is connected between these two pin. 8051 microcontroller also drives from external clock, then XTAL2 is used to drive 8051 from external clock and XTAL1 should be grounded. (ii) Write formula to generate variable baud rate. Which timer is used in which mode for it? Ans:- (formula : 2 mark , timer mode : 2marks , example can be given –not mandatory) Timer1- is used to generate baud rate for mode-1 serial communication by using overflow flag of the timer to determine the baud frequency. Timer-1 is used in timer mode 2 as an auto-reloaded 8-bit timer. The data rate is generated by timer-1 using the following formula fbaud = x
23
Embed
MAHARASHTRA STATEBOARD OF TECHNICAL …msbte.com/model_answer/w14/model_answer_lot3/12262.pdf · When (EA)= 0, then 8051 microcontroller access from external program memory ... 0
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
MAHARASHTRA STATEBOARD OF TECHNICAL EDUCATION (Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Winter – 14 EXAMINATION
Subject Code: 12262 Model Answer Page 1/ 23
Important Instructions to examiners:
1) The answers should be examined by key words and not as word-to-word as given in the
model answer scheme.
2) The model answer and the answer written by candidate may vary but the examiner may try
to assess the understanding level of the candidate.
3) The language errors such as grammatical, spelling errors should not be given more
Importance (Not applicable for subject English and Communication Skills.
4) While assessing figures, examiner may give credit for principal components indicated in the
figure. The figures drawn by candidate and model answer may vary. The examiner may give credit for any
equivalent figure drawn.
5) Credits may be given step wise for numerical problems. In some cases, the assumed constant
values may vary and there may be some difference in the candidate‟s answers and model answer.
6) In case of some questions credit may be given by judgement on part of examiner of relevant answer based
on candidate‟s understanding.
7) For programming language papers, credit may be given to any other program based on equivalent
concept.
1. A. Attempt any THREE of the following: (12 M)
(i) State the function of , , XTAL1 pins in 8051.
Ans:- ( Each function 1 marks )
1) PSEN (bar) : Program store enable it is active low O/P signal. It is used to enable external
program memory (ROM).
When [PSEN(bar)]= 0, then external program memory becomes enabled and
microcontroller read content of external memory location.
Therefore it is connected to (OE) of external ROM.
It is activated twice every external ROM memory cycle.
2)EA(bar):External enable
It is and active low I/P to 8051 microcontroller. When (EA)= 0, then 8051 microcontroller
access from external program memory (ROM) only.
When (EA) = 1, then it access internal and external program memories (ROMS).
3) and 4)
XTAL1 and XTAL2
These are two I/P line for on-chip oscillator and clock generator circuit.
A resonant network as quartz crystal is connected between these two pin.
8051 microcontroller also drives from external clock, then XTAL2 is used to drive 8051 from
external clock and XTAL1 should be grounded.
(ii) Write formula to generate variable baud rate. Which timer is used in which mode for
it?
Ans:- (formula : 2 mark , timer mode : 2marks , example can be given –not mandatory)
Timer1- is used to generate baud rate for mode-1 serial communication by using overflow
flag of the timer to determine the baud frequency. Timer-1 is used in timer mode 2 as an
auto-reloaded 8-bit timer. The data rate is generated by timer-1 using the following formula
fbaud= x
MAHARASHTRA STATEBOARD OF TECHNICAL EDUCATION (Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Winter – 14 EXAMINATION
Subject Code: 12262 Model Answer Page 2/ 23
where,
SMOD is the 7th
bit of PCON register
If timer1 is not run in mode 2, then baud rate is,
fbaud= X (timer1 overflow frequency)
timer 1 can be run using the internal clock, fosc/12 (timer mode ) or from any external source via pin T1
(P3.5) (counter mode)
example:
if a standard baud rate is desired, then 11.0592 MHZ crystal could be selected. To get a standard 9600 baud
rate, then assuming SMOD to be „0‟
9600= X
Or
256-TH1= X = 3
Or
TH1= 256-3 = FDH
In mode1, if SM2 is set to 1, no receive interrupt (RI) is generated unless a valid stop bit is received.
(iii) Draw the pin out of RS232.
Ans:- (2 marks for pin diagram and 2 marks for name of pins)
MAHARASHTRA STATEBOARD OF TECHNICAL EDUCATION (Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Winter – 14 EXAMINATION
Subject Code: 12262 Model Answer Page 3/ 23
(iv) Define Simulator & Debugger.
Ans:- Simulators:- (2 marks)
A simulator is the s/w that simulates a h/w unit like emulator, peripheral, network and I/O
devices on a PC .
It defines a processor or processing device as well as various versions for the target system
Monitors the detailed information of as source code part with labels and symbols during the
execution for each single step.
Provides the detailed information of the status of memory RAM and simulated ports,
simulated peripheral devices of the defined target system
Debugger: (2 marks)
A Debugger allows you to download your code to the emulator's memory and then control
all of the functions of the emulator from a PC. Common debugging features include the
capability to examine and modify the microcontroller's on-chip registers, data- and
program-memory; pausing or stopping program executing at defined program locations by
setting breakpoints; single-stepping (execute one instruction at a time) through the code;
and looking at a history of executed code (trace).
(B) Attempt any ONE of the following: (6 M)
(i) Draw structure of internal RAM of 8051 & Show how to select register bank.
(Internal RAM structure: 4 marks, bank selection table: 2 marks)
OR
Register selection table:
PSW format
MAHARASHTRA STATEBOARD OF TECHNICAL EDUCATION (Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Winter – 14 EXAMINATION
Subject Code: 12262 Model Answer Page 4/ 23
(ii) Write an assembly or C language program to send ‘YES’ on TXD LINE OF 8051.
MAHARASHTRA STATEBOARD OF TECHNICAL EDUCATION (Autonomous)
(ISO/IEC - 27001 - 2005 Certified)
Winter – 14 EXAMINATION
Subject Code: 12262 Model Answer Page 21/ 23
Data inconsistency:
When shared resources are modified at the same time by multiple resources, data errors or inconsistencies
may occur. Sections of a program that might cause these problems are called critical sections. Failure to
coordinate access to a critical section is called a race condition because success or failure depends on the
ability of one process to exit the critical section before another process enters the critical section. It is often
the case that two processes are seldom in the critical section at the same time; but when there is overlap in
accessing the critical section, the result is a disaster
Shared buffers problems:
An example of data inconsistency that can occur because of a race condition is what can happen with a
shared bank account. Dear Old Dad adds money to an account and Poor Student withdraws from the
account. When either accesses the account, they execute a critical section consisting of three steps.
1. Read account balance
2. Update the balance
3. Write the new balance to the account
6. Attempt any four of the following 16
a) Which steps are executed by µC while handling interrupt?
Ans: ( 4 mks for proper steps)
µC finishes the instruction it is executing and saves the address of the next instruction (PC) on the stack
It saves the current status of all the interrupts internally
It jumps to a fixed location in memory called the interrupt vector table
The microcontroller gets the address of the ISR from the interrupt vector table and jumps to it and starts to execute the ISR until it reaches the last instruction RETI
The microcontroller returns to the place where it was interrupted, it gets the PC address from the stack by popping the top two bytes of the stack into the PC and then it starts to execute from that address.
b) Write an assembly/C language program to generate ASCII code for 4 using lookup table.
Ans: Assembly language or C language – 4 mks
C program to display ASCII values
#include<stdio.h> int main(){ int i; for(i=0;i<=255;i++) printf("ASCII value of character %c: %d\n",i,i); return 0; }