ES C 263 Microprocessor Programming and Interfacing BITS
ES C 263 Microprocessor Programming and Interfacing BITS Pilani Campus Pawan Sharma Lecture 3 10 -01 -2013
Last Lecture Instruction Set Architecture BITS Pilani, Pilani Campus
Today’s Lecture Design Example PC Boot Process BITS Pilani, Pilani Campus
Design Example BITS Pilani, Pilani Campus
Design a microprocessor based system to control p. H of a solution in a reactor tank. User enters desired p. H (0 -14) and controller gain Reactor tank is provided with three p. H sensors, to compute the average p. H. Motorised valve Reactor tank has three inputs. • (acid flow, base flow effluent discharged from factory controlled by valves) BITS Pilani, Pilani Campus
Valve Control -Controlled by stepper motors -1 step is by 1. 8 degrees rotation Valve opening = k. P * error Where error = desired p. H – measured p. H. Error positive- close fully acid valve and open base valve accordingly Error negative- close fully base valve and open acid valve accordingly. 0 – 360 degrees correspond to 0 to 200 steps. BITS Pilani, Pilani Campus
Stepper Motor sequence: A B C D 1 0 0 1 1 0 0 1 1 0 CW ACW Use a 4 - bit port + driver (nearly 1 A current) BITS Pilani, Pilani Campus
p. H sensor Vout 0 7 14 p. H Voltage output 60 m. V/p. H -420 m. V - +420 m. V BITS Pilani, Pilani Campus
Interfacing Analog to Digital Converter 8 -bit ADC I 0 D 0 I 7 D 7 Start A B C ALE EOC OE ADC 0809 BITS Pilani, Pilani Campus
Input Keys - Numeric keys 0 – 9 - Function keys p. H, k. P, enter Matrix Keypad interfacing!! - 2 four bit ports. BITS Pilani, Pilani Campus
Display Device and storage Two digit Display Two seven segment display devices to display p. H Memory Interfacing ROM (4 KB) - FF 000 H – FFFFFH - SRAM (4 K) - 00000 H – 00 FFFH BITS Pilani, Pilani Campus
System Block Diagram Parallel I/O CPU Memory Serial I/O Interface Data Address Control BITS Pilani, Pilani Campus
Method of Approach Identify input and output devices Memory requirements Suitable memory and I/O interfacing Assembly Language Programming Assumptions made BITS Pilani, Pilani Campus
PC Boot Process BITS Pilani, Pilani Campus
• Powered on CPU starts executing code located from FFFF 0 H – called BIOS and operates in the real mode of operation. • The code performs POST (Power On Self test) • After POST, CPU reads the boot sector • (floppy, hard disk – sequence set in BIOS features) • Checks for AA 55 H at 07 DFEH --- ( Boot signature) • The first sector of the bootable disk, contains the boot loader program or the MBR or grub/LILO. The BIOS loads the MBR in RAM starting at address 07 C 00 H and executed. • Loads DL (one of the CPU registers) with • • • 00 h if the boot sector was loaded from drive A 80 h if the boot sector was loaded from drive C This way, the bootsector can determine which drive it was booted from. • After the completion of the boot loader program, the control is transferred to the OS. BITS Pilani, Pilani Campus
- Slides: 15