ES C263 Microprocessor Programming and Interfacing Pawan Sharma Lecture 3 10-01-2013
Last Lecture Instruction Set Architecture
Today’s Lecture Design Example PC Boot Process
Design Example
Design a microprocessor based system to control pH of a solution in a reactor tank. User enters desired pH (0-14) and controller gain Reactor tank is provided with three pH sensors, to compute the average pH. Reactor tank has three inputs. (acid flow, base flow effluent discharged from factory controlled by valves) Motorised valve
Valve Control Controlled by stepper motors 1 step is by 1.8 degrees rotation Valve opening = kP * error Where error = desired pH – measured pH. 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.
Stepper Motor sequence: A B C D 1 0 1 0 0 1 1 0 0 1 0 1 1 0 0 1 1 0 1 0 0 1 1 0 0 1 0 1 1 0 0 1 ACW CW Use a 4- bit port + driver (nearly 1 A current)
pH sensor Vout pH 7 14 Voltage output 60mV/pH -420mV - +420mV
Interfacing Analog to Digital Converter 8-bit ADC I0 I7 D0 D7 Start A B C EOC OE ALE ADC 0809
Input Keys Numeric keys 0 – 9 Function keys pH, kP, enter Matrix Keypad interfacing!! - 2 four bit ports.
Display Device and storage Two digit Display Two seven segment display devices to display pH Memory Interfacing ROM (4KB) - FF000H – FFFFFH SRAM (4K) - 00000H – 00FFFH
System Block Diagram CPU Memory I/O Interface Parallel I/O Serial I/O Data Address Control
Method of Approach Identify input and output devices Memory requirements Suitable memory and I/O interfacing Assembly Language Programming Assumptions made
PC Boot Process
The code performs POST (Power On Self test) Powered on CPU starts executing code located from FFFF0H – 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 AA55H at 07DFEH --- ( 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 07C00H and executed. Loads DL (one of the CPU registers) with 00h if the boot sector was loaded from drive A 80h 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.