14EI606 Embedded Systems
Total Page:16
File Type:pdf, Size:1020Kb
14EI606 Hall Ticket Number: III/IV B.Tech (Regular/Supplementary) DEGREE EXAMINATION April, 2018 Electronics & Instrumentation Engineering Sixth Semester Embedded Systems Time: Three Hours Maximum : 60 Marks Answer Question No.1 compulsorily. (1X12 = 12 Marks) Answer ONE question from each unit. (4X12=48 Marks) 1. Answer all questions (1X12=12 Marks) a) What is function of ALE pin of 8051? b) Discuss the functions of RS0 and RS1 bits in PSW? c) What do you mean the term embedded controllers and external memory devices? d) How RETI and RET instructions differ? e) What is function of SCON register? f) What is importance of Interrupt Enable Register? g) List the different members of Atmel flash microcontrollers? h) How to decide the operating frequency of 89CXX or 89CXXXX microcontrollers? i) What is pin P3.2 of microcontroller 89C51? j) What is the function of watchdog timer? k) List various interrupt sources in PIC 16C71? l) What is the function of status register of PIC16CXX? UNIT I 2. a) List and explain the functions of all special function registers in 8051? 8M b) Write about ports in 8051. 4M (OR) 3. a) Draw and explain pin diagram of 8051? 8M b) Discuss the criteria for selecting a microcontroller device. 4M UNIT II 4. a) Define addressing mode? Explain addressing modes supported by 8051 MC, with 8M example for each? b) Summarize 8051 interrupts. 4M (OR) 5. a) Discuss various timer modes supported by 8051. 8M b) Draw the format and explain the flag bits of Interrupt priority register? 4M UNIT III 6. a) Write a program to generate a triangular waveform with a period of 1ms using 89C51? 6M b) Write a program to generate 2KHZ Square wave on pin1.0 of port 1. 6M (OR) 7. a) Discuss and comment on the program and data memories of 89C51. 6M b) What are the power saving options of 89C51 and explain? 6M NIT IV 8. a) Discuss the interrupt structure in PIC microcontrollers. List various interrupt sources in 8M PIC16c71. b) List PIC reset action mechanisms and explain. 4M (OR) 9. a) Describe PIC memory Organization. 6M b) Explain the addressing modes of PIC with example? 6M SCHEM OF EVALUTION: 1. Carries equal marks for all -1M 2. a) List special function registers - 2M Explanation -6M b) Ports explanation -4M 3. a) Pin diagram - 3M Explanation -5M b) Criteria for selecting a microcontroller -4M 4. a)Definition of addressing mode -2M Types -2M Explanation -4M b) Types -2M Explanation -2M 5. a)Mode types -2M Explanation -6M b) Format -1M Explanation -3M 6. a) Program -6M b) program- -6M 7. a)Program memory -3M b) Data memory -3M 8. a) Interrupt structure -4M Sources of interrupts -4M b) reset mechanisms -4M 9. a) Memory organization -2M Explanation -4M b) Types -2M Explanation -4M BAPATLA ENGINEERING COLLEGE:BAPATLA III/IV B.Tech (Regular/Supplementary) DEGREE EXAMINATION EI ENGINEERING EMBEDDED SYSTEMS(14EI606D) APRIL,2018 SCHEME AND SOLUTION TOTAL MARKS:60 1.Answer all questions. a)what is function of ALE pin of 8051? A:ALE is used for latching the low address byte during external memory access.ALE is activated periodically with a constant rate of 1/6 the oscillator frequency. b)Discuss the functions of RS0 and RS1 BITS IN PSW? A:RS0 and RS1 are used to select register banks like BANK 0,BANK 1 etc. c)What do you mean the term embedded controllers and external memory devices? A:Embedded controller or devices has all functional block on chip ,including the program and data memory. There is no external data/address bus provided. Normally devices like 8031 from MCS-51 family need external memory interface.These devices are External Memory devices. d)How RETI and RET differ? A:RETI and RET both transfer control to the return address stored on stack;the only difference is that in addition to return function,RETI instruction enables interrupts of the current priority level. e)what is the function of SCON register? A:SCON register controls the serial communication operation.No of data bits and serial mode(data rate) are set by the user in SCON register. f)What is the importance of Interrupt enable register? A:The interrupt enable register allows the programmer to enable interrupts as needed like serial interrupt,timer interrupts,external interrupts. g)List the different members of Atmel flash microcontrollers? A:89CXX and 89C20XX have flash programmable and erasable read only memory. h)How to decide the operating frequency of 89CXX and 89CXXXX microcontrollers? A:In applications where fast processing is needed without any power constraints, operating frequency must be as high as possible. In some applications ,the power available for operating the instrument itself is limited. For example ,in battery operated instruments, the power consumption must be as low as possible. i)What is pin P3.2 of microcontroller 89C51? A:It is port 3 ,bit 2 which can act as input or output port when programmed or as external interrupt 0. j)What is the function of watchdog timer? A:In case the CPU goes into a hanging situation, it cannot reset the watchdog timer. If it happens so, the watch dog timer resets the CPU and the CPU comes out of the hanging situation. k)List various interrupt sources in PIC 16C71? A:Ex:external interrupt, timer interrupt, PORTB change interrupt and analog-to-digital conversion interrupt. l)what is the function of status register of PIC16CXX? A:Carry and Digital carry,zero flag are set according to arithmetic and logical operations and sleep can be selected.Bank 0 or 1 also selected by RP0 in status register. 2a)List and explain the functions of all special function registers in 8051? -8M A: Special function registers(SFR): The 128 bytes of on-chip additional RAM locations from 80H to 0FFH are reserved for the special functions and therfore these are called as Special Function Registers(SFRs). These SFRs are used for control or to show the status of various functions done by 8051 micontroller.All SFRs are directly addressable and can be read or written to as well. some SFRs are addressable and allow their individual bits to be set or cleared by instructions. For example,one can set or clear port1 bit P1.1 using SETB P1.0 OR CLR P1.0.The address of P1.1 bit is 91H.Port 1 has 90H as its byte address, and it is byte addressable too. PROGRAM STATUS WORD(PSW) Program status word is an 8-bit register.It consists of carry,auxiliary carry,overflow and parity flags.There are bits RS1 and RS0 for register bank selection.PSW is a bit addressable register. Data Pointer(DPTR) DPTR is a 16-bit register consisting of two bytes.The higher byte is referred to as DPH,where as the lower byte is referred to as DPL.The dta pointer is used for addressing the off-chip data and code with MOVX and MOVC commands respectively. Timer Registers:TH0,TL0;TH1,TL1 form 16-bit timer/counter registers 0,1 respectively.the operation may be timing or counting.there are various modes in which timers can be configured.For this purpose there are timer control (TCON) and timer mode register(TMOD). Ports 0 to 3:P0,P1,P2,P3 are the SFRs corresponding to four I/O ports respectively. Control Registers:TCON,TMOD,IE,IP,SCON,PCON contain the control and status for interrupts,serial I/O and timers/counters. 2.b) Write about ports in 8051. -6M(1+1+3+1) • The 8051 has four I/O ports – Port 0 (pins 32-39):P0(P0.0~P0.7) – Port 1(pins 1-8) :P1(P1.0~P1.7) – Port 2(pins 21-28):P2(P2.0~P2.7) – Port 3(pins 10-17):P3(P3.0~P3.7) – Each port has 8 pins . • Named P0.X (X=0,1,...,7), P1.X, P2.X, P3.X • Ex:P0.0 is the bit 0(LSB)of P0 • Ex:P0.7 is the bit 7(MSB)of P0 • These 8 bits form a byte. -1M • Each port can be used as input or output (bi-direction). -1M • Each pin of I/O ports – Internal CPU bus:communicate with CPU – A D latch store the value of this pin • D latch is controlled by “Write to latch” • Write to latch=1:write data into the D latch – 2 Tri-state buffer: • TB1: controlled by “Read pin” • Read pin=1:really read the data present at the pin • TB2: controlled by “Read latch” • Read latch=1:read value from internal latch – A transistor M1 gate • Gate=0: open • Gate=1: close • P1, P2, and P3 have internal pull-up resisters. - 3M – P1, P2, and P3 are not open drain. • P0 has no internal pull-up resistors and does not connects to Vcc inside the 8051. – P0 is open drain. – Compare the figures of P1.X and P0.X. • However, for a programmer, it is the same to program P0, P1, P2 and P3. • All the ports upon RESET are configured as output. - 1M OR 3.a.Draw and explain pin diagram of 8051? 8M The pin diagram of 8051 microcontroller looks as follows − A: Pins 1 to 8 − These pins are known as Port 1. This port doesn‟t serve any other functions. It is internally pulled up, bi-directional I/O port. Pin 9 − It is a RESET pin, which is used to reset the microcontroller to its initial values. Pins 10 to 17 − These pins are known as Port 3. This port serves some functions like interrupts, timer input, control signals, serial communication signals RxD and TxD, etc.