Presentation is loading. Please wait.

Presentation is loading. Please wait.

ES C263 Microprocessor Programming and Interfacing

Similar presentations


Presentation on theme: "ES C263 Microprocessor Programming and Interfacing"— Presentation transcript:

1 ES C263 Microprocessor Programming and Interfacing
Lecture 2 ES C263 Microprocessor Programming and Interfacing

2 ES C263 Microprocessor Programming and Interfacing
Last Lecture Evolution of Computers and Microprocessors Moore's Law ES C263 Microprocessor Programming and Interfacing

3 ES C263 Microprocessor Programming and Interfacing
Today's Lecture Instruction Set Architecture Overview of a Microprocessor Design Example ES C263 Microprocessor Programming and Interfacing

4 Processor (8086 through Pentium
The Personal Computer Speaker Processor (8086 through Pentium Timer logic (8253) Coprocessor (8087 through System ROM 640KB DRAM System bus (data, address & control signals) Keyboard logic (8253) DMA Controller (8237) Expansion logic Interrupt logic (8259) Video card Disk controller Serial port Keyboard ... ES C263 Microprocessor Programming and Interfacing Extension slots

5 Instruction Set Architecture (ISA)‏
ISA refers to the actual set of programmer visible instruction set. Serves as a boundary between the hardware and software. Seven dimensions of ISA Class of ISA: general purpose register architectures, where operands are either memory or register locations. ES C263 Microprocessor Programming and Interfacing

6 ES C263 Microprocessor Programming and Interfacing
Memory Addressing: Byte addressing to access memory locations. Addressing Modes: specify the address of register, constant operands and memory objects- - register, immediate, displacement. ES C263 Microprocessor Programming and Interfacing

7 ES C263 Microprocessor Programming and Interfacing
Types and sizes of operands: supports operand sizes of 8 bit, 16 bit, 32 bit. Operations: data transfer, arithmetic, logic, control. Control flow instructions: support conditonal branches, unconditional jumps, procedure calls and returns. Encoding an ISA: fixed length or variable length. ES C263 Microprocessor Programming and Interfacing

8 ES C263 Microprocessor Programming and Interfacing
ES C263 Microprocessor Programming and Interfacing

9 ES C263 Microprocessor Programming and Interfacing
Memory Overview ES C263 Microprocessor Programming and Interfacing

10 ES C263 Microprocessor Programming and Interfacing
ES C263 Microprocessor Programming and Interfacing

11 Evolution of programming: machine language
late 40’s / early 50’s: programmers coded directly in machine language each machine had its own set of instructions (sequences of 0's & 1's) corresponding to its underlying hardware  extremely tedious, error-prone ES C263 Microprocessor Programming and Interfacing

12 ES C263 Microprocessor Programming and Interfacing
-Fetches Instruction -Executes Instruction ES C263 Microprocessor Programming and Interfacing

13 ES C263 Microprocessor Programming and Interfacing
Computer Hardware Organization Example: 3 Instructions of a program Input Value from port 05 Add 7 to this value Output the result to port 02 Control unit common bus Arithmetic logic unit memory output input Registers program data unit unit storage storage ES C263 Microprocessor Programming and Interfacing

14 ES C263 Microprocessor Programming and Interfacing
Add Bus CPU Data Bus Control signals ES C263 Microprocessor Programming and Interfacing

15 ES C263 Microprocessor Programming and Interfacing
Memory Add Bus Data Bus Read Write Memory – Registers to hold bits ES C263 Microprocessor Programming and Interfacing

16 ES C263 Microprocessor Programming and Interfacing
Ex : 8 Registers 4 bits Add lines : 3 (Unidirectional)‏ Data lines : 4 (Bidirectional)‏ ES C263 Microprocessor Programming and Interfacing

17 ES C263 Microprocessor Programming and Interfacing
Design Example ES C263 Microprocessor Programming and Interfacing

18 ES C263 Microprocessor Programming and Interfacing
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 provided with three pH sensors, to compute the average pH. Reactor tank has three inputs. (acid, base flow controlled by valves, effluent discharged from factory) ES C263 Microprocessor Programming and Interfacing

19 ES C263 Microprocessor Programming and Interfacing
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. ES C263 Microprocessor Programming and Interfacing

20 ES C263 Microprocessor Programming and Interfacing
Parallel I/O Serial I/O Memory I/O Interface CPU Data Address Control ES C263 Microprocessor Programming and Interfacing

21 ES C263 Microprocessor Programming and Interfacing
Stepper Motor sequence: A B C D ACW CW Use a 4- bit port driver (nearly 1 A current) ES C263 Microprocessor Programming and Interfacing

22 ES C263 Microprocessor Programming and Interfacing
pH sensor Vout pH 7 14 Voltage output 60mV/pH -420mV mV ES C263 Microprocessor Programming and Interfacing

23 ES C263 Microprocessor Programming and Interfacing
Interfacing Analog to Digital Converter 8-bit ADC I0 I7 D0 D7 Start A B C EOC OE ALE ADC 0809 ES C263 Microprocessor Programming and Interfacing

24 ES C263 Microprocessor Programming and Interfacing
Input Keys Numeric keys 0 – 9 Function keys pH, kP, enter Matrix Keypad interfacing!! - 2 four bit ports. ES C263 Microprocessor Programming and Interfacing

25 ES C263 Microprocessor Programming and Interfacing
Two digit Display Two seven segment display devices to display pH Memory Interfacing ROM (4K) - FF000H – FFFFFH SRAM (4K) H – 00FFFH ES C263 Microprocessor Programming and Interfacing

26 ES C263 Microprocessor Programming and Interfacing
Method of Approach Identify input and output devices Memory requirements Suitable memory and I/O interfacing ALP Assumptions made ES C263 Microprocessor Programming and Interfacing


Download ppt "ES C263 Microprocessor Programming and Interfacing"

Similar presentations


Ads by Google