Sie sind auf Seite 1von 6

COE 511Microprocessor System

ENGR. ANGELUS VINCENT P. GUILALAS


Experiment No. 1
Review on Development Board
OBJECTIVES
1. To be familiar with the Z86CCP00ZEM CCP Development Board
2. Look into importance of the basic skills and knowledge of learning the development board
and its function.
3. Use this development board to design microprocessor control software.
EQUIPMENTS
Quantity
1
PC with ZDS Software
1
Zilog Z86CCP00ZEM Development Board
1
Zilog Training Module (TM-123)
1
RS 232 Serial Cable
1
Emulation Cable
1
Power Supply
BASIC
Before we start programming we look at the basic circuit for the Z8 microcontroller. Figure 1
shows the basic circuit with crystal. Since we are going to use the Z86CCP00ZEM emulator for our
experiments, we will get the 5V from the emulator but for other modules a separate power supply is
needed. Also the crystal is not necessarily needed because our emulator contains the crystal
oscillator circuit. Make sure to set the jumpers on the emulator properly.

Figure 1.1: Basic Circuit

Laboratory Experiment

Page 1

COE 511Microprocessor System


ENGR. ANGELUS VINCENT P. GUILALAS
HARDWARE
In this lesson, we will be using the Zilog TM-1. This module is active low which means to
activate a LED the MCU should output a logic 0 or we can use an 8-bit LED module connected to the
MCU's PORT2. This LED's are active high which means to activate a LED the MCU should output a
logic 1. Figure 2 shows the schematic.

Figure 1.2: 8-bit Led Module Active High


SOFTWARE
We will be writing a hello world program which blinks the LEDs connected to PORT2. To do this
we follow the program flow chart shown below:

Figure

Laboratory Experiment

1.3

Page 2

COE 511Microprocessor System


ENGR. ANGELUS VINCENT P. GUILALAS

The Init Ports is required to set the ports to inputs or outputs as well as other registers. The
turn on LED will require us to load a low logic level to Port2 in order to lit the LED and loading a high
logic level will turn the LED off. The delay subroutine will make us see the transition between turning
on and turning off because without the delay the LEDs will turn on and off at a very fast rate that our
human eye cannot see.
PROCEDURE
1. Connect the emulation cable to the target module which is the TM-1.
2. Adjust your AC/DC adaptor power supply with the output voltage of 9Vdc/0.5A.
3. Connect it to your target module. The inner conductor is the positive terminal.
4. Make sure that the Vcc pin (J1) on the emulator is not connected if your target module has
its own power supply.
5. Turn on the PC, then the emulator, and finally the TM-1.
6. After setting up the hardware, write the following code below on the ZDS software then
debug it and run the program.
Code:
.org
.word
.word
.word
.word
.word
.word
.org

00h
0
0
0
0
0
0
0ch

; ---------------------------------------------------Initialization----------------------------------------------------di
ld
ld
ld
ld
ld
module.

spl, #80h
p01m, #05h
p2m, #00h
p3m, #01h
rp, #10h

;disable interrupts
;stack pointer is initialized at 80h
;port 0 is configured as input
;port 2 is configured as output
;port 3 is digital, port2 in Push-Pull mode
;register pointer is initialized at 10h ; srp #10h - for active high led

; ---------------------------------------------------Main Loop-----------------------------------------------------start:
ld p2, #11111110b
call delay
ld p2, #11111111b
call delay
jr start

;turn on LED
;call delay subroutine
;turn off LED
;call delay subroutine
;go back to start

; -----------------------------------------------Delay subroutine-------------------------------------------------delay: ld r0, #0ffh


;load r0 and r1 with value to be used for
loop1: ld r1, #0ffh
;down counting, you may play with these values
loop2: djnz r1, loop2 ; decrement and loop until r1 is zero
djnz r0, loop1
;decrement and loop until r0 is zero
ret
;return to main loop
Laboratory Experiment

Page 3

COE 511Microprocessor System


ENGR. ANGELUS VINCENT P. GUILALAS
.end

;end of program

7. Observe the running the code above, which bit of MCUs port2 will lit? __________
______________________________________________________________________________________________________
______________________________________________________________________________________________________
______________________________________________________________________________________________________
____________________

8. After debugging the following code above, change this routine to turn all leds on and off,
connected on PORT 2.

9. Write your code below for procedure no. 8. Using the concept of active low.
______________________________________________________________________________________________________
______________________________________________________________________________________________________
______________________________________________________________________________________________________
______________________________________________________________________________________________________
______________________________________________________________________________________________________
______________________________________________________________________________________________________
______________________________________________________________________________________________________
______________________________________________________________________________________________________
______________________________________________________________________________________________________
______________________________________________________________________________________________________
______________________________________________________________________________________________________
______________________________________________________________________________________________________
____________________________________________________________________________________
Exercise 1. Try using different delay periods to vary the ON and OFF duration of the leds. Write your
code below.
______________________________________________________________________________________________________
______________________________________________________________________________________________________
______________________________________________________________________________________________________
______________________________________________________________________________________________________
______________________________________________________________________________________________________
______________________________________________________________________________________________________
______________________________________________________________________________________________________
______________________________________________________________________________________________________
______________________________________________________________________________________________________
______________________________________________________________________________________________________
Laboratory Experiment

Page 4

COE 511Microprocessor System


ENGR. ANGELUS VINCENT P. GUILALAS
______________________________________________________________________________________________________
______________________________________________________________________________________________________
___________________________________________________________________________________
Exercise 2. What will happen to the 8-bit active high led module shown in figure 1.2 if bit 1, 4, 5 and 7
will lit on? Just shade the circle.

Exercise 3. Write the code below, in executing exercise 2 using active high concept.
______________________________________________________________________________________________________
______________________________________________________________________________________________________
______________________________________________________________________________________________________
______________________________________________________________________________________________________
______________________________________________________________________________________________________
______________________________________________________________________________________________________
______________________________________________________________________________________________________
______________________________________________________________________________________________________
______________________________________________________________________________________________________
______________________________________________________________________________________________________
________________________________________________________________________________
GENERALIZATION

______________________________________________________________________________________________________
______________________________________________________________________________________________________
______________________________________________________________________________________________________
______________________________________________________________________________________________________
______________________________________________________________________________________________________
______________________________________________________________________________________________________
______________________________________________________________________________________________________
______________________________________________________________________________________________________
______________________________________________________________________________________________________
______________________________________________________________________________________________________
______________________________________________________________________________________________________
______________________________________________________________________________________________________
____________________________________________________________________________________

Laboratory Experiment

Page 5

COE 511Microprocessor System


ENGR. ANGELUS VINCENT P. GUILALAS

Laboratory Experiment

Page 6

Das könnte Ihnen auch gefallen