Download as pdf or txt
Download as pdf or txt
You are on page 1of 141

DEVELOPMENT THIRD YEAR MICROPROCESSOR LABORATORY

EXPERIMENT AND DESIGN E-LEARNING FOR THIRD YEAR


MICROPROCESSOR LABORATORY

MOHD YAZID BIN KAMIS

This thesis is submitted in partial fulfillment of the requirements for the Degree in
Bachelor of Electrical (Telecommunication) Engineering

Faculty of Electrical Engineering


Universiti Teknologi Malaysia

November, 2006
iii

Special Dedications to Dearness People:

…To Beloved Mom;


Your loves, bless, sacrifice, understandings, and encouragement will always be bear in
our minds. Wishing God’s bliss and favour is with you

…To Graceful Cousin;


This attainment is achieved by your full support and care with hope that these will be an
interest path for your future undertakings.

…To Dearest Friends;


Way all of the arduous and impedance challenge can be face with patience and diligent.
Hoping all of the hard times and good times of ours will remain forever
iv

ACKNOWLEDGEMENT

Alhamdulillah, thank to Allah S.W.T for the guidance and knowledge bestowed
upon me, for without it I would not have been able to this far.

I would like to take this opportunity to express my deepest gratitude to my


supervisor Mrs. Fareha Binti Abdul Rahman for his advice, guidance and help
throughout the two semester period when this project took place. I also would like to
thank Mr. Zuraimi B. Yahya and Mr. Zainul Abidin B. Halim for being there whenever I
need him in the laboratory.

My almost thanks also go to my family, especially my mother to whom I owe my


love and gratitude. My beloved Liena for her full understanding and encouragement.

To all my friends who have helped and support me along the way, I thank you from the
bottom of my heart. I wish you all the best in life and hope that our friendship will last
forever.
v

ABSTRACT

Microprocessor laboratory experiment is an education module which is used by


FKE students in the laboratory subject during the first and second semester of their third
year study. The experiment in microprocessor laboratory about how to learn, writing,
develops a programming and knows the software and hardware of microprocessor. This
experiment to give student a better understanding about the microprocessor subject. The
labsheet consists two sections which are writing a Program on Windows Environment,
Cross Assembled and upload the program. The circuits in this experiment are Flight 68K
Microprocessor Board and Flight 68K Application Board and the software is Hyper
Terminal.

This project also about an e-learning platform for the Third Year Laboratory,
Faculty of Electrical Engineering especially for Microprocessor Laboratory. E-learning
is way delivering information, enhancing communication, and training for student.
Student had difficulty to get much information about the laboratory and understand
about the experiment. The objective of this e-learning is to develop a system that
enhances the understanding of FKE student and performance in this field of study in
their subject. This e-learning was conceived with vision to develop a system where the
student will able to get knowledge about laboratory’s in FKE. To achieve this objective,
the platform has been built with element such as labsheet, visual experiment and new
information about the laboratories. The platform has been built with PHP, Apache,
MySQL, Macromedia Dreamweaver MX 2004, Adobe Photoshop, Swift 3.00, and
Macromedia Flash MX.
vi

ABSTRAK

Makmal Mikropemproses adalah salah satu makmal yang di wajibkan kepada


pelajar-pelajar tahun tiga Fakulti Kejuruteraan Elektrik. Modul ujikaji bagi makmal
Mikropemproses adalah bermatlamat untuk meningkatkan kualiti pengetahuan dan
kemahiran pelajar dalam bidang pengaturcaraan. Ia mengandungi kertas-kertas ujikaji
yang lengkap untuk melakukan eksperimen-eksperimen dengan menggunakan bahasa
pengaturcaran tahap tinggi MC 68 000. Komputer papan tunggal Flight 68k digunakan
sebagai kaedah melaksanakan aturcara 68 000.

Projek ini juga mengandungi satu pangkalan E-Learning bagi Makmal


Mikropemproses. E-Learning merupakan suatu kaedah penyampaian infomasi,
meningkatkan perhubungan dan tahap pendidikan khususnya kepada golongan
pelajar.Tujuan projek ini adalah untuk meningkatkan pemahaman pelajar dalam bidang
Mikropemproses.Untuk mencapai objektif tersebut,projek ini dibina dengan pelbagai
elemen iaitu pengenalan makmal, kemudahan, kertas-kertas ujikaji, dan maklumat-
maklumat terbaru mengenai Makmal Mikropemproses. Keseluruhanya projek ini dibina
berasaskan PHP, Apache, Macromedia Dreamweaver MX 2004, Adobe Photoshop,
Swift 3.00,dan Macromedia Flash MX.
vii

TABLE OF CONTENTS

CHAPTER TITLE PAGE

TITLE i
DECLARATION ii
DEDICATION iii
ACKNOWLEDGMENT iv
ABSTRACT v
ABSTRAK vi
TABLE OF CONTENTS vii
LIST OF TABLES xii
LIST OF FIGURES xiii
LIST OF SYMBOLS xvi
LIST OF ABBREVIATIONS xvii
LIST OF APPENDICES xix

1 INTRODUCTION

1.1. Microprocessor Laboratory 1


1.2 E-learning 2
1.3 Objective of Project 3
1.4 Scope of work 4
viii

2 MICROPROCESSOR

2.1 Motorola’s Microprocessor Evolution 8


2.2 Overview of Hardware Organization 11
2.2.1 System Bus 14
2.2.2 Memory Module 15
2.2.3 I/0 Interface 15

2.3 Overview of Software System 16


2.3.1 Operating system 16
2.3.2 Language translators 18
2.3.3 Linker 18

3 ASSEMBLY LANGUAGE PROGRAMMING

3.1 Introduction 19
3.2 Symbols 20
3.3 Assembly Language Statement Format 22
3.4 Assembler Directives 24
3.5 Data Movement Group 24

4 THE FLIGHT 68 000

4.1 Introduction 25
4.2 Hardware 26
4.3 Firmware 28
4.4 System Description 29
4.4.1 68 000 CPU 29
ix

4.4.2 EPROM Memory 30


4.4.3 RAM Memory 30
4.4.4 AUXILIARY Memory 30
4.4.5 68230 Peripheral Interfacemmer (PI/T) 31
4.4.6 DUART 31

4.5 Flight Application Board 33


4.6 Input/Output and Application 34
4.6.1 Programming the PI/T 34
4.6.2 Declare the PI/T 35

5 THE TECHNIQUE TO USE FLIGHT 68000

5.1 Theory 36
5.1.1 Microprocessor Laboratory 36
5.1.2 The Flight 68K Microprocessor Board 36
5.1.3 I/0 Theories and Application 37
5.1.4 Function 37
5.1.5 PI/T Address 39

5.2 Step to Write/Edit Program 39


5.3 Steps to Cross-assemble 41
5.4 Steps for Uploading a Program 42

6 ANALYSIS EXPERIMENT

6.1 Analysis Experiment 1 46


6.2 Analysis Experiment 2 47
6.3 Analysis Experiment 3 48
x

6.4 Analysis Experiment 4 49


6.5 Analysis Experiment 5 50
6.6 Analysis Experiment 6 50
6.7 Analysis Experiment 7 52
6.8 Analysis Experiment 8 52
6.9 Analysis Experiment 9 53
6.10 Analysis Experiment 10 54

7 CONCLUSION

7.1 Conclusion 55
7.2 Suggestions 56

8 E-LEARNING PLATFORM 57

8.1 E-learning Defined 58


8.2 Advantages of E-learning 60
8.3 Learning as Lifeblood 61
8.4 The Main Components 63

9 OPPORTUNITIES TO ENHANCE KNOWLEDGE 65

9.1 Important Criteria to Enhance Learning 66


9.1.1 To Comprehend Difficult To Understand Concepts 66
9.1.2 To Engage In Learning 67
9.1.3 Access to Information and Resources 68
xi

9.2 Important Features of the Platform 69


9.3 Important Tools Used in the Platform 69

10 FOUNDATION OF THE PROJECT 70

10.1 EasyPHP 71
10.1.1 Running EasyPHP 72
10.1.2 PHP Configuration File 73
10.1.2.1Error Reporting 73
10.1.2.2 Register Global 73
10.1.2.3EasyPHP Status Program 75
10.2 Macromedia Dreamweaver MX 2004 75
10.2.1 Easy Text Entry 77
10.2,2 Click and Drag Table Setup 78
10.3 Flash, Swift 3D and Adobe Photoshop 79

11 RESULT 81

12 CONCLUSION

12.1 Summary 84
12.2 Problems Encountered 85
12.3 Benefits 86
12.4 Future Enhancements 87

REFERENCES 89
xii

LIST OF TABLES

TABLE NO. TITLE PAGE

3.1 The possible operation size postfixes 23


4.1 Programming the PI/T 34
4.2 Declare the PI/T 35
5.1: Motor Movement 38
5.2 Heater Function 38
5.3: PI/T Address 29
xiii

LIST OF FIGURES

FIGURE NO. TITLE PAGE

1.1 Flow chart of Microprocessor Laboratory Project 6


1.2 Step to write/edit program 7
2.1 Motorola’s microprocessor evolution 10
2.2 Block diagram of microprocessor based system 13
2.3 Program development and software organization 17
3.1 A sample assembly language program, 21
3.2 Machine code after being relocated to 032500 22
4.1 Flight 68 000 Microprocessor Board 26
4.2 Block Diagram of the Flight 68K 32
4.3 Flight 68k Application Board 33
5.1 Run DOS PROMPT window 39
5.2 DOS PROMPT window 40
5.3 To edit program 41
5.4 Hyper Terminal 44
6.1 The experiment 1 flowchart 46
6.2 The experiment 2 flowchart 47
6.3 The experiment 3 flowchart 48
6.4 The experiment 4 flowchart 49
6.5 The experiment 6 flowchart 51
6.6 The experiment 9 flowchart 53
6.7 The experiment 10 flowchart 54
xiv

FIGURE NO. TITLE PAGE

8.1 Asynchronous Learning Network 59


8.2 Model Planning for E-learning 62
8.3 Main components of web based learning 64
10.1 Run the 'easyphp setup.exe' file 71
10.2 EasyPHP starts 72
10.3 The shortcut menu 72
10.4 Error Reporting 74
10.5 Register Global 74
10.6 EasyPHP Status Program 75
10.7 Macromedia Dreamweaver MX 2004 76
10.8 Dreamweaver visual editor 77
10.9 Click and Drag Frame Setup 78
10.10 Macromedia Flash MX 79
10.11 Swift 3D 80
11.1 Flowchart on titles and sub-titles 83
xv

FIGURE NO. TITLE PAGE

APPENDIX C

C1 Introduction 116
C2 Organization 117
C3 Lab Rule 118
C4 Activities 118
C5 Facilities 119
C6 User Manual 119
C7 Schedule 120
C8 Division Group 120
xvi

LIST OF SYMBOLS

B Byte
W Word
L Longword
+ Addition
- Subtraction
* Multiplication
/ Division
() Parentheses
X [n:m] Bit n-m of X
(x) Content of X
→ Left operand is moved to right operand
↔ Exchange left and right operands
$N N in hexadecimal
N (no designator) N in decimal
@N N in octal
%N N in binary
xvii

LIST OF ABBREVIATIONS

ADD - Add Binary


ADDI - Steady State Response
ADDQ - Inter-Symbol Interference
ADDX - Sound Pressure Level
AND AND logical
ANDI AND immediate
ASL Arithmetic shift left
ASR Arithmetic shift right
BCLR Test bit and clear
BRA Branch
BSET Test bit set
BSR Branch to subroutine
CLR Clear
CMP Compare
CMPA Compare address
CMPI Compare immediate
DIVS Sign divide
DIVU Unsigned divide
EOR Exclusive OR logical
JMP Jump
JSR Jump to subroutine
MOVE Move data
xviii

MOVEA Move address


MULU Unsigned multiply
NOP No operation
NOT Logical complement
OR OR logical
ORI OR immediate
RESET Reset
ROL Rotate left
ROR Rotate right
RTE Return from exception
RTR Return and restore
RTS Return from subroutine
SUB Subtract binary
SUBA Subtract address
SUBI Subtract immediate
TRAP Trap
TRAPV Trap on overflow
TST Test
xix

LIST OF APPENDICES

APPENDIX TITLE PAGE

A The Labsheet 91
B Answer 102
C Result for E- Learning (WEB PAGE) 116
1

CHAPTER 1

INTRODUCTION

1.1 Microprocessor Laboratory

The laboratory experiment is requirement to all third year Faculty of Electrical


Engineering student base about electrical subject in Faculty of Electrical Engineering.
All third year student must attend all common laboratory for example Microprocessor
Lab, Instrumentation Lab, Control Lab, Basic Electronic Lab and Electronic Digital Lab.

The problem about previous labsheet laboratory is most the students not quite
understand about their experiment. The student can’t write the programming and take a
lot of time to finish the programming. They also do not know about how to use Flight
68K Board and Flight 68K Application Board. The previous labsheet also have many
instruction based and descriptive method. That means the students fully follow all the
instruction without make any reference before start the experiment and make students do
not understand what the experiment about. From that, it will make a problem and many
2

mistakes during experiment and the lecturer will take time to explain about the
experiment. Plagiarism of the laboratory report becomes habitual among the students. To
decreased the problem, the experiment like investigate will make students more thinking
and creative. Experiment like mini project will improve skill in writing report, thinking,
and analysis. The flowchart of Microprocessor Laboratory Project show in Figure 1.1
and the step to write/edit program show in Figure 1.2.

1.2 E-learning for Third Year Microprocessor Laboratory

The two great equalizers in life are the…Internet and…Education!


John Chambers

In response to the tremendous potential for improving educational opportunities


through effective use of technology, the vision of e-learning was conceived. The arrival
of e-learning could not be timelier. To keep up with the demand of careers in which
dimensions change at breakneck speed, it has become increasingly important that
learning not stop with a secondary or tertiary education. People must continue to push
forward in their quest for knowledge to ensure that they keep pace with today’s complex
society.

E-learning is not meant to replace traditional schooling; rather, it uses technology


to create a virtual learning experience that augments the physical classroom. E-learning
was presented a far-reaching vision for the effective use of technology to help student to
be better educated and better prepared for evolving demand of the new world economy
3

Using electronic media for learning and teaching is widespread. E-learning offers
opportunities for staff to convey material in variety of ways and ultimately on ‘anytime,
anyplace’ basis. E-learning materials can range from simple act of putting information
on line to simulations of real life. This means that distance learning (both off and on
campus) is a realistic possibility, with student able to take part in discussions via email
and online discussion forums, and at the same time being able to remotely access
materials and information. These materials do not need to be static web pages, as
technologies such as broadband improve audio and video may be made available on a
faculty Intranet allowing students to get knowledge about the equipment, software, and
anything about the laboratories in faculty.

1.3 Objective of project

1.3.1 Microprocessor Laboratory

The objective of this project is to develop complete syllabus for common


third year laboratory especially microprocessor laboratory. The labsheet will
make easier to understand for students and also want students more thinking and
creative how to solve the problems. It also to let student get skill in writing a
Program on Window Environment, Cross Assembled and upload the
programming to a Flight 68K Board. The students will learn and develop skills
on how to program and test the result and the Application Board.
4

1.3.2 E-learning for Third Year Laboratory

There are several main objective involved in this project but the root of
the project is to improve the education standard and performance among the FKE
students. The objective of this e-learning is to develop a system that enhances the
understanding and easier to FKE student get information about laboratory
experiment and improving knowledge about electrical subject. It also provides a
learning platform in which the students read, understand, visualize and try
mastery checks to test their understanding in this particular field.

1.4 Scope of project

1.4.1 Microprocessor Laboratory

The scope in this project is only at microprocessor laboratory. This


project improving the previous labsheet about the ‘Programming the Flight 68K
Board And The Flight Application Board’. The new labsheet contain ten section
or ten experiment about programming Flight 68K Board and Flight Application
Board and easier to understand. The programming base on microprocessor
subject that the students take first and second semester at third year study. The
labsheet also contain how to make a flow chart and answering the questions.
5

1.4.2 E-learning for Third Year Laboratory

The web page is necessary to provide the laboratories information and


laboratory schedule. It also contain the labsheet, organization, activities,
facilities, division group and instruction manual how the uses of the Flight 68K
board and Flight Application Board.
6

START

Learn the function and


application of FLIGHT 68k

Learn the technique and skill


to use FLIGHT 68K

Do the research about


the experiment

Write the programming

Built the labsheet

FINISH

Figure 1.1: Flowchart of Microprocessor Laboratory Project


7

START

CONCEPT

Programming Specification

Design the Programming

Writing Programming (file.asm)

Editing Programming (file.asm)

ERROR?

Assembler
Programming(file.bin)

Run Programming

ERROR?

FINISH

Figure 1.2: Step to write/edit program


8

CHAPTER 2

MICROPROCESSOR

2.1 Motorola’s Microprocessor Evolution

Advances in the very large scale integration (VLSI) technology have made it
possible to fabricate a powerful central processing unit (CPU) into a single-chip
microprocessor. Because so much electronic circuitry is available in a small
microprocessor, it is capable of performing complex tasks at a high speed. The
processing power and complexity of microprocessors have been increasing dramatically,
and this trend is continuing. Figure 2.1 illustrates the rapid growth of Motorola's
microprocessor family. As can be seen from the figure, the growth started from the
MC6800, originally introduced in 1974, to the MC68000 and its derivatives with a
performance improvement of more than 10 times. [1]

The MC6800 is an 8-bit microprocessor in which both data bus and accumulators
are 8 bits wide. Its instructions can operate only on byte operands. In addition to
expanded instruction set and addressing modes, its successor, the MC6809, can perform
16-bit arithmetic operations using a single instruction. However, the data bus of the
9

MC6809 remains 8 bits wide. The MC68000 increases the width of data registers to 32
bits and also expands the data bus to 16 bits. This architectural improvement
substantially increases the speed, especially for 32-bit data operations. Meanwhile, the
maximum memory capacity has been increased to 16 megabytes from the 64 kilobytes
of both MC6800 and MC6809. [1]

In addition to the general-purpose microprocessors, there is another growth path


from MC6800 to MC6802 and MC6801. The processors along this path are called
single-chip microcomputers, or microcontrollers. A typical microcomputer chip, such as
the MC6801, has a CPU, a certain amount of ROM and RAM, a programmable timer, a
serial 1/0 interface, and a parallel 1/0 interface. By integrating these commonly used
peripheral and interfacing devices into a single IC package, a microcomputer chip can
reduce the chip count and simplify the design for microprocessor-based control-type
applications.

The M68000 family consists of several microprocessors, all of which use the same
basic instruction set and machine code formats. Therefore, each microprocessor
maintains upward user code compatibility within the family. The major members of this
microprocessor family and their key features are summarized below. [1]

MC68000: The basic model of the M68000 microprocessor family.


MC68008: An 8-bit version of the MC68000. Since it employs an 8-bit data bus,
MC68008 can be used in a hardware system that was built for an MC6809
with minimal modifications.
MC68010: An enhanced version of the MC68000. The MC68010 has additional
instructions and architectural improvements to support virtual memory
when used in conjunction with a memory management unit.
10

MC68020: The 32-bit member in the family. Both the data and address buses are 32 bits
in width. The MC68020 also has an on-chip instruction cache memory,
and instructions to provide coprocessor interface.
MC68030: An enhanced version of the MC68020. The MC68030 has a virtual memory
management logic and a data cache in addition to the instruction cache.
MC68040: The third generation 32-bit member in the family, The MC68040 includes
separated memory management units for data and instruction, expanded
on-chip caches, and a floating-point arithmetic unit.

Figure 2.1: Motorola’s microprocessor evolution.


11

2.2 Overview of Hardware Organization

A microprocessor based system is composed of a microprocessor, one or more


memory modules, and I/0 peripheral devices, interconnected by a bus, as shown
in Figure. 2.2.

A microprocessor integrates the necessary logic of a general purpose processor into


a single chip, which is able to fetch and execute instructions stored in memory. Among
other logic, a microprocessor has a register set to store temporary data and addresses, a

program counter (PC) to keep the location of the next instruction to be executed, an
instruction register (IR) to hold the current instruction being executed, an arithmetic
logic unit (ALU) to perform the operation as specified in the current instruction, and a
status register (SR) to indicate condition code settings.

A typical instruction takes the microprocessor several steps to execute:

1. Fetch from memory the current instruction to be executed, whose address


is in the program counter, and store it in the instruction register.
Meanwhile, increment the program counter by the instruction length so
that it points to the next instruction to be executed.
2. Decode the operation code of the instruction in the instruction register.
3. Calculate the operand address according to the addressing mode specified
in the instruction.
4. Fetch the operand from memory if a memory operand is required.
5. Perform the required operation.
12

6. Store the result to memory if the destination is in memory.


7. Check for pending interrupt requests. If none, the next instruction is
started by returning to Step 1. Otherwise, an interrupt is processed.

Each step requires one or more clock cycles to complete, with the clock signals being
generated by a clock circuit.

The processor communicates with other system components through the system
bus. Normally, the processor is connected to the bus through a bus interface, which
includes data transceivers, address drivers, and interrupt management logic to resolve
simultaneous interrupt requests.
13

Figure 2.2: Block diagram of microprocessor based system


14

2.2.1 System bus

The system bus is a set of conductors that can be divided into three groups,
the address bus, data bus, and control bus, according to function. Each location in
the memory or each programmable register in an I/0 interface has a unique address
assigned to it. During a data transfer, the processor sends out the address over the
address bus and the data bus is used to transfer the data.

For the MC68000, an I/0 register is accessed as if it were a memory


location. This scheme is commonly known as memory mapped I/0. Since the
MC68000 uses 24 bits to specify an address, the maximum total size of memory
and 1/0 ports is 224 ≈ 16 megabytes.

The data bus of the MC68000 is 16 bits wide. This allows a 16 bit data word
to be transferred in one bus cycle. In addition to a word, the MC68000 can also
read/write a byte (8 bits) or a longword (32 bits) from/to a given address. However,
reading or writing a longword requires two bus cycles.

The control bus is used by the processor to issue a bus command, such as
read or write, and by memory or I/0 devices to return an acknowledge signal. A
typical control bus also provides lines for I/0 devices to send interrupt requests.
15

2.2.2 Memory module

The main memory is normally organized in a modular form, with each


module having its own bus interface logic. A typical system has at least a read only
memory (ROM) module and a read write memory (RAM) module. Since ROM is
nonvolatile, it normally stores a resident monitor or a bootstrap loader so that the
system is ready to run whenever the power is turned on. The user's program and
data are stored in RAM. The high order bits of a memory address determine which
module is to be enabled, whereas the low order bits select the location within the
enabled module.

The MC68000 may access a memory location as a byte, word, or longword.


However, to read or write a word or longword, the address must be even.

2.2.3 I/0 Interface

Peripheral devices such as CRT terminals and printers require an


interface to the system bus, which serves as a buffer. For a commonly used
peripheral device, most of the required interfacing logic is provided by an LSI
(large scale integration) device, called an I/0 interface device. Communication
between the processor and a peripheral device is accomplished via the
programmable registers in the interface. These registers may include an output
data register to hold the data to be transmitted to the peripheral device, an input
data register to receive the data from the peripheral device, a status register to
indicate if the device is ready for a data transfer or an error occurred during data
transfers, and a control register to receive commands from the processor. Each
16

register has an address assigned called an I/O port and is accessed as a memory
location to the MC68000.

2.3 Overview of Software System

2.3.1 Operating system

Figure 2.3 illustrates the major components of a typical software system.


An operating system is a collection of system programs, including a monitor that
is stored on a disk. When the system is turned on, the monitor becomes resident
in the memory. The main functions of the monitor are to supervise the operation
of the system, to manage both the hardware and software resources, and to pro-
vide an interface between the user and the system. The monitor recognizes user
commands and then performs the requested tasks by loading and executing the
appropriate system routines. In addition, a monitor includes file management
routines and 1/0 drivers for system peripheral devices. They allow the user to
simplify I/0 programming and to create, manipulate, and delete files. [1]
17

Figure 2.3: Program development and software organization


18

2.3.2 Language translators

Although a processor can execute instructions only in the binary form


called machine code, a program can initially be written in a symbolic format.
Typically a text editor is employed for creating and modifying such programs.
The resulting program generated from a text editor is stored as an ASCII file
called a source module. The source module is then translated into machine code,
called an object module, by a language translator. An assembler and one or more
compilers, such as FORTRAN and Pascal, are typical language translators
available in a system.

2.3.3 Linker

In order to reduce the development time, a complex program is frequently


broken down into several modules. Each module is independently developed and
tested and perhaps is written in a different language. Some frequently used
routines may be collected as a library file so that they can be shared by many
users.

A linker combines the various object modules of a program into a single


executable file called a load module. As an option, a linker may also produce a
listing showing the loading address assigned to each object module. The load
module produced by the linker is ready to be loaded into memory for execution.
19

CHAPTER 3

ASSEMBLY LANGUAGE PROGRAMMING

3.1 Introduction

A program can be written directly in machine instructions, but it is a tedious


process to code each instruction in binary or even in hexadecimal form. Furthermore, a
program written in machine code is difficult to read and modify. In most cases, assembly
language instructions are in one to one correspondence with machine instructions. With
assembly language, a programmer can use mnemonics for op codes and symbols for
memory locations and operands, thus simplifying the programming. A utility program
called an assembler will then translate (or assemble) the assembly language program
into binary code before the program is executed.
20

3.2 Symbols

Figure 3.1 shows a sample program in assembly language along with the
assembled machine code. In many cases, especially for a multiprogramming system, the
user does not know where the program will be loaded for execution. The assembler can
be directed to assemble a program into relocatable code. In this situation, the assembler
assumes the beginning address of the program to be zero and assigns each instruction an
address that is relative to the program origin. The relative address of each instruction and
the third column gives the machine code. When the program is loaded into memory for
execution, the relative addresses that have been referenced as operands in the program
must be converted to physical or absolute addresses.

Consider that the sample program is to be loaded into memory starting at location
002000 for execution. Now, the symbols ARRAY and SIZE correspond to actual
addresses 002000 and 002030, respectively. Therefore, the immediate operand
#ARRAY in the instruction and the operand address SIZE in the MOVEM instruction
must be adjusted accordingly from the machine code given in Fig. 3-1. Among other
things, a linker performs this relocation operation as follows. [1]
21

1 000000 SECTION 0
2 000000 ARRAY DS.L 12
3 000030 000C SIZE DC.W 12
4 0000 0002 CONST EQU 2
5 000032 227C 0000 0000 START MOVEA.L #ARRAY,A1
6 000038 3238 0030 MOVE.W SIZE,D1
7 00003C 5341 SUBQ.W #1,Dl
8 00003E 4282 CLR.L D2
9 000040 143C 0002 MOVE.B #CONST,D2
10 000044 22C2 LOOP MOVE.L D2,(Al)+
11 000046 D482 ADD.L D2,D2
12 000048 51C9 FFFA DBF D1,LOOP
13 00004C 4E72 2000 STOP #$2000
14 END START

Machine code before relocation

Figure 3.1: A sample assembly language program

The result is given in Figure 3.2 along with a duplicate of the source code for
comparison. The figure also shows the correct machine code if the program is to be
loaded starting at location 032500 for execution. A symbol such as ARRAY and SIZE,
whose associated value (not the content) is relative to the program origin, is called
relocatable. On the other hand, the operand #CONST represents a fixed value 2, which is
not dependent on the location of the program. Such a symbol, whose value will not
change when the program is relocated, is called absolute. For this reason, perhaps a more
appropriate name for absolute addressing mode is direct memory addressing mode.
22

032500 ARRAY DS.L 12


032530 000C S I ZE DC.W 12
0000 0002 CONST EQU 2
032532 227C 0003 2500 START MOVEA.L #ARRAY,Al
032538 3239 0003 2530 MOVE.W SIZE,D1
03253E 5341 SUBQ.W #I,Dl
032540 4282 CLR . L D2
032542 143C 0002 MOVE.B #CONST,D2
032546 22C2 LOOP MOVE.L D2,(Al)+
032548 D482 ADD.L D2,D2
03254A 51C9 FFFA DBF Dl, LOOP
03254E 4E72 2 000 STOP #$2000
END START

Figure 3.2: Machine code after being relocated to 032500.

For a simple system, a user may have control over where to load a program for
execution. In this case the assembler can be directed to assemble the program with its
first instruction starting at a given address. The resulting machine code is called absolute
code; it will execute properly if and only if it is loaded into memory starting at the same
address as specified. Therefore, an absolute code is inflexible as far as memory
allocation is concerned but requires no relocation.

3.3 Assembly Language Statement Format

An assembly language statement has the following general format:

Label Operator Operand, Operand Comment


23

The label field is optional. When present, it is a user defined symbol representing
the address associated with the instruction. This address can then be referenced
symbolically by other instructions in the program. Since a label identifies a particular
statement, the same symbol may not appear in more than one label field. A label, which
may have up to eight alphanumeric characters, must begin in column I with a letter and
be terminated by a space. The comment field is also optional. If present, it begins with a
space which separates the operand and comment fields. If column I of a statement line is
an asterisk *, the entire line is treated as a comment. Comments will be ignored by the
assembler and will not affect program execution. However, they will be shown in the
assembly listing, making the program more readable.

The operator field may contain a mnemonic code for an MC68000 instruction, an
assembler directive also known as a pseudo instruction, or a macro call. For those
instructions that can handle more than one operand size, a postfix is required to specify
the operation size. If a postfix is not given in the operator field, the assembler assumes
the size option to be word. [1]

Symbol Meaning Example


B Byte CLR.B DC.B
W Word MOVE.W DS.W
L Longword MOVE.L DS.L

Table 3.1: The possible operation size postfixes


24

3.4 Assembler Directives

Assembler directives are similar to declarative statements in a typical high level


language in that they are not executed during program execution. Instead, they are used
to instruct the assembler to reserve storage and to invoke certain control functions during
the assembly process.

The ORG (origin) directive sets the program origin. The location counter to the
value evaluated from the operand expression. The statement following the ORG
directive will be assigned the address as specified in the operand field. The machine
code is generated with all addresses being assigned absolute values. Therefore, the
program will execute properly as long as the machine code is loaded into memory
starting from the same location, as specified in the ORG statement. For a simple system,
this absolute programming is typical because no link is required. It is possible for a
program to have more than one ORG directive in order to load a program into several
separate

3.5 Data Movement Group

The MC68000 has a total of 56 instructions and provides nine data transfer
instructions. The instructions in this group are used to load data into a data register or
memory location, to load an address into an address register, and to move status to or
from the status register. Also included in the group are instructions to transfer data to or
from multiple registers.
25

CHAPTER 4

THE FLIGHT 68000

4.1 Introduction

The Flight 68K is designed to provide the perfect introduction to the world of
16/32 bit microprocessors by way of the very popular Motorola MC68000. The Flight
68K is of simple and efficient design and very easy to use. It will enable the newcomer
to the 68000 to quickly get to grips with the subject, leading him along in a clear and
precise manner.

The Flight 68K has been carefully designed to ensure that as the user’s
confidence grows and his applications become more demanding and sophisticated, the
Flight 68K, which includes two serial ports and several 8 bit digital I/0 ports, can grow
still further and expand with him. This is ensured by the on board memory expansion
capabilities and the external expansion bus.
26

On board memory expansion consists of two free 32 pin sockets to which


virtually any type of static byte wide memory may be fitted. Careful attention has been
paid to future trends in memory design to ensure that the Flight 68K can take advantage
of current and future memory technology. The Flight 68000 Microprocessor Board is
show in Figure 4.1

Figure 4.1: Flight 68 000 Microprocessor Board

4.2 Hardware

The Flight 68K is based around the full 16 bit bus version of the 68000 and
contains two devices from the 68000 peripheral families.
27

The MC68681 Dual Universal Asynchronous Receiver/Transmitter provides two


RS232 compatible serial ports, one for communication with a PC/terminal, and the other
for communication with either a host computer, or a printer for producing assembler
listings or hard copy printout of debug sessions etc. The MC68230 Peripheral
Interface/Timer provides 24 peripheral 1/0 lines plus a timer. [2]

Memory consists of three pairs of sockets (byte wide memories must be used in
pairs because of the 16-bit data bus). One pair is for EPROM’s which contain the
monitor and assembler/disassembles firmware, (for turnkey applications these could be
replaced by the user's application firmware).

Another pair of sockets is for RAM. The Flight 68K is supplied with two 8k
RAM's giving a total of l6k bytes. The RAM may be expanded to 256k bytes by using
larger devices. The RAM can be used for data storage or programs. The bottom 1k bytes
are used by the monitor firmware, leaving 15k bytes (255k bytes using larger devices)
free for the user. The third pair of memory sockets is spare and can accept various types
of memory, EPROM or RAM, expanding the total system RAM up to 512K bytes. [2]

The power requirements of the Flight 68K are simply an unregulated 9 volt DC
supply capable of delivering 700mA. The various voltages required by the system are
derived from this on the card.

A 9 Volt 1 Amp mains adapter is supplied with the system.


28

4.3 Firmware

A 64k byte firmware package is provided with the Flight 68K making the board
into a 'mini' development system. It comprises comprehensive monitor, line by line
assembler and disassemble. Demonstration programs for use with the Flight Multi
Applications Board, and test programs to ensure the board is fully functional.

The monitor program provided with the Flight 68K has been made as simple as
possible to use. Each of the 53 different commands available is invoked by a simple two
letter code, no further information has to be provided on the command invocation line.
The monitor is user friendly and easy to use, and does not require many hours of
learning before constructive use of the board can begin.

The occasional user will benefit from the 'help' command which simply lists
each of the commands along with a brief description. In most cases no further reference
to this manual will be required, once the detailed description of the commands has been
studied.

The line by line assembler will be invaluable to the user with just the Flight 68K
and a PC/terminal and no host development system, it accepts 68000

assembler language instructions and assembles them a line at a time, making program
entry simple and quick. For demonstrations and test programs it will even be found
faster and more convenient than using a host computer will full cross software facilities.
29

Using the disassemble, 68000 machine code may be disassembled from


anywhere in memory. The assembler source code may be displayed, or printed out if a
printer is connected.

4.4 System Description

4.4.1 68 000 CPU

The heart of the Flight 68K is the Motorola MC68000 Central Processing
Unit. Block Diagram of the Flight 68K is show in Figure 4.2. This unit has a 16
bit data bus and a 24 bit address bus which is capable of accessing a linear
address space of 16 megabytes. It is driven by a 10 MHz clock generated by a
CMOS oscillator. [2]

A number of other TFL/CMOS chips surround the CPU to provide the


necessary address decoding and other functions necessary to 'glue' the elements
of the board together. The processor is reset automatically at power up, and may
subsequently be reset by pressing switch SWL. The MC68000 processor is fitted
as standard, but the MC68010, which is pincompatible, may also be fitted.
30

4.4.2 EPROM MEMORY

The FLIGHT-68K is fitted with two 27256 32k byte EPROM's which
contain the 64k byte monitor firmware. These sockets can accept 27256 (32k)
and 27512 (64k) EPROM's if the appropriate link is made on LK5. [2]

4.4.3 RAM MEMORY

Two 8k byte RAM memories are fitted to these sockets as delivered,


giving a total of 16k bytes. The bottom 1k byte is used by the monitor firmware,
but the rest is available to the user. This memory may be extended up to a total of
256k bytes. If further RAM memory is needed this may be fitted to the Auxiliary
Memory sockets, the positions in the memory map being adjacent so that the two
blocks of memory are contiguous. [2]

4.4.4 AUXILIARY MEMORY

These two sockets are blank when the Flight 68K is delivered and are for
the user to expand the memory as desired. These sockets will accept static RAM.
Link LK7 must be set to accommodate the particular size of memory it is desired
to use. [2]
31

4.4.5 68230 PERIPHERAL INTERFACEMMER (PI/T)

This LS1 integrated circuit provides digital input/output interfacing as


well as a timer function. No frictions on it are used by the monitor firmware, so it
is freely available for the user. All the I/0 lines are brought out to connector P5,
and the unit may be made to produce vectored interrupts to the processor by
making the appropriate links on LK4.

4.4.6 68681 DUAL ASYNCHRONOUS RECEIVER/TRANSMITTER


(DUART)

This, like the 68230, is another member of the 68000 peripherals family.
It provides two serial interfaces, which are used by the monitor firmware for the
two serial interfaces of the Flight 68K, Port A (P2) and Port B (P3).

Also there are a number of auxiliary input/output lines which are


available to the user, brought out to connector P4, along with a counter/timer
facility. This device too may generate vectored interrupts to the processor if
linked in on LK4. [2]

An on chip clock controlled by a 3.6864Hz crystal is used to derive the


various baud rates available for the serial ports.
32

Clock 10MHz 68000 68230 Digital I/O


Generator CPU PI/T Connector

PORT A

EPROM 32K Bytes PORT B


(upto 128K Bytes)

RS232
Interface

RAM 16K Bytes 68681


(upto 256K Bytes) DUART

Auxiliary I/O
Connector
Auxiliary
RAM 16K Bytes
(upto 256K Bytes)

Expansion
Connector

Power Supplies

Figure 4.2: Block Diagram of the Flight 68K


33

4.5 Flight 68k Application Board

The Flight 68k Application Board provides with an introduction to


computer control. The board is primarily intended for use with the wide range of
Flight Electronics International range of Microprocessor Training Boards. [3]

The Applications Board may also be used with the BBC Micro using a
special cable, and can be interfaced to any IBM compatible PC via a Flight 48
line I/O board. Flight 68k Application Board is show in Figure 4.3.

Figure 4.3: Flight 68k Application Board


34

4.6 Input/Output and Application using Flight 68k Application Board

The board allows digital Input and Output through the PI/T (Parallel
Interface/Timer 68230) device. The PI/T has 3 ports (port A and port B, C), which the
port can be programmed as input or output. The Flight Application Board uses port A as
input and port B as output. [3]

4.6.1 Programming the PI/T

Programming the PI/T is show in Table 4.1. In order to


programming the PI/T, the following address must be use for each
respective register:
Declare this EQUATES (EQU) of the programming.

PACR EQU $80000D *PORT A CONTROL REGISTER


PADDR EQU $800005 *PORT A DATA DIRECTION REGISTER
PADR EQU $800011 *PORT A DATA REGISTER

PBCR EQU $8000OF *PORT B CONTROL REGISTER


PBDDR EQU $800007 *PORT B DATA DIRECTION REGISTER
PBDR EQU $800013 *PORT B DATA REGISTER

Table 4.1: Programming the PI/T


35

4.6.2 Declare the PI/T

Declace that the port A as input and the port B as the output. Declare the
PI/T is show in Table 4.2

MOVE.B #$80,PACR
MOVE.B #$00,PADDR ; SET PORT A AS INPUT
MOVE.B #$80,PBCR
MOVE.B #$FF,PBDDR ; SET PORT B AS OUTPUT

Table 4.2: Declare the PI/T


36

CHAPTER 5

THE TECHNIQUE TO USE FLIGHT 68000

5.1 Theory

5.1.1 Microprocessor Laboratory

Programming The Flight 68K Board and The Flight Application Board
use four main equipment. The equipment is Flight 68K Microprocessor Board,
Flight 68000-MKII Training System User Manual, Flight 68K Application Board
and Microelectronic Application Module User Manual.

5.1.2 The Flight 68K Microprocessor Board

Read the Flight 68000-MK2 User Manual to anything and everything of


the board. Questions will be asked in LABS session.
37

5.1.3 I/0 Theory and Application using Flight 68000 Application Board

The board allows digital Input and Output through the PI/T (Parallel
Interface/Timer 68230) device. The PI/T has 3 ports (port A and port B, C),
which the port can be programmed as input or output. The Flight Application
Board uses port A as input and port B as output. A 40 channel cable is used for
the connection between the PI/T on the Flight Board and the Flight Application
Board. Using SW2, port A can be selected to be connected to the switch or the
A/D. Using SW4 Port B can be selected to be connected to the heater, DAC and
DC Motor. The 8-bit LED is always connected to port B. Refer to the
Microelectronic Application Module User Manual for the complete information.

5.1.4 Function of the select Switches (SW2, SW3 and SW4) on the
Application Board:

PORT A: Input

a) If Input is needed from the SWI Switch:


Set SW2 pin I to – SWITCH
b) A/D
Set SW2 pin 1 to - ADC. Set SW2 to select input
from either VOLT
(VR6), EXT (in terminal of P2), LDR (LDRI) or
TEMP (R120)
38

Output Port B

c) LEDs : (connection are permanent)


d) DC Motor
To enable Motor (M I) movement by software control, set SW2
pin 2 to MOTOR. Data sent to port B will control the motor as
shown in Table 5.1.

Motor #Bit
Movement
7 6 5 4 3 2 1 0
Spins Forward 1 0 x x x x x x
Spins Backward 0 1 x x x x x x
Stop the Motor 0 0 x x x x x x

Table 5.1: Motor Movement

e) Heater (R12):
To control the HEATER (R120 by software, Set SW2 pin 2 to
motor and SW4 pin3 to - HEAT. Data sent to port B will control
the Heater. The heater function is show in Table 5.2.

Heater Function #Bit

7 6 5 4 3 2 1 0
On Heater x x 1 x x x x x
Off Heater x x 0 X X X X X

Table 5.2: Heater Function


39

5.1.5 PI/T Address

The PI/T Address is show in Table 5.3. In order to programming


the PI/T, the following address must be use for each respective register:
Declare this EQUATES (EQU) of the programming.

PACR EQU $80000D *PORT A CONTROL REGISTER


PADDR EQU $800005 *PORT A DATA DIRECTION REGISTER
PADR EQU $800011 *PORT A DATA REGISTER

PBCR EQU $8000OF *PORT B CONTROL REGISTER


PBDDR EQU $800007 *PORT B DATA DIRECTION REGISTER
PBDR EQU $800013 *PORT B DATA REGISTER

Table 5.3: PI/T Address

5.2 Step to write/edit program

a. Open a DOS PROMPT window as show in Figure 5.1. To do so, from


START [Run].... Open dialog box: enter "cmd".

Figure 5.1: Run DOS PROMPT window


40

b. Insert your floppy disc or thumb drive onto PC.

c. Make sure that the directory is by default is C:\flt68k. If not, change the
directory using the command cd\flt68k as show in Figure 5.2 after the
command prompt.

Figure 5.2: DOS PROMPT window

d. To write or edit the program, type the command EDIT <drive


letter>:\fi1ename.ASM as show in Figure 5.3.

Example C: \FLT68K\ >edit a: progl.asm if you are using a floppy disk Example
C:\FLT68K\>edit e: progl.asm if you are using a removable thumb disk which is
at drive E.[2]
41

Figure 5.3: To edit program

e. After writing the program that, SAVE the program.

5.3 Steps to Cross-assemble

a. Open another MS-DOS window. On the prompt C:\FLT68K>, type in the


command "XASM <drive letter>:\PROG1 <drive letter>:\PROG1 <drive
letter>: \PROGI". This command will assemble the file PROGLASM and at
the same time produce PROG1.bin, a binary file (S-format) and PROG1. lst
(listing file).[2]

b. For example enter "XASM A:\PROG1 A:\PROG1 A:\PROG1" if you are


using a floppy disk

c. For example enter "XASM E: \PROGI E: \PROG1 E: \PROG1" if you are


using a thumb disk
42

d. Enter "DIR <drive letter>: \PROG1. *" command to check all the files that
has been created after a successful cross-assembling.

Upload the successfully cross assembled binary code (. BIN S-Format file) into
the Flight 68000 System User Memory.
Print (or copy) the display on the HYPERTERMINAL window, for the steps
taken to upload

5.4 Steps for Uploading a Program

But before you can upload any program, you must have a connection between the
PC standard input/output (keyboard/screen) with the Flight 68K system, software
and hardware wise. [3]

I. Connecting the PC with the Flight 68K system (hardware wise).

a. Connect the power supply to the Flight 68K Board.

b. Connect the serial cable (straight connections cable) between the LK2
connector on the Flight 68K Board and the COM port on the PC.

II. Interacting with the Flight 68K system from the PC (software wise).

a. Run HYPERTERMINAL. BY SELECTING


43

Start all Program Accessories Communication Hyperterminal

b. On the "Connection Description" Dialog box, enter "M68k" or any


name and click OK

c, On the "Connect To" Dialog box select COMI or COM2 depending on


which COM port on the PC the LK2 port on the FIT-68K board is
connected to and select <OK>

d. On the "COM1 properties" or "COM2 properties" Dialog box make the


following selection and click the <OK> button,

III. Resetting the Flight 68K board for initial communication

a. Push the reset button on the once Flight 68K board and press the
ENTER button on the keyboard of the IBM PC 3 times. Make sure that
the HYPERTERMINAL is the active window.

Note: Repeat this step anytime you want to start over any new beginning of Flight
68K command prompt. The User RAM memory content will not be erased.

IV. Step to Upload the S-Format file

a. On the F> prompt (Flight 68K command Prompt), type


LT' to upload the program into the Flight 68000 memory and press
<ENTER> to choose no offset for the uploaded program into the user
44

memory. The default base memory for upload data is $400400. Entering
the offset will allow you to set the base address other than the default
address.

b. Send the PROG.BIN file from the Hyper Terminal to the Flight 68000
memory by choosing Transfer/Send Text File in the Hyper Terminal
Environment as show in Figure 5.4. Wait until the "Load Complete"
appears that indicate the upload process is complete.

Figure 5.4: Hyper Terminal


45

CHAPTER 6

ANALYSIS EXPERIMENT FOR FLIGHT 68000

6.0 Introduction

In this project, about 10 experiments have been done. It contains how to


use and get skills in writing a Program on Windows Environment, Cross
Assembled and upload the program to a Flight 68000 Board. The experiments
also contain about learn and develop skills on how to program and test the result
on the Application Board. Refer the Appendix D for experiment that has been
done.
46

6.1 Analysis Experiment 1

SWITCHES and LED's.

Experiment 1- Using Switches and LED’s

The simplest control functions, are to read the state of a switch (ON or
OFF), and to output a signal to turn on a light (LED). In this chapter we learn to
read the state of the 8 bit DIL Switch (SWI) to be found in the 'OUTPUT
SWITCHES' section and to output data to the 8 colored LED's in the 'LED
OUTPUT' section. The experiment 1 flowchart is show in Figure 6.1

Initialize

Read Switches

Output to
LEDs

Figure 6.1: The experiment 1 flowchart


47

6.2 Analysis Experiment 2

USING THE SWITCHES TO CONTROL A DECISION

Experiment 2- Press Simulation and exit

The DIL switches it is possible to examine the state of the 8 switches, and
make decisions based on the switch pattern, the outcome of the decision can be
indicated by turning on an appropriate LED.

Assume switch bit 0 and switch bit 7 represent two safety interlock
switches on a large mechanical press, only when both these switches are operated
(i.e. safety guards in place) can the press be enabled (indicated by the LSB Green

LED). Disable the press as soon as either switch is broken and indicate by
lighting the MSB red LED. The experiment 2 flowchart is show in Figure 6.2

Initialize

Disable Press

Read Safety Sw

Enable
Both Process
Set?

Figure 6.2: The experiment 2 flowchart


48

6.3 Analysis Experiment 3

DIGITAL TO ANALOGUE CONVERSION (D/A)

Experiment 3- Digital to Analogue Conversion

Using a set of SIN tables for data, output a sine wave in 10 degree steps,
observes the analogue output (at P2 Out) with an oscilloscope and measure its
frequency. The experiment 3 flowchart is show in Figure 6.3.

Initialize

Set table pntr


& Byte count

Get and O/P


byte to DAC

Increment pntr
All
and byte count
done

Figure 6.3: The experiment 3 flowchart


49

6.4 Analysis Experiment 4

MOTOR CONTROL

Experiment 4- Motor Forward/Reverse

A motor can be controlled simply i.e. ON or OFF, when it will either stop
or run at its maximum speed. The experiment 4 flowchart is show in Figure 6.4.

Initialize

Forward

Delay Stop

Reverse

Figure 6.4: The experiment 4 flowchart


50

6.5 Analysis Experiment 5

TEMPERATURE CONTROL

Experiment 5- To Maintain a Constant Temperature

The heater on the Applications Board by outputting Bit 5 on Port B, as


the heater element (R12) heats up, so the voltage output of the temperature
sensor touching it will increase. If we select this output with the analogue
selector switch, then by means of an A/D Converter (see Chap X) we have a
direct measure of temperature. The temperature sensor chosen has an output of
10 mV per degree K.

6.6 Analysis Experiment 6

ANALOGUE TO DIGITAL CONVERSION

Experiment 6- Analogue to Digital Conversion (speeded up)

This program trys bit by bit from zero, and is known as Successive
Approximation. The slowly ascending values can be seen on the LED display,
also this value is represented on the Bargraph if the Bargraph is set 'ON'. The
experiment 6 flowchart is show in Figure 6.5.
51

Initialize

D/A = 0

Compare with
analogue input

Display
FF >
value

Increment D/A

Figure 6.5: The experiment 6 flowchart


52

6.7 Analysis Experiment 7

BARGRAPH

Experiment 7- Bargraph, Using Switches and DAC

The bargraph (U10) is essentially a bank of 10 LED's, it is driven by U11


(LM3914) this device samples a voltage input signal, as the signal exceeds
certain preset levels it will output a signal to light one of the LED's on the
Bargraph, the higher the voltage, the more LED's will be turned on.

6.8 Analysis Experiment 8

TIME SEQUENCES

Experiment 8- Time Delay

It is often necessary to control how long certain actions last, this can be
achieved using software delays, or more accurately by the use of a timer. The
need to time actions is no better illustrated than by Traffic Lights.

The LED's on the application board are nicely arranged in two groups of
4, being Red, Yellow, Green, plus a further Yellow (ideal for a pedestrian
crossing). Using these two sets of four lights we can easily simulate the traffic
lights at a busy cross roads, one set representing the main road, the other set the
minor road.
53

6.9 Analysis Experiment 9

TIME SEQUENCES

Experiment 9 - Traffic Lights with Pedestrian Crossing

The experiment 9 flowchart is show in Figure 6.6.

Initialize
Set Table Base
No. of Entries

Table Data
To LED’s

Use delay from


table

Increment table
pointer

Figure 6.6: The experiment 9 flowchart


54

6.10 Analysis Experiment 10

MEASURING ANALOGUE SOURCES AND USING THE VALUE TO


CONTROL A FUNCTION

Experiment 10 – To Control Light from Ambient

The LDR use to measure ambient light and the LED's to represent the
number of lights turned on. Assume an input value of 16 = I unit of light. Vary
the light falling on the LDR. Also set SW3 to VOLTS and notice how the LED's
vary with variation of VR6. The experiment 10 flowchart is show in Figure 6.7.

Initialize

ADC input

DO
=0

Divide D0/D1
Output value
from table
to LED’s
Add D0 to ptr

Figure 6.7: The experiment 10 flowchart


55

CHAPTER 7

CONCLUSION AND SUGGESTIONS

7.1 Conclusion

Overall, the project of this project that Built an Experiment Module for
microprocessor is reached and full fills the target. All the experiments paper that has
been done is coming from the programming that have done successfully. This project
also has error and weakness while preparing the complete experiments module. Some of
the weakness that is:

• Lack of variability in using the instrumentations monitor in the


experiments including the terminal emulator

• There are less of quality in experiments module such as the figure and
flow charts
56

7.2 Suggestions

• Show the important of using the Flight 68k system as a teaching material
of microprocessor because of it effective and help the students to
understand about microprocessor.

• Make the programming more interesting such as make more the


interactive output on the oscilloscope.

• Project can be done by other student to improve the quality and


performance in Microprocessor Laboratory.
57

CHAPTER 8

E-LEARNING PLATFORM

Educations throughout the world, whether in rural or urban area, increasingly are
considering developing e-learning techniques as part of their academic programs. These
will be the way to conquer the space between lecturers and students. Conquering space
and time, a daunting venture in the past, is becoming more commonplace as computer,
communication and e-learning technologies are being used to bring learning virtually to
any place on earth and at any time.

E-learning is a new way of education. E-learning is not meant to replace


traditional schooling, rather it uses technology to create virtual learning experience that
augments the physical classroom. The latest research and evaluation studies demonstrate
that education improvement program that employs for teaching and learning yield
positive results for students and teachers or lecturers. The positive outcome of these
studies suggests that the future for education can be quite bright if the educations
department maintains its commitment to harnessing technology for education. [7]
58

With sufficient access and support, lecturers will be able to help their students
comprehend difficult to understand concepts in the microprocessor. The lecturers can
provide the students with access to information and resources in the platform and meet
their student's individual needs. If we take advantage of the opportunities presented to
us, technology will enhance learning and improve student achievement for all the
students. [7]

8.1 E-learning Defined

E-learning, distance learning, open learning, distributed learning, and flexible


learning are some of the terms used to describe an educational process in which then
students and the lecturers or teachers are physically separated.

E-learning is a term that has been widely used for the past several years. As all
inclusive term, e-learning has served well the physical separation and synchronous
learning network of teaching and learning (as shown in Figure 8.1). However in recent
years the term has been popular particularly in the World Wide Web. While used
interchangeably, e-learning puts the emphasis on the learner. Indeed the concept has
been popular for all forms of education, distance or otherwise. [7]
59

Figure 8.1: Asynchronous Learning Network

The following proposes one of the most thorough definitions of e-learning,


which includes the following four basic requirements:

• The quasi separation of teacher and learner throughout the period of the
learning process.
• The influence of an educational organization for the planning of courses
of study and preparation of materials, and for providing academic and
students support services.
• The use of technology and media (print or computer) to carry the content
of the course and to provide mechanism for interaction.
• The provision of two communication and interaction.
60

8.2 Advantages of E-learning

Using electronic media for learning and teaching is widespread. E-learning offers
opportunities for lecturers to convey material in a variety of ways and ultimately on
'anytime, anyplace' basis. E-learning materials can range from the simple act of putting
lecture notes on line to simulations of real life. This means that distance learning (both
off and on campus) is a realistic possibility, with students able to take part in class
discussions via email, and at the same time being able to remotely access materials and
information. These materials do not need to be static web pages, as technologies such as
broadband improve audio and video may be made available on a faculty Intranet
allowing students to review material already covered, or prepare for lectures and
tutorials. For example, engineering students may have grouses regarding the high
voltage technology subject, and they can view the visual aids and read notes at the their
own pace and at times which suit them. [7]

Online learning can be beneficial for students with disabilities. For example, a
student unable to attend lectures as a result of a disability may be able to participate via
remote learning. Another example may be in the case of a student with a hearing
impairment who finds it difficult to lip-read and keep up in lectures. The student could
download the lecturer's notes and Macromedia. Flash visual aids (or any other relevant
software) and review the subjects covered.

E-learning can significantly help overcome the lack of resources. Additional


teaching resources will be needed to support the expanding enrollment. The effects of
these two problems will be forced to cut comers by limiting the numbers of classes
offered. E-learning will enable qualified lecturers to share their courses across
61

geographical boundaries, thus allowing universities to provide a wider spectrum of


knowledge.

E-learning is also a convenient learning technique. It can be used anywhere and


anytime as long the user has a computer with Internet connection. It is also a, system
where the consistency of message is implied (everyone gets the, same the same way).
The simulation that is designed in the e-learning platform allows the students to test their
skills as soon as they read the notes. Overall there are only minimum technology
requirements (Internet connected computer and Web browser). [7]

8.3 Learning as Lifeblood

In a society in which information is its lifeblood, nothing is more important than


learning. A planning model for the e-learning platform is very important before it is
started and implemented (as shown in Figure 8.2).
62

Figure 8.2: Model Planning for E-learning

Thus, teaching methods must be held to high standards, whether the classroom is real or
virtual. [7] Web based training is in its infancy, but we know what's needed to make
online learning effective:

• Instruction must include presentation, guided student practice, and


assessment
• Programs must have clear objectives and be relevant, with a problem
solving approach
• Structure is important. Surfing is good for water and the Web, but not
for learning
• Frequent interaction and immediate feedback, both of which can be
built into the software, are key components of good performance.
• Practice, practice, practice. All programs must provide practice
sessions, ranging from simple to complex.
• Variety is the spice of learning. All forms of media; text, graphics,
animation, and audiovisual that can enhance the process.
63

Finally, it is important to remember that instructing is not teaching, and teaching


is not learning. Instructing involves conveying information, while teaching involves
imparting knowledge. All the knowledge in the world is worthless if it is not taught in a
manner that enables the student to learn. This is true that the educators must decide
whether the classroom is in a little red schoolhouse or on a vast network linked by
electrons. These days, finding the best way to teach may be the most important lesson
we can learn.

8.4 The Main Components of the E-learning Platform

Web based learning relies on using the Internet as the primary communications
vehicle for collecting and disseminating instructional resources. Computer workstations
designed to store billions of bytes of information on networks distributed throughout the
world provide the materials, lecturer materials and blackboard illustrations that is
developed in typical course of instructions. These workstations also provide the
communications vehicles through which students and teachers engage in ongoing
discussions on instructional topics. [8]
64

COURSE
LECTURER INTERNET MATERIALS

STUDENT

INTERNET INTERNET

OTHER
RESOURCES

Figure 8.3: Main components of web-based learning.

Figure 8.3 illustrates the main components of the web-based learning, which e-
learning platform for power students. In web based applications, students using a
variety of computer configurations.
65

CHAPTER 9

OPPORTUNITIES TO ENHANCE KNOWLEDGE

Lets use this opportunity to focus on more than wires and screens.

Lets send a message to the country that educators are looking at the delivery of the

education from the perspective of how content will impact students. The internet is

only one tool for learning. It is not a method, it is simply a means.

-John Richards, Turner Learning. Inc

Research has revealed that there are numerous opportunities to enhance learning
through the use of technology, The National Academy of Science report on the new
science of learning, How People Learn: Brain, Mind, Experience, and School, finds that
new and emerging technologies have the potential to enhance learning and the
development of new knowledge in many exciting ways. New and emerging technologies
also offer opportunities to individualize instruction and assessment in promising ways
for all students. [7]
66

9.1 Important Criteria to Enhance Learning

For instance, e-learning can help students visualize difficult to understand


concepts. Such as differentiating heat from temperature. Visualization and modeling
software are similar to the tools used in the workplace, which increases students'
conceptual understanding. Since new technologies are interactive, it is now easier to
create environments in which students can engage in learning, receive feedback, and
continually refine their understanding. [8]

In addition, new technologies provide access to a vast array of information,


including digital libraries, real world data for analysis, and connections to other people
who provide information, feedback and inspiration all of which can enhance the learning
of lecturers and administrators as well as students. Finally, new and emerging
technologies also offer opportunities to individualize instructions and assessments in
promising ways for all students.

9.1.1 To Comprehend Difficult To Understand Concepts.

For many students, the lack of visual representation of many higher-order


concepts makes learning them difficult. In this regard, lecturers have been
limited in what they can teach ‘by the tools to which they have access. New
technologies allow lecturers to teach complex ideas and address intellectual
challenges more easily. In the near future, students who have difficulties
understanding text will be able to access multimedia resources in through the
67

Internet or standalone software, allowing them to better understand the relevant


underlying principles.

Many students find it difficult to make connections between a


mathematical expression and the situation to which it refers. Visual aids, which
can draw graphs and other mathematical objects and allow students to "play"
with them, which can help students, relate mathematical expressions to images in
the "real" world. For instance, software applications can provide tools to analyze
motion as it is captured on a video camera and to create the corresponding graphs
of changes in position or speed over time. Since the visual aids and the graphs
are linked, when the student points with the mouse to a point on the graph, the
corresponding frame of throw, visual aid is displayed. [7]

Exploratory data analysis software (and other visualization techniques)


allows students to see patterns in data they would never glimpse if they had to do
the calculations or even draw the graphs themselves and emphasizing the
meaning of mathematical objects and the beauty of the patterns they exhibit. One
such tool provides students with many ways to look at, and therefore understand
complex and advanced processes. [8]
.

9.1.2 To Engage In Learning

One of the most promising uses of this project in education- involves


lecturers helping students actively engage in learning. In fact, the increasing
power and versatility of computers create teaching and learning possibilities
68

dramatically different from those that was previously available, providing


lecturers with the opportunity to enrich their instruction and students with the
opportunity to contribute useful resources to others. The students will be more
engaged in the subject after visualizing the visual aids. Technology resources and
tools allow students to explore their areas of interest and to investigate topics that
have been mere words in a textbook. E-learning is the tool that made possible
this new approach to learning.

9.1.3 Access to Information and Resources

The Internet, more so than any technology that has preceded it, provides
students with access to a vast array of information and resources far greater than
could ever be provided within the four walls of a classroom. Creative uses of the
Internet allow for the establishment of "virtual" communities of learners,
collectives of lecturers and students from literally around the world assembling
to learn from each other and to tackle real world problems
69

9.2 Important Features of the platform.

There are several important features in this e-learning platform to help the
engineering students to enhance their understanding in the microprocessor. To achieve
this objective several important features have been developed in this e-learning platform.
These features are important to achieve the vision of e-learning in this platform. The
following explains the important features:

i. Reference Module
ii. Programming
iii. Visual

9.3 Important Tools Used in the platform.

There are several tools and methods used in developing this platform. These
tools will be explained the following chapters. The tools are:

i. Macromedia Dreamweaver
ii. Macromedia Flash
iii. Adobe Acrobat
iv. Swift 3D
V. Adobe Photoshop
70

CHAPTER 10

FOUNDATION OF THE PROJECT

Computer or digital technologies incorporate most of the capabilities that allows


for a certain degree of user control. Computer technologies have made significant
progress during the second half of the twentieth century. While complexity still exists,
the mystique of computer technology is evaporating as people use computers in
everyday activities. In e-learning applications, this has had and will continue to have
important ramifications.

As seen in the earlier chapter, referring to the planning model for e-learning, the
important part besides criteria such as goals, evaluation and application, it is the
hardware and software. The software is a very important part to make sure that the goal
of our application is achieved. In this e-learning project I have used Macromedia
Dreamweaver and easyPhP as the foundation of the platform.
71

10.1 EasyPHP

EasyPHP is a combination of common free web server software put together into
an easy to install package. Normally to download and install each separate component
can take a long time, plus is a headache to configure them to work together properly.
Figure 10.1 show about how to run the ‘easyphp setup.exe’ file.

The EasyPHP package for Windows includes the following:

• MySQL Database System - v4.1.9


• Apache Web Server - v1.3.33
• PHP Programming Language - v4.3.10
• PHP MyAdmin Database Interface - v2.6.1

In just one point release, EasyPHP has made many great changes to make using
the package easier. Improved installation, localization, and user interface. The PHP
extension manager works much better. Server configuration files are now kept in a
single easy to find location. This install guide is becoming less of a necessity.

Figure 10.1: Run the 'easyphp setup.exe' file


72

10.1.1 Running EasyPHP

When EasyPHP starts up as show in Figure 10.2, the icon appears in your
system tray. Double click on this icon to open up the EasyPHP status screen, or
right click for more options.

Right clicking on the EasyPHP taskbar icon brings up the shortcut menu
as show in Figure 10.3. This is how to start, stop, and configure EasyPHP and the
servers. [9]

Figure 10.2: EasyPHP starts

Figure 10.3: The shortcut menu


73

10.1.2 PHP Configuration File

10.1.2.1 Error Reporting

This controls which errors PHP cares about, and whether they are
shown to the screen or not. Figure 10.4 show the error reporting.

By default PHP will display ALL errors to the screen. A notice


error can occur during the normal running of a script such as when an
undefined variable is used. Even though it is recommended that
developers pre-define all variables, many third party scripts and code still
do not do it.

10.1.2.2 Register Global

This tells PHP whether or not to set form, url, and cookie
variables as local variables. Prior to PHP this was always done, however
it isn't good for security so they changed it. Figure 10.5 show the register
global.
74

Figure 10.4: Error Reporting

Figure 10.5: Register Global


75

10.1.2.3 EasyPHP Status Program

The status screen is fairly straight forward with only a few buttons
and options. [9] Easyphp status program is show in Figure 10.6

Figure 10.6: EasyPHP Status Program

10.2 Macromedia Dreamweaver MX 2004

Macromedia Dreamweaver MX 2004 as show in Figure 10.7 is a professional


PHP editor for designing, coding, and developing websites, web pages, and web
applications. Dreamweaver provides with helpful tools to enhance the web creation
experience. The visual editing features in Dreamweaver quickly create pages without
writing a line of code. The site elements or assets and drag them from an easy-to-use
panel directly into a document. Macromedia Dreamweaver MX 2004 also enables to
work with visual editor and code editor simultaneously as show in Figure 10.8.
76

Dreamweaver also enables to build dynamic database-backed web applications


using server technologies such as CFML, ASP.NET, ASP, JSP, and PHP. Dreamweaver
MX 2004 contains a new, streamlined interface, along with improved product
performance. There’s also a wide variety of new features that improve usability and help
to build pages whether you are working in the design environment or the coding
environment. [10]

Figure 10.7: Macromedia Dreamweaver MX 2004


77

Figure 10.8: The visual editor and code editor simultaneously.

10.2.1 Easy Text Entry

Although much of the World Wide Web's glitz comes from multimedia
elements such as images and sounds this platform is primarily a text-based
medium. Dreamweaver recognizes this and makes the text cursor at the default
tool. To ad text, just click in the Dreamweaver's main workplace, the document
window and start typing.
78

.10.2.2 Click and Drag Table Setup

Table which enables separate pages to be viewed on a single screen, are


often considered one of the most difficult PHP techniques to master.
Dreamweaver employs click-and-drag method for establishing my
frame-outlines. After the entire layout structure is setup, open the table panel to
select any table and modify it with the property inspector (as shown in Figure
10.9). Dreamweaver also writes the necessary code for linking all the PHP files
in a table, no matter how many pages are used. Dreamweaver keeps frame
creation simple with the table category of the objects panel.

Figure 10.9: Click and Drag Frame Setup


79

10.3 Flash, Swift 3D and Adobe Photoshop

In this project, Macromedia Flash MX as show in Figure 10.10, Swift 3D as


show in Figure 10.11 and Adobe Photoshop particularly to create visual and to enhance
the GUI (Graphical User Interface) of the e-learning platform.. Dreamweaver integrates
very well with Flash, Swift 3D and Adobe Photoshop.

Dreamweaver has improved for integration with the graphics engine, Swift 3D.
Now, images derived from the Flash and Swift 3D is identified as such, both in the
Property Inspector and in the Assets panel. [11]

Figure 10.10: Macromedia Flash MX


80

Figure 10.11: Swift 3D


81

CHAPTER 11

RESULT

To achieve the vision of e-learning, several elements have been developed in this
platform. This e-learning platform has been developed in user friendly interface with
enhanced Graphical User Interface (GUI). In this chapter, the user manual for the e-
learning platform will be explained.

This platform have been specially developed to help microprocessor students to


increase their understanding in the Microprocessor Subject, so this e-learning platform
has been developed to create an easy interface for the students to navigate through the
platform.
82

All the main pages in the platform will be explained clearly in the following
segments. The flowchart on titles and the subtitles is showing in Figure 11.1.Refer the
Appendix C for all e-learning has been done. The main pages of the platform are:

i. Home
ii. Introduction
iii. Organization
iv. Lab Rule
v. Activities
vi. Facilities
vii. User Manual
viii. Experiment
ix. Schedule
x. Division Group
83

E-LEARNING PLATFORM FOR


MICROPROCESSOR LABORATORY

Home Introduction Organization Lab Facilities Activities User Experiment Schedule Division
Rule Manual Group

Main Introduction Organization Rule Equipment Activities A Experiment Schedule 1 1


page 1 1
1 1
FKE
Lab Equipment Activities 2
2 2 B
Rule Experiment Schedule 2
2 Equipment
2
Activities 3
3 3
C
Rule Equipment Activities
4 4
3
84

CHAPTER 12

CONCLUSION

12.1 Summary

E-learning Platform for Microprocessor Laboratory was conceived with the


vision of enhancing the knowledge of students in the Microprocessor. This project was
conceived with the thoughts of learning and educating the students at the same time. A
lot problem can be rectified through this e-learning platform which is beneficial to the
students and the lecturers.

Through this e-learning platform is it also very time and cost effective. To do
corrections, alteration and addition to the lab sheet or the information, the lecturer can
easily do it in the e-learning platform. The technician does not have to print it in this, the
pieces of papers and give to the students. Students just download the lab sheet or any
information about the laboratory from the e-learning. Through this e-learning platform
85

the students can e-mail immediately to the lecturer or technician if their have a problem.
By doing this the students can save time and continue with their work.

This e-learning platform would provide an infrastructure where the students and
lecturers can share knowledge, thoughts and ideas and most importantly share their
knowledge. By enhancing the level of communication, the platform will be able to help
the students to gain more knowledge. With the information that is gained from the
e-learning platform, the students will not face any difficulties during the lab session.

12.2 Problems encountered

What is a system without some problems? To create a system that is stable, the
job of the developer is to make his/her life harder in order to make the life of the user
easier. E-learning Platform for Microprocessor Laboratory' was developed in few
months and among the problems that I accounted was:

• Learning new software developing tools


• Integrating all the tools in the same platform
• Must have a deep understanding in the field to create visual, image and
design.
• No complete guidance throughout the development
• No proper tool to create notes with scientific characters
86

Creating the visual and image was also tedious, because I had to understand the
advanced processes involved first before creating the visual and image. To create
effective visual and image I used Macromedia Flash, Swift 3D and Adobe Photoshop
which is presented with animation. I suffered a great deal of time developing the visual
and in the end it worked out for the best and the visual and image play in the
Macromedia Dreamweaver platform flawlessly

12.3 Benefits

Through the e-learning platform the students will be able to collaborate with the
lecturer or technician to enhance their understanding in the Microprocessor. Enhancing
the student's understanding in this field is able enhance the student's performance in this
particular field. Increased in understanding among the students will be able to create a
quality and qualified graduate in the Microprocessor. Increased level of understanding
and education will make the students able to convey the knowledge during the working
life to the technological needs. With the knowledge in the students, every lecturer aim is
achieved. The learning platform is a great appeal to the world of learners where
education sis the most important element to create future leaders.

In addition to the e-learning platform features, the platform is developed to


support the students as well as the lecturers and the education system as a whole. This
system will not only ease the lecturer's life in preparing materials for the lecture, it will
also help the students to gain some multimedia knowledge.
87

To use this e-learning platform, the students can be at any remote area, and all
the students needs is a computer with Internet connection, which is an anywhere and
anytime basis. The whole learning process is not constrained to their individual
locations, but they can be at any remote area and still use the system.

12.4 Future Enhancements

'E-learning for Microprocessor Laboratory' is by far application, future


enhancements are able to increase e-learning for Microprocessor Student's functionality
and services. This e-learning platform was developed to introduce a new learning
method in the education system. Given more time and more commitment to the projects
other enhancements can be included in the future implementations of e-learning for
Microprocessor Students' for example:

• Student Database System - Allowing the lecturer or technician to keep


all the students results and information according to the semester and the
student's information can be retrieved and kept by the lecturers or the
administrators.

• Better Visual Aids- Better visual aids can be developed by using


Macromedia Flash integrated with Auction Script, showing the
engineering processes in detail.

• Teleconference-A real time system where the students can see the
experiment by using the real time system with the help of audio and
video.
88

• New image transfer format-The image transfer will be flexible to


accommodate images to be transferred between the users.

• Distributed computing - Images can be passed over to more powerful


peers on the network, processed and sent back to the less powerful peers
for viewing
89

REFERENCES

[1] Yu-Cheng Liu. (1991).”The M68000 Microprocessor Family”, First Edition,


Prentice-Hall, Inc

[2] R.F. Coates, updated by Eur Ing. J.H.R. Selby C. M.I.E.E (1997). “The Flight
68K MKII User Manual”. Third Edition, Flight Electronics International
Ltd.

[3] Eur Ing. J.H.R. Selby C. M.I.E.E (1997).”Microelectronics Application


Module”. Third Edition, Flight Electronics International Ltd.

[4] Eur Ing. J.H.R. Selby C. M.I.E.E (1997).”Application Board Experiment


Manual FLT 68K”. Third Edition, Flight Electronics International Ltd.

[5] Muhammad Mun’im Ahmad Zabidi (1998).“Mikropemproses 68000 Bahasa


Himpunan Dan Reka Bentuk Sistem”.Cetakan keempat, Fakulti
Kejuruteraan Elektrik Universiti Teknologi Malaysia.

[6] I.Scott Mackenzie. (1995),”The 68000 Microprocessor”. Second Edition,


Prentice Hall, Inc.

[7] Anthony G.Picciano (1999),”Distance Learning”. Second Edition, McGraw


Hill Publications

[8] Micheal Altenhofen, Joachim Schaper (2000),”Flexible Instruction


Strategies for E-Learning”. Second Edition, Prentice Hall Publications
90

[9] Muhamad Bin Kasan, Nur Syuhadah Bt. Rusni. “Asas Pembangunan Laman
Web dan Laman Web Lanjutan(DINAMIK)”. Space UTM dan Advanced
IT Institute(AITI), Fakulti Sains Komputer dan Sistem Maklumat.

[10] Joseph W.Lowery (2002),”Dreamweaver 4” First Edition, Hungry Minds


Inc.

[11] Sham Bhangal, Amanda Farr, Patrick Rey (2001),”Foundation Flash 5”.
Second Edition, Friends of Ed Publications

[12] Donna L.Baker(2001),”CourseBuilder for Dreamweaver, f/x & Design”


First Edition, Coriolis Publication.
91

APPENDIX A: THE LABSHEET

MICROPROCESSOR LABORATORY
92

OBJECTIVE:

1. To let student get skills in writing a Program on Windows Environment, Cross


Assembled and upload the program to a Flight 68K board.

2. Learn and develop skills on how to program and test the result on the
Application Board.

EQUIPMENT:

1. FLIGHT 68K Microprocessor board.

2. Flight 68000 - MKII Training System User Manual.

3. Flight 68000 Applications Board

4. Microelectronic Applications Module User Manual.

INTRUCTION:

One group will do one of the ten questions which will be assigned by the technician of
the Microprocessor laboratory. Each group is required to confirm with the technician the
questions that will be assigned (and will be recorded).

The group must make the initiative to find the solution of the question give by referring
to the manuals available in the Microprocessor laboratory. Student are free to refer to the
"Application Board Experiment manual" and modify programs from the manual to
accomplish the objective of completing the Laboratory assignment but students are not
allowed to copy programs from other groups. Each group will be interviewed to
determine the originality of the program and final marks will be based on the outcome of
the interview.

Students are required to follow the following procedures


93

Programming the PI/T

In order to program the PI/T, the following address must be used for each respective
register: Declare this EQUATES of your program. Please refer to the Flight 68000-MKII
Training System User Manual

PACR EQU $80000D *PORT A CONTROL REGISTER


PADDR EQU $800005 *PORT A DATA DIRECTION REGISTER
PADR EQU $800011 *PORT A DATA REGISTER

PBCR EQU $8000OF *PORT B CONTROL REGISTER


PBDDR EQU $800007 *PORT B DATA DIRECTION REGISTER
PBDR EQU $800013 *PORT B DATA REGISTER

PREREQUISITES

Students are required to:

1. Refer to the following manual in order to be able complete the design.

a. The FLIGHT 68K MKII User Manual

b. The FLIGHT ELECTRONICS INTERNATIONAL LTD APPLICATION


BOARD EXPERIMENT MANUAL FLT68K

c. MICROELECTRONOCS Application Module User Manual

d. MC68230 Advance Information manual

2. You will have to use your creativity with the theory learned in the SEE 3223
course, and from the above manuals.
94

GENERAL QUESTION
The FLT-68K board

1) What is a single computer board?

2) Give the chip number of the device which is used to store the monitor program.

3) What is the size of the ROM available in the FLT-68K board?

4) Give the chip number of the device which is used for Stack Area.

5) What is the size of the RAM available in the FLT-68K board?

6) Give the initial address of the Top of Stack.

7) Give the chip number of the device which is used for Asynchronous 1/0.

8) Give the chip number of the device Parallel 1/0.

9) What is the command prompt of the FLT-68K board?

10) What is the command which we can use to get the list all available command in the
monitor program together with summary of the command?

11) What do you understand by the word 'upload program'?

12) Determine the memory space on the which you can upload the program assuming
you are going to reserve 1024 byte for the stack?

13) What problem would you expect if you upload program in the memory area from
$4040OOh-$40FFFF?

14) By default when you use the LT command, what is the default starting address of the
memory for the file upload?

15) When you use the LT command, if you enter 100 as the offset, what is the starting
address of the memory for the file upload?

16) What is assembly language?

17) What is machine code?

18) What does an assembler do?


95

19) What does a XASM cross-assembler do?

20) Give the reason why you need upload the 68000 binary file to the FLT-68K board in
order to execute the program?

21) Why don't we just build the program on the program on the FLT-68k board?

22) What is a dumb terminal?

23) The FLT-68K board receives command and display output via a dumb terminal.
How do you connect the dumb terminal to the FLT68K board?

24) What is a terminal emulator?

25) What is the program "hyperterminal" on Windows doing?


96

Question 1

Using Switches and LED’s

The simplest control functions, are to read the state of a switch (ON or OFF), and
to output a signal to turn on a light (LED). In this chapter we learn to read the state of
the 8 bit DIL Switch (SWI) to be found in the 'OUTPUT SWITCHES' section and to
output data to the 8 colored LED's in the 'LED OUTPUT' section.

Refer to the program 2-Application Board Experiment Manual Flight 68K

Write a program, how would you alter the program, so that when a switch is set, the
respective LED goes OFF?

Question 2

Press Simulation and exit

Assume switch bit 0 and switch bit 7 represent two safety interlock switches on a
large mechanical press, only when both these switches are operated (i.e. safety guards in
place) can the press be enabled (indicated by the LSB Green LED). Disable the press as
soon as either switch is broken and indicate by lighting the MSB red LED.

Refer to the program 4-Application Board Experiment Manual Flight 68K

You can only exit from this program by pressing the reset switch on the FLT-68K, Write
a program, how could you make use of one of the other bits on the DIL switch to exit
back to the prompt F>?
97

Question 3

Digital to Analogue Conversion

To convert a digital output from the computer into an Analogue value, for instance you
could generate a series of tones by changing the digital output values in such a way that
the analogue signal represented a sine wave. Using a set of SIN tables for data, output a
sine wave in 10 degree steps, observes the analogue output (at P2 Out) with an
oscilloscope and measure its frequency.

Refer to the program 13-Application Board Experiment Manual Flight 68K

Write a program, how could you vary the frequency in a fairly crude fashion?

Question 4

Motor Forward/Reverse

A motor can be controlled simply i.e. ON or OFF, when it will either stop or run
at its maximum speed.

Refer to the program 16-Application Board Experiment Manual Flight 68K

Write your own routine for a 5 secs Fwd/Rev, then 2 secs pause?
98

Question 5

To Maintain a Constant Temperature

The heater on the Applications Board by outputting Bit 5 on Port B, as the heater
element (R12) heats up, so the voltage output of the temperature sensor touching it will
increase. If we select this output with the analogue selector switch, then by means of an
A/D Converter (see Chap X) we have a direct measure of temperature. The temperature
sensor chosen has an output of 10 mV per degree K.
Ensure HEAT (SW4) is turned off until a temperature control program is running, to
avoid the heater resistor getting very hot.

Refer to the program 20-Application Board Experiment Manual Flight 68K

Switch SW4 MOTOR - ON


Write a program to sound the buzzer on the PC when the temperature exceeds 30
degrees?

Question 6

Analogue to Digital Conversion (speeded up)

This program trys bit by bit from zero, and is known as Successive
Approximation. The slowly ascending values can be seen on the LED display, also this
value is represented on the Bargraph if the Bargraph is set 'ON'.

Refer to the program 20-Application Board Experiment Manual Flight 68K

Write a program, what effect does this have on the total conversion time?
99

Question 7

Bargraph, Using Switches and DAC

The bargraph (U10) is essentially a bank of 10 LED's, it is driven by U11 (LM3914) this
device samples a voltage input signal, as the signal exceeds certain preset levels it will
output a signal to light one of the LED's on the Bargraph, the higher the voltage, the
more LED's will be turned on.

Refer to Application Board Experiment Manual Flight 68K

Write a program as before to read the DIL switches, and output digital values to the
LED's and DAC. The Analogue output of the DAC will be represented by lighting up
the Bargraph. Plot a graph of switch digital value against number of LED's alight on die
Bargraph. What is the average accuracy of die bargraph segment to segment?

Question 8

Time Delay

It is often necessary to control how long certain actions last, this can be achieved using
software delays, or more accurately by the use of a timer. The need to time actions is no
better illustrated than by Traffic Lights.

The LED's on the application board are nicely arranged in two groups of 4, being Red,
Yellow, Green, plus a further Yellow (ideal for a pedestrian crossing). Using these two
sets of four lights we can easily simulate the traffic lights at a busy cross roads, one set
representing the main road, the other set the minor road.

Refer to Application Board Experiment Manual Flight 68K

Explain how you could measure a delay, using the applications board, and a stop watch
and to find suitable values for 10mS, and 100mS?
100

Question 9

Traffic Lights with Pedestrian Crossing

For the traffic lights, first you must determine the sequence of lights, and how long each
sequence is required. A typical busy junction might be:-

Main Road Side Road Bit Value


RED 30 Sees GREEN 30 Sees 10000010
RED 5 Sees AMBER 5 Sees 10000100
RED & AMBER 5 Sees RED 5 Sees 11001000
GREEN 60 See RED 60 Sees 00101000
AMBER 5 Sees RED 5 Sees 01001000
RED 5 Sees RED & AMBER 5 Sees 10001100

The bit value represents the output pattern to turn on the required LED's.

The easy way to carry out a repetitive task is to set all the data up in a table, and advance
through the data step by step, until the end of the table is reached, when it can be
repeated. The table can contain both the required LED pattern, and the time that pattern
is to be maintained.

Refer to the program 9-Application Board Experiment Manual Flight 68K

Using the other yellow LED's (bits 0 and 4) to represent pedestrian crossings (LED on,
when it is safe to cross, and flash during last 5 seconds), generate a new program to
include a pedestrian facility?
101

Question 10

To Control Light from Ambient

The LDR use to measure ambient light and the LED's to represent the number of lights
turned on. Assume an input value of 16 = I unit of light. Vary the light falling on the
LDR. Also set SW3 to VOLTS and notice how the LED's vary with variation of VR6.

Refer to the program 23-Application Board Experiment Manual Flight 68K

SW2 MOTOR - ON, SW3 set to VOLTS, Follow the ideas at the program 23, use the
setting of VR6 to control rotational speed of the motor (hint vary mark space ratio of
motor drive signal). Try for ratios of 10/1 to 10/10?
102

APPENDIX B: ANSWER

GENERAL QUESTION

1) What is a single computer board?

Answer: A computer built on a single board, with the design centered on a


single microprocessor on it, and it is operatable without any additional
board since it has all the basic Memory I/Os and all other features required
to be functional.

2) Give the chip number of the device which is used to store the monitor program.
Answer: 27256

3) What is the size of the ROM available in the FLT-68K board? Answer: 64 Kbytes

4) Give the chip number of the device which is used for Stack Area. Answer: 64256

5) What is the size of the RAM available in the FLT-68K board? Answer: 64 Kbytes

6) Give the initial address of the Top of Stack. Answer: $410000

7) Give the chip number of the device which is used for Asynchronous 1/0.
Answer: MC68681
8) Give the chip number of the device Parallel 1/0. Answer: MC68230

9) What is the command prompt of the FLT-68K board? Answer: F>


103

10) What is the command which we can use to get the list all available command in the
monitor program together with summary of the command? Answer: HE

11) What do you understand by the word 'upload program'? Answer: To load a
program into a memory space in a host computer from a terminal.

12) Determine the memory space on the which you can upload the program assuming
you are going to reserve 1024 byte for the stack? Answer: $400400 to $40FBFF

13) What problem would you expect if you upload program in the memory area from
$4040OOh-$40FFFF? Answer: There is no space for STACK area

14) By default when you use the LT command, what is the default starting address of the
memory for the file upload? Answer: $400400

15) When you use the LT command, if you enter 100 as the offset, what is the starting
address of the memory for the file upload? Answer: $400500

16) What is assembly language? Answer: The mnemonic representation of machine


language i.e. it represent a machine code of a processor in a word so that the
meaning understandable
104

Question 1

PACR EQU $80000D


PADDR EQU $800005
PADR EQU $800011

PBCR EQU $8000OF


PBDDR EQU $800007
PBDR EQU $800013

ORG $400400

INIT MOVE.B #$80, PACR * Set port A as input


MOVE.B #$00, PADDR
MOVE.B #$80, PBCR * Set Port B as output
MOVE.B #$FF, PBDDR
MOVE.B #0, PBDR * turn all O/P's off
READ MOVE.B PADR, D0 * Read the DEL switch (Port A) into DO
EOR.B #$FF, D0 * Exclusive OR with all 1's
MOVE.B D0, PBDR * Output DO to LED's (Port B)
BRA READ * Loop round until reset pressed
END
105

Question 2

PACR EQU $80000D


PADDR EQU $800005
PADR EQU $800011

PBCR EQU $8000OF


PBDDR EQU $800007
PBDR EQU $800013

ORG $400400

INIT MOVE.B #$80, PACR * Set port A as input


MOVE.B #$00, PADDR
MOVE.B #$80, PBCR * Set Port B as output
MOVE.B #$FF, PBDDR
DISABLE MOVE.B #$80, PBDR * Ensure bit 7 set (Red LED ) '0'
INPUT MOVE.B PADR, D0 * Read the DIL switch (Port A) into DO
BTST #3, D0 * check for bit 3 set in DO
BNE EXIT * if bit 3 set then exit
ANDI.B #$81, D0 * mask for two bits interested in
CMPI.B #$81, D0 * check for the two 'safety' bits
BNE DISABLE * if not safe jump and disable press
MOVE.B #$02, PBDR * else enable press (turn on green LED)
BRA I INPUT * Loop round again
EXIT MOVE.B #$80, PBDR * ensure press disabled
TRAP #11 * use trap to exit to prompt
DC.W 0
END
106

Question 3

PACR EQU $80000D


PADDR EQU $800005
PADR EQU $800011

PBCR EQU $8000OF


PBDDR EQU $800007
PBDR EQU $800013

ORG $400400

INIT MOVE.B #$80, PACR * Set port A as input


MOVE.B #$00, PADDR
MOVE.B #$80, PBCR * Set Port B as output
MOVE.B #$FF, PBDDR

TABST MOVEA.L #TABLE, Al * Table Address in A I


MOVE.B #36, D3 * Number of bytes in Table
LOOP MOVE.B (A1)+, PBDR * Send table contents to DAC & Inc Al
SUBQ.L #1, D3 * decrement table size counter
BNE.S LOOP * if not 0 repeat with next table entry
BRA.S TABST * if zero then return to start of table
TABLE DC.B 128 * 0 (128 = 0)
DC.B 148 * 10
DC-B 171 * 20
DC.B 192 * 30
DC.B 210 * 40
DC.B 225 * 50
DC.B 239 * 60
DC.B 248 * 70
DC.B 253 * 80
DC.B 255 * 90 (255 1)
DC.B 253 * 100
DC.B 248 * 110
DC.B 239 * 120
DC.B 225 * 130
DC.B 210 * 140
DC.B 192 * 150
DC.B 171 * 160
DC.B 148 * 170
DC.B 128 * 180 (128 = 1)
DC.B 108 * 190
107

DC.B 85 * 200
DC.B 64 * 210
DC.B 46 * 220
DC.B 31 * 230
DC.B 17 * 240
DC.B 8 * 250
DC.B 3 * 260
DC.B 0 * 270 (0 -1)
DC.B 3 * 280
DC.B 8 * 290
DC.B 17 * 300
DC.B 31 * 310
DC.B 46 * 320
DC.B 64 * 330
DC.B 85 * 340
DC.B 108 * 350
END

This will produce a sine wave output with a frequency of approx 7.7 KHz

Now by adding some NOP instructions into the program loop will slow it down and hence
reduce the frequency. The addition of 3 NOP's will reduce the frequency to approx. 5.8 KHz

A delay loop could be used to slow down the signal even more. No appreciable increase in
speed can be achieved unless die table is reduced to one point every 20 degrees, and the
resultant degradation of the signal is acceptable.
108

Question 4

PACR EQU $80000D


PADDR EQU $800005
PADR EQU $800011

PBCR EQU $8000OF


PBDDR EQU $800007
PBDR EQU $800013

ORG $400400

INIT MOVE.B #$80, PACR * Set port A as input


MOVE.B #$00, PADDR
MOVE.B #$80, PBCR * Set Port B as output
MOVE.B #$FF, PBDDR

MOTON MOVE.B #$40, PBDR * Output forward bit to Port B (Motor)


MOVE.B #5, D2 * for 5 Sec delay
BSR DELAY * Motor runs forward for delay time
MOVE.B #$00, PBDR * Outputs zero and motor stops
MOVE.B #2, D2 * for 2 Sec delay
BSR DELAY * stops for delay time
MOVE.B #$80, PBDR * Output reverse bit
MOVE.B #5, D2 * for 5 Sec delay
BSR DELAY * reverse for delay time
MOVE.B #00, PBDR
MOVE.B #2, D2
BSR DELAY
BRA MOTON * Loop
DELAY MOVE.L #551800, D6 *1 Sec
DEL1 SUBQ.L #1, D6
BNE DEL1
SUBQ.L #1, D2
BNE DELAY
RTS
END
109

Question 5

PACR EQU $80000D


PADDR EQU $800005
PADR EQU $800011

PBCR EQU $8000OF


PBDDR EQU $800007
PBDR EQU $800013

ORG $400400

INIT MOVE.B #$80, PACR * Set port A as input


MOVE.B #$00, PADDR
MOVE.B #$80, PBCR * Set Port B as output
MOVE.B #$FF, PBDDR
MOVE.B #30, D6 * desired temperature

LOOP BSR ADC * get temperature from ADC


MOVE.B D0, D7 * and save in D7
BSR DISPLAY * and display temperature
CNIP.B D7, D6 * check if desired temp.
BHI TEMPLO * No so branch
MOVE.B #$00, PBDR * turn heater OFF
MOVE.B #$07, D0 * Bell code
TRAP #11
DC.W 26 * send bell code to PC
BRA LOOP * repeat

TEMPLO MOVE.B #$20, PBDR * turn heater ON


BRA LOOP * and repeat

ADC MOVE.B PADR, D0 * get value from ADC to DO


MOVE.B PADR, D1 * get value again to DI this time
CMP.B D1, D0 * are they the same
BNE ADC * no then try again
RTS * else return

DISPLAY TRAP #11


DC.W 9 * out2hex
MOVE.B #$0D, D0 * <CR> character
TRAP #11
DC.W 26 * output char (CR)
RTS * and return
END
110

Question 6

PACR EQU $80000D


PADDR EQU $800005
PADR EQU $800011

PBCR EQU $8000OF


PBDDR EQU $800007
PBDR EQU $800013

ORG $400400

INIT MOVE.B #$80, PACR * Set port A as input


MOVE.B #$00, PADDR
MOVE.B #$80, PBCR * Set Port B as output
MOVE.B #$FF, PBDDR

ANAL MOVE.B #07, D1 * value of M.S.B.


MOVE.B #0, D0

ALOOP BSET D1, D0 * move bit def-ined in D I into DO


MOVE.B D0, PBDR * output value to DAC
NOP * wait for D/A to settle
NOP
BTST #3, PADR * test bit 3 of input port
BNE.S LARGE * if bit 3 = '0' then value too large
BCLR D1, D0 * if so then clear bit
LARGE CMPI.B #$00, DI
BEQ.S ANALI * last bit
SUBI.B #1, D1 * next bit
BRA ALOOP
ANALI BSR.S DISPLAY * now display value
BRA ANAL *repeat
DISPLAY TRAP #11
DC.W 9 *out2hex
MOVE.B #$0D, D0 *move <CR> to DO
TRAP #11
DC.W 26 *output character in DO (CR)
RTS *return from subroutine
END

Note use of BTST of input port to check the comparator O/P.

On average the conversion time will be more than halved.


111

Question 7

PACR EQU $80000D


PADDR EQU $800005
PADR EQU $800011

PBCR EQU $8000OF


PBDDR EQU $800007
PBDR EQU $800013

ORG $400400

INIT MOVE.B #$80, PACR * Set port A as input


MOVE.B #$00, PADDR
MOVE.B #$80, PBCR * Set Port B as output
MOVE.B #$FF, PBDDR

READ MOVE.B PADR, DO * Read the DIL switch (Port A) into DO


MOVE.B DO, PBDR * Output DO to LED's (Port B)
BRA READ * Loop round until reset pressed
END

The Bargraph should have an accuracy of + or - I bit.

Typical values are 0, 27,53,79,105,130,156,181,206,231,255


112

Question 8

PACR EQU $80000D


PADDR EQU $800005
PADR EQU $800011

PBCR EQU $8000OF


PBDDR EQU $800007
PBDR EQU $800013

ORG $400400

INIT MOVE.B #$80, PACR * Set port A as input


MOVE.B #$00, PADDR
MOVE.B #$80, PBCR * Set Port B as output
MOVE.B #$FF, PBDDR
MOVE.B #0, PBDR * turn all O/P's off
MOVE.B #$80, PBDR * set red LED
BSR DELAY * go to delay subroutine
MOVE.B #$0, PBDR * now turn LED off
TRAP #11 * exit via trap
DC.W 0
DELAY MOVE.L #8000000, D6 * preload D6 (very long delay)
DELI SUBQ.L #1, D6 * decrement D6
BNE DEL1 * loop round until zero
RTS * return from subroutine
END

Values off approx 55180 for 100mS and 5518 for l0mS should be found.
113

Question 9

PACR EQU $80000D


PADDR EQU $800005
PADR EQU $800011

PBCR EQU $8000OF


PBDDR EQU $800007
PBDR EQU $800013

ORG $400400

INIT MOVE.B #$80, PACR * Set port A as input


MOVE.B #$00, PADDR
MOVE.B #$80, PBCR * Set Port B as output
MOVE.B #$FF, PBDDR

TABST MOVEA.L #TABLE, A1 * Table Address in A I


MOVE.B #18,133 * Number of data bytes in table
LOOP MOVE.B (Al)+, PBDR * Send table contents to LED's & Inc A I
MOVE.B (AI)+, D2 * Time value to D2 & inc Al
BSR DELAY * go to delay sub for time lights on
SUBQ.L #1, D3 * decrement table size counter
BNE.S LOOP * if not 0 repeat with next table entry
BRA.S TABST * if zero then return to start of table
DELAY MOVE.L #551800, D6 * load D6 with a fixed value for I See
DELI SUBQ.L #1, D6 * decrement D6
BNE DELI * if D6 zero, if not jump back to DELI
SUBQ.L #1, D2 * if zero, decrement value passed in D2
BNE DELAY * is D2 zero, if not reload D6 and repeat
RTS * if D2 is zero then exit
TABLE DC.B $82,5 * Red Green 5 Sec
DC.B $92,20 * Red/Yellow Green 20 Sec
DC.B $82,1 * Red Green 1 Sec
DC.B $92,1 * Red/Yellow Green 1 Sec
DC.B $82,1 * Red Green 1 Sec
DC.B $92,1 * Red/Yellow Green 1 Sec
DC.B $82,1 * Red Green 1 Sec
DC.B $84,5 * Red Yellow 5 Sec
DHC.B $C8,5 * Red/Yellow Red 5 Sec
DC.B $29,1 * Green Red/Yellow 1 Sec
DC.B $28,1 * Green Red 1 Sec
DC.B $29,1 * Green Red/Yellow 1 Sec
DC.B $28,1 * Green Red 1 Sec
DC.B $48,5 * Yellow Red 5 Sec
DC.B $8C,5 * Red Red/Yellow 5 Sec
END
114

Question 10

PACR EQU $80000D


PADDR EQU $800005
PADR EQU $800011

PBCR EQU $8000OF


PBDDR EQU $800007
PBDR EQU $800013

ORG $400400

INIT MOVE.B #$80, PACR * Set port A as input


MOVE.B #$00, PADDR
MOVE.B #$80, PBCR * Set Port B as output
MOVE.B #$FF, PBDDR

LOOP MOVE.L #0, D0 * ensure upper bytes in DO = 0


BSR ADC * get analogue value from ADC
CMPI.B #0, D0 * check if DO = 0
BNE.S LOOP1 * if not zero then continue
MOVE.B #I, D0 * else make DO = I
LOOP1 MOVE.L #13, D1 * D1 = 13
DIVS D1, D * divide DO by D I answer in DO
ANDI.L #$000000FF, D0 * keep LSB only
MOVEA.L #TABLE, Al * table address in Al
ADD.L D0, A1 * add DO to Al.
MOVE.B #$80, PBDR turn motor on
MOVE.B #10, D2 * for 10 time units
BSR DELAY
MOVE.B #0, PBDR * turn motor off
MOVE.B (A1), D2 * get table value to D2
BSR DELAY * and wait time pointed to by table
BRA LOOP * repeat
ADC MOVE.B PADR, D0 * get value from ADC to DO
MOVE.B PADR, DI * get value again to DI this time
CMP.B D1, D0 * are they the same
BNE ADC * no then try again
RTS * else return
DELAY MOVE.L #551, D6 * I mS time in D6

DEL1 SUBQ.L #1, D6


BNE DEL1
SUBQ,L #1, D2
BNE DELAY
RTS
115

TABLE DC.B $A * 10 time units


DC.B $9
DC.B $8
DC.B $7
DC.B $6
DC.B $5
DC.B $4
DC.B $3
DC.B $2
DC.B $1 * I time unit

END

SW2 MOTOR - ON
SW3 set to VOLTS
116

APPENDIX C: RESULT FOR E-LEARNING (WEB PAGE)

Figure C1: Introduction


117

Figure C2: Organization


118

Figure C3: Lab Rule

Figure C4: Activities


119

Figure C5: Facilities

Figure C6: User Manual


120

Figure C7: Schedule

Figure C8: Division Group

You might also like