The Z80 Microprocessor Architecture
Total Page:16
File Type:pdf, Size:1020Kb
DESIGN AND FABRICATION OF AN ELECTRONIC SYSTEM FOR MONITORING AND CONTROLLING TEMPERATURE, LIGHT ILLUMINANCE AND HUMIDITY IN A GREENHOUSE WYCLIFFE OBANDA NYANYA I56/0243/2003 A THESIS SUBMITTED IN PARTIAL FULFILLMENT OF REQUIREMENTS FOR THE DEGREE OF MASTER OF SCIENCE (ELECTRONICS AND INSTRUMENTATION) IN THE SCHOOL OF PURE AND APPLIED SCIENCES OF KENYATTA UNIVERSITY APRIL 2010 DECLARATION I declare that the work presented in this thesis is my original work and has not been presented for a degree in any other university or for any other award. WYCLIFFE OBANDA NYANYA Signature………………………… Date………… PHYSICS DEPARTMENT KENYATTA UNIVERSITY We confirm that the candidate carried out the work reported in this thesis under our supervision. DR. PATRICK M. KARIMI Signature…………………….......... Date……...... PHYSICS DEPARTMENT KENYATTA UNIVERSITY P. O. BOX 43844-00100 GPO NAIROBI-KENYA DR. ABDALLAH S. MERENGA Signature……………………….... Date …………… PHYSICS DEPARTMENT KENYATTA UNIVERSITY P. O. BOX 43844-00100 GPO NAIROBI- KENYA ii DEDICATION This work is dedicated to my wife, Elizabeth, my daughters Sharon and Louise, my son Mark and to my late father Herbert Ambundo who would have loved to see it all. iii ACKNOWLEDGEMENTS I would like to take this opportunity to thank all my lecturers in the physics department for instilling confidence in me when pursuing this course. Special thanks go to my supervisors, Dr. P. M. Karimi and Dr. A. S. Merenga, for their guidance throughout this research. I also wish to thank my colleague John Githaiga for his useful suggestions. The technicians in the Physics department were very helpful to me during the construction of the system. I also wish to thank my wife Elizabeth Obanda for her moral support and patience. My daughters Sharon and Louise and my son Mark were very patient with me during long absences. Lastly but not least, I wish to thank my employer, the Teachers‟ Service Commission for granting me a 6 month study leave which enabled me complete the system construction and implementation. iv TABLE OF CONTENTS DECLARATION ............................................................................................................................. ii DEDICATION ............................................................................................................................... iii ACKNOWLEDGEMENTS ............................................................................................................ iv TABLE OF CONTENTS ................................................................................................................. v LIST OF FIGURES ......................................................................................................................... x LIST OF TABLES......................................................................................................................... xii LIST OF ABBREVIATIONS AND ACRONYMS ....................................................................... xiii ABSTRACT .................................................................................................................................. xv Chapter 1 ....................................................................................................................................... 1 INTRODUCTION ......................................................................................................................... 1 1.1 Background to the Study ........................................................................................................ 1 1.2 Statement of the Research Problem ........................................................................................ 2 1.3 Objectives .............................................................................................................................. 3 1.4 Rationale ................................................................................................................................ 3 Chapter 2 ....................................................................................................................................... 5 LITERATURE REVIEW .............................................................................................................. 5 2.1 Introduction ........................................................................................................................... 5 2.2 Greenhouse Effect .................................................................................................................. 5 2.3 Greenhouses........................................................................................................................... 7 2.4 Greenhouse Structures and Light Management ....................................................................... 9 2.5 Temperature Management .................................................................................................... 12 2.6 Relative Humidity Management ........................................................................................... 14 v 2.7 Computerized Environmental Control Systems .................................................................... 16 Chapter 3 ..................................................................................................................................... 19 MICROPROCESSOR OPERATION AND PERIPHERAL DEVICES ................................... 19 3.1 Introduction ......................................................................................................................... 19 3.2 Microprocessors ................................................................................................................... 19 3.2.1 Microprocessor Fabrication Techniques ........................................................................ 21 3.2.2 Microprocessors Types .................................................................................................. 21 3.2.2.1 Intel 8048 ............................................................................................................... 22 3.2.2.2 Motorola MC14500 ................................................................................................ 23 3.2.2.3 National Semiconductor COP400 ........................................................................... 23 3.2.2.4 Texas Instruments TMS370 .................................................................................... 23 3.3 The Z80 Microprocessor ...................................................................................................... 24 3.3.1 Registers ....................................................................................................................... 26 3.3.1.1 The Flag and Program Counter Registers ................................................................ 26 3.3.1.2 The Stack and Instruction Registers ........................................................................ 27 3.3.2 Addressing Modes ......................................................................................................... 28 3.3.3 Fetch Execute Sequence ................................................................................................ 29 3.3.4 Z80 CPU Pin Description .............................................................................................. 29 3.4 The Clock System ................................................................................................................ 31 3.5 Microprocessor Buses .......................................................................................................... 34 3.6 System Interrupts ................................................................................................................. 36 3.7 CPU and Peripheral Handshaking ........................................................................................ 37 3.8 Primary Memory .................................................................................................................. 38 vi 3.8.1 Random Access Memory (RAM) .................................................................................. 38 3.8.2 Read Only Memory (ROM) ........................................................................................... 39 3.9 System Interfacing ............................................................................................................... 40 3.9.1 Intel 8255 Programmable Interface adapter (PIA) .......................................................... 42 3.9.2 Modes of Operation ....................................................................................................... 43 3.9.3 Interfacing to the Mains ................................................................................................. 45 3.10 Signal Conditioners ............................................................................................................ 46 3.11 Temperature Sensors .......................................................................................................... 48 3.12 Relative Humidity Sensors ................................................................................................. 53 3.13 Light Sensors ..................................................................................................................... 56 3.14 Analogue Digital Converters (ADC) .................................................................................. 58 3.15 Programming Languages .................................................................................................... 59 3.15.1 Machine Language