Design and Building of Home Made 8051 Microcontroller Emulator

Design and Building of Home Made 8051 Microcontroller Emulator

Sudan Academy of Sciences ( SAS) Atomic Energy Council Design and building of home made 8051 Microcontroller Emulator By Abdclmoncim Elobeid Hussein iVI.Sc. in Electronics Engineering University of Khartoum ( 2002) A Thesis Submitted to the Sudan Academy of Sciences In Fulfillment of the Requirements for Doctor of Philosophy Degree Ph.D. in Electronics Engineering Supervisor Dr.Abd Elrasol Gabar Elzobaidi September 2009 Sudan Academy of Sciences (SAS) Examination committee Name External examiner Dr. Sid Ahmed Ibrahim Internal examiner Dr. P'arouk Idris llabbani Supervisor Dr. Abdelrasoul Gabar Hlzobaidi Dedication ll'or wfwm tfwy tfiougfit we are of their concern ^L&J all uu iao uu ^ i « J&Jl (J ic -llLa t-Lu 5 ^jrti <Vi I t^*iml <—L^Jl IJA 4. Ij&lM \ »J*-»lL) 3 j^JtjjULa ^ »_L>Ua]|j ac-LiU , A . O \ JjjLill SbVI jl nr.J jj— VAJ ^1 JJ^UI SbV ^JJ^^I J>\jd\ j CjL^ajjJ] .Lpj.1 .As*-* ialJLi j I^JIJJILU 3JJJJ vb byj ISjAi^a ^jjSjJl ^aJLxJl S^a.j (j^ia ^.l.^l.nl <_U*Jl IJtA J.Je»S ^JJjjjfUVI J»lj-iH ^ j J n-> j ijj jc SjLc- Clllj% ajjjl Lai .dljj l-t")!! (jiaxJ £-a (-^*-LJl j_c V JJ o>—% ojSI-ll) dib Ajj^aJl CJlAaaJt dial Vina ) 4 .aS'i j»£jkloll <L«AJ ^Jj La Sole ^ iViiii,all jj-alijjJ LSIj-aj <<• «ji>iati C_>jxl-tll jLj-a. £<e (J^ljail .^jlaJl SjSlill J- . jlll <• iu?i«ll «_1 axubJl ^Jc <4_al.lklu>l j£-aJ 1 >ji>i<i\l L_]jiJ-»ti ^Jc ^Ajla ^^aUjj ^1 J—jl (J}* «JJ J «J «, iji nail <-_) a ml ->It ^ifi. JLi^l jj Vi« i H Ijj <_JJ|JA!I £-»UJJJ| £<* a > A i_J ajoibJl AjLuol Aft Jul (Jj^»"n I—l3tj<a)l ^ _aiJ >*ll.1> j -llialt .^1%"ujall <jj.il UalLaj I 111 mi l_lSl JAJI g^aUjlil (JaAU jj «J ^ Ull 4JSJJ.H j£l jill 4jk-aj> Ai'jlj Cilfljjll (jlfi .hjtaj>\t ^a)j—j l^lwv 4J&yajf 4JJ ajjilVI »Jjl aJ ^ AJSJJ J^'j^ ^-^J A^al_)j (jj_^iaj j»>-%1niolt S^l_Ji L^aiUa A^jJA ijfrV^S VJ L^W^J jLaj ft^c liliiS . J^ai OXJ LJlSfc ^JiLI J__JS jjfjl.^iail ^aUjJl ijajJl SjSlill AjLp3 AJIJJ AJJ^J (_llku IJA l-lS>a .lillij jc-ajuU kllll-S o 3_jjbj ^-1 a—li <iijJ^JVI JJ^kill JJI Jx^J «JUb ^_>Jl SjSlill Sj4.Ua .4laa.JJ .(JjJ-llI ^Viall J>?.a^ i—lSljaJl ^aljjjJl jl LaJUa l^-\jjn j$-»J Jl >ji Jjl ^ ci«x]l IJUb jli t JJ aiaSlI AjLaC Col ^Irati j»Al gjijull <L*j« 1 jn«« ^—Sc. (dll—iMajjiil^j-al «VI ^ji-iwil gtJlii^ <Uja-aJl j jju ^lll 4 i>.ili<i,llj JjlaJl ji»xj ^uukll t^ri.tilt i $.lja.VI tjLuiV 4 jiill tjiijaJl nJjjMSlI <£jAji)l (£A ^.I-^IMI/ill ^alijJ ^—^IjVI J-a «J Javil "ajJ j£l ia^li^J Lk JL>J| jS^aj ^yjil <• «jihati l_l j»»il->ll ^a (J^a\jjl)j . jiJJ j»J jJa^Jlj * ijS «jl i^-full t'll i-s ajj (jLt t->'inall ^aUjj A-a^-ail 3—uibvlt ^. a J ual jSll J uiLuull frLu-all ^,\^*iiaj lilj-ail ^UJJ J^^W J£^3>-^ d—^yik ^—US J? »>-» ijl Ji«y V i J (jJka. jl a^vmall (j^i ^ ' 'J'^oti j a (—J—UaJ j 4jA.jliJl SjSlJll ^-3 <Uxa^J ^JJ ^A^luuJl ^-aljjj .<Sk^aUjJ ^^JLaLalll . jbi. J^IS ^joi.-Vill IJA jljl IJI ^rjiJl3 ;Ji..}ll Jjjlj<a J^axj t 'tj'ii.i (jl ^AajUiball L_I j uilaJl ^ lc ,\t Villi JJ j'»•!».i JJ jiaj I Jl Li jbkjl jirsll a ^ jnll t"i\jJoft ^ S Sj—j i%il ^ jjjll (a a (.\ SJJJSI (Ji-al jp (J^*i l-Ub C_lSlj-all gt-aljjj (JA1*J ^»JJ <_kuia-ajl • I. tjiXnil C-ljillicit 11 ABSTRACT This research targeted design and build of a simple lab made emulator fur the 8051 microcontroller to assist student and researcher in their projects. This will be achieved by thorough understanding of the software and the hardware of the development tool which will enliance the user knowledge rather limn considering them as black boxes and unaware of their capabilities and their limitations. Regarding the hardware this work preferred to use the same central processing unit the developer wanted to build with little modification. While the software is a program loaded in the microcontroller itself responsible (making use of flash microcontrollers) for communication with the host computer terminal, and monitoring the user program which is loaded in the external memory by the program. Any terminal program on the host computer can be used to carry out communication with monitor program provided that a carriage return should be pressed after monitor power up to let the monitor adjust its baud rate accordingly. This feature makes the monitor program so simple and familiar to the user. For simplicity the software is enhanced with flash programming and erasing subroutine which can allow the user to store his program there if he put a flash ROM in his hardware and he can make it as start up program which will run automatically after start up. Also many programs can be loaded in the flash as long as its capacity is capable Definitely this requires configuring flash start and end in the source before compiling it. This flash feature allows the development liardware to be as final board and hence a debugable one as long us monitor program resides inside the microcontroller. Considering the debugging stage as the most crucial step in the development cycle, this work tried to find some suitable and simple solutions that can enhance knowledge. As a result some commands on the user program like uploading, downloading, displaying, jumping, selecting among others, running, editing, clearing and communicating with the host PC can be carried out efficiently. But unfortunately some significant commands on the user program like tracing, pausing and single stepping were not met. It is worth mentioning tliat the monitor program is using the serial port for communication with the host PC, so the user has to be careful not to change any register iii involved in serial communication in his program. Also the user program is loaded in the external memory and the user is required to add some I/O ports if he needs this design as last setup. Tracing and single stepping could be accomplished if some host PC emulation program is developed and this monitor program is modified to carry out more intelligent communication with the new host PC environment. iv ACKNOWLEDGEMENTS I gratefully acknowledge Coskim HARMANSAH and Mehmel BAYBURT for their advice and supervision which represents the backbone of this research and so to this thesis. It is a pleasure to convey my gratitude to them all in my humble acknowledgment. In the first place 1 would like to record my gratitude to Coskun HARMAN§AH for his supervision, advice, and guidance from the early stage of this research as well as giving me extraordinary experiences through out the work. Many thanks go in particular to Serdar AKDURAK I am much indebted to AKDURAK for his valuable advice in science discussion and supervision I gratefully thank them for their constructive comments on this thesis. I would like to thank Pcrihau UNAK and Meral KRAI, for giving me the opportunity to work on Electronic l.ab equipment in Institute of Nuclear Science in Ege University in Izmir. To Mehmet Bayburt, thank for his technical assitances during work I had in Izmir. I would also like to thank M. Muslim SAC; and Onui KAHVECi for their collobration and their willingness to share their bright thoughts with me, which were very fruitful for shaping up my ideas and research. It is a pleasure to express my gratitude wholeheartedly to Siileyman ERKUT, Giingor POLAT and their family for their kind hospitality during my stay in Izmir. I would like to express special thanks to Siileyman ERK.UT for his indispensable help dealing with travel funds, administration and buieaucratic matters during my stay in Izmir. I cannot end without thanking my family, on whose constant encouragement and love I have relied throughout my time during this work. Words fail me to express my appreciation to my wile Sehna whose dedication, love and persistent confidence in me, has taken the load off my shoulder. v Finally, 1 would like to thank everybody who was important to the successful realization of this thesis, as well as expressing my apology that I could not mention personally one by one. 1 am grateful in every possible way and hope to keep up our collaboration in the future. vi Table of contents Dedication 1 Arabic abstract ii Abstract tv Acknowledgement v Table of contents vii List of figures xi List of tables xiii Abbreviations xiv Chapter One: Introduction I 1.1 Background I 1.2 Problem statement 2 1.3 Objectives 2 1.4Melhodology / - 1.5 Research outlines 4 Chapter Two: 8051 Microcontroller 6 2.1 8051 Microcontroller Review 6 2.1.1 Why embedded systems 7 2.1.2 Why 8051 microcontroller 7 2.1.3 8051 Important features 8 2.1.4 8051 Programming 9 2.1.5 8051 Related processors 9 2.2 Memory Organization 1° 2.2.1 External Code Memory 11 2.2.2 External RAM Data memory II 2.2 3 Internal Memory 12 2.2.3.1 Register Banks (O0h to IFh) 12 2.2.3.2 Bit Addressable RAM (20h to 2F) 13 2.2.3.3 General Purpose RAM (30h to 7Fh 14 2.2.4 SFR Registers 14 vii 2.2.4.1 Program Status Word (PSW) register 16 2.2.4.2 Power Control (PCON) register 17 2.2.4.3 rimer/Counter Mode Control (TMOD) register 18 2.2.4.4 Serial Control (SCON) register 19 2.2.4.5 Interrupt Enable (IE) register 2 1 2.2.4 6 Interrupt Priority (IP) register 2 1 2.2.4.7 Timer /Counter 1 Control (TI CON) register 2 2 2.2.4.8 Timer/ Counter2 Control (T2C0N) register 2 3 2.3 8051 Addressing modes 2 5 2.3.1 Direct addressing 2 5 2.3.2 Indirect addressing 2 5 2.3.3 Indexed addressing 2 5 2.3.4 Register instruction 2 5 2.3.5 Register specific instruction 2 5 2.3.6 Immediate constants 2 5 2.4 Circuit I lardwarc 26 Chapter Three: Development Tool 31 3.1 Creating a New Project 32 3.2 Building the Project 37 3.3 Debugging the Project 37 3.4 CPU Simulation 39 Chapter Four: Emulation Concept 40 4.1 Writing Microcontroller Code 40 4.2 Translating the Code 41 4.3 Debugging the Code 41 4.3 I Simulators

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    151 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us