EET 211 - LAB #3 Introduction to the SDK-85 Micro-Computer

Total Page:16

File Type:pdf, Size:1020Kb

EET 211 - LAB #3 Introduction to the SDK-85 Micro-Computer

EET 211 - LAB #1 RAM Memory K. Dudeck

1) Connect a seven segment (common cathode) display to a 74LS48 decoder/driver. Use the pin information for the display as shown on the attached drawing (page 2).

2) Test the display by simulating a BCD input to the driver.

3) This RAM has the capacity to store 16 4-bit binary numbers. The pulser on the counter increments the address of the RAM and displays that address on the four LEDs. The seven segment display shows the value at that memory location. __ 4) When the negative pulser, connected to the WE (write enable), goes low, the value of the four DIP switches is written to the memory location. Try writing your 11 digit student number into the first 11 memory locations on the RAM.

5) Try reading back your lab partner's student number.

6) (Design)-- Using principles learned in this lab, design a memory system which will store and display 32 8-bit numbers. Draw a block diagram of your design and explain how it operates.

LED's (4)

74LS89

4 Bit Counter 4 Each N.O. QA-QD AD A - D > CLK 1 2 PULSER DO 1 - 4 7404

DIP SW (4) DI 1 - 4

N.C. ME 16x4 RAM WE PULSER

7 SEG DECODER g a b a' b' f g a b h a' f' Vcc' b' f GND GND f'

a a' a a' b b' f b f' b' f f' g g

e c e' c' e c e' c' h h' h h' d d' d d'

e d c h e' d' g' e d c Vcc e' d' g' c' h' c' h'

Dual Common Anode (Active Low) Seven Segment Display Dual Common Cathode Seven Segment Display

Use 74LS47 Decoder/Driver Use 74LS48 Decoder/Driver EET 211 - LAB #2 Analog / Digital Conversion K. Dudeck

Microprocessors have the ability to interface to the external world via I/O ports. These I/O ports allow the microprocessor to read input bits (8 in the case of the 8085) from an external source (i.e. switches, sensor) into the microprocessor, or write the contents of a memory location out to an external destination (i.e. LEDs, control surfaces). In either case, the I/O information is DIGITAL, on/off.

Some applications require that the microprocessor deal with analog information. For example, reading the voltage off some circuit element which can range from 0 to 24V. In that case the voltage is not simply on or off, but rather a range of possibilities. An Analog to Digital Converter (ADC) is used to digitize the voltage level to an 8-bit binary number that is proportional to the voltage. Another application may require the microprocessor to drive a voltage signal into a circuit ranging from 0 to 10V. A Digital to Analog Converter (DAC) is needed to accomplish this task.

In this lab you will use an ADC0809 to convert an analog signal from a function generator into an 8-bit binary number. You will also use a DAC08CP to convert an 8-bit binary number into an analog signal that will be displayed on the o-scope. Although in this lab you will not be interfacing the ADC and DAC directly to the microprocessor, future labs will illustrate how digital interfacing is accomplished, which when combined with the concepts learned here, make analog interfacing possible.

Equipment Needed Components Needed

(1) Function generator (1) ADC0809 ADC (1) O-scope with probes (1) DAC08CP DAC (1) TTL designer console (1) LM741 Op Amp (1) +15 -15V power supply (1) 74LS163 4-bit Counter

PART I. Analog to Digital Conversion.

Study the circuit containing the ADC0809, Figure 1, which is found on the next page. Also review the data sheet for the ADC0809, found at the end of this lab write up on page 6. The ADC0809 has the potential of converting 8 different analog channels (pins IN 0 to IN 7) one at a time. The channel that is selected to be converted is determined by the three-bit address input (AD C, AD B, AD A -where AD A is least significant). Figure 1 shows the address selections all grounded and therefore IN 0 is selected.

The reference voltage establishes the lowest (VR-) and highest (VR+) voltages that the input voltage will be compared to. This voltage range is divided into 256 segments. The value that the input voltage nearest compares to will be placed on the data outputs, D7->D0 (or 2-1 -> 2-8).

Figure 1 shows the VR- connected to ground, and the VR+ connected to 5V. This means that 0V will be represented as $00 while 5V is represented as $FF on the data outputs. The resolution of this eight bit ADC is: Resolution = (VR+ - VR-)/256 = (5-0)/256 = 19.5mV .

If the output is $2C, what's the input voltage?

solution: $2C = 2 x 16 +12 = 4410 (Convert to Decimal)

Vin = Output x Resolution = 44 x 0.0195 = 0.858 V

In order for the ADC to operate, the OE must be high, and the ALE and START must pulsed to start a conversion. 5V ADC 0809 11

Vcc 7

EOC N.O.

25 22>> ALE AD A > 24 6 AD B START 23 AD C 330 17 D0 26 14 > ANALOG INPUT IN O D1 9 15 > OE D2 CLOCK 8 > 10 > CLK D3 18 > 12 D4 VR+ 19 > 16 D5 VR- 20 > D6 13 21 > GND D7 >

Figure 1 - Analog to Digital Conversion Procedure:

1) Connect the circuit of figure 1. Connect the four most significant data outputs, D4 -> D7 to the four LEDs. Verify that grounding the IN 0 produces a $0 output, and connecting IN 0 to 5V produces a $F output. The pulser switch must be pulsed to take a new reading.

2) Using the o-scope, set the function generator to a 1Hz sine wave with 5V peak to peak output and a 2.5V DC offset. Connect this signal to the IN 0 pin. While observing the o-scope, sample the voltage at various times along the sine wave.

3) To achieve continuous sampling, disconnect the pulser switch and connect the EOC (End of Convert) output to the START and ALE inputs. PART II. Digital to Analog Conversion.

Study the circuit shown in Figure 2. This circuit uses a DAC08CP Digital to Analog converter chip. The chip takes an 8-bit binary input (B8 -> B1) and converts it to an analog voltage that is in the range of VREF- to VREF+ (in this case, 0 -> +15V). The chip requires the standard power of 5V and GND and additionally a negative supply rail of approximately -15V. In order for the DAC to supply an external analog voltage, it is common practice to use an operational amplifier, such as a LM741 or equivalent, to buffer the DAC output. This is shown in Figure 2. The circuit in Figure 2 will convert any 8-bit binary number to an analog voltage ranging from 0 -> +15V.

Pin diagrams for the DAC08CP and the LM741 are found at the end of this lab, on page 6. +5V +15V

74LS163 DAC 08CP QD 11 5 B1 V+ 13 > 10K QC 12 6 B2 VREF+ 14 2 > CLK > > QB 13 > 7 B3 VREF- 15 QA 14 8 B4 > 10K 9 B5 10 B6 10K 11 B7 12 B8 I out 4 2 7 6 3 OUTPUT

2 I out 4 LM741 1 GND c V- 3

-15V

Figure 2 - Digital to Analog Conversion Vcc

V 7 1 OUT R R/2 R/2 R/2 741 3 Vout(buf f ered) + 6 2 -

R R R R 4 5

V V V V A B C D Procedure

1) Connect the circuit shown in figure 2. Use a 74LS163 counter to drive the four most significant input bits of the DAC. Set the clock input to 10kHz square wave. Connect the output of the LM741 to the o- scope and observe a digitally generated saw-tooth wave. If you expand the time base of the o-scope you will notice that the saw- tooth wave is generated in 16 distinct steps that correspond to the 16 count states of the counter. The voltage steps (resolution) should be approximately 0.93V (15V/16) apart. Sketch carefully what you see taking note to the o-scope sensitivity settings.

2) Measure the frequency of the saw-tooth wave. It should be 1/16th of the clock frequency.

3) See if you can make the waveform smoother by designing an 8-bit counter to drive all 8 data inputs of the DAC, and thus generate 256 steps in the saw-tooth wave. An 8-bit counter can be designed by using the RCO (ripple carry output) of the least significant 4-bit counter into the clock input of the most significant 4-bit counter.

IN3 1 28 IN2 Thres hold Control IN4 2 27 IN1 (V ) 1 16 Com pensation LC IN5 3 26 IN0 I 2 15 V IN6 4 25 ADD A out REF (-)

IN7 5 24 ADD B V - 3 14 VREF (+) START 6 23 ADD C I 4 13 V + EOC 7 22 ALE out 2 -5 8 21 2 -1 MSB B1 5 12 BB (LSB) OUTPUT ENABLE 9 20 2 -2 B2 6 11 B7 CLOCK 10 19 2 -3 -4 V CC 11 18 2 B3 7 10 B6 V (+) 12 17 2 -8 LSB REF B4 8 9 B5 GND 13 16 V REF (-) 2 -7 14 15 2 -6 DAC-08

ADC0808CCN

OFFSET NULL 1 8 NC

INVERTING INPUT 2 7 V +

NON-INVERTING 3 6 OUTPUT INPUT V - 4 5 OFFSET NULL

LM741J EET 211 - LAB #3 Introduction to the SDK-85 Micro-computer K. Dudeck

This lab introduces the SDK-85 micro-computer. The SDK-85 is built around the 8085 microprocessor. The SDK-85 has 2k of ROM that resides at address locations (0000H ->07FFH) and contains the nonvolatile "MONITOR" program.

The monitor program is what allows the user to examine or change RAM memory locations, examine the 8085 internal registers, write machine language programs, or run the programs.

The SDK-85 has 256 available RAM locations the are addressable at locations 2000H -> 20FFH. In addition, the SDK-85 can accommodate an additional expansion RAM, which has been installed, that is addressable at 2800H -> 28FFH. These RAM locations are where the user can place data, or write machine programs.

Procedure:

1) Review Chapter 5 concerning the hardware. At this point in the course, you should be capable of understanding the information presented on the SDK-85 hardware configuration.

2) Review the Operating instructions found in Chapter 4. Complete each of the boxed exercises shown on the next page.

 Substitute Memory Example 1 - This example illustrates how the contents of preprogrammed ROM locations data can be examined.

 Substitute Memory Example 2 - This example illustrates how to place data into RAM locations. This data is actually a machine code program that places a hexadecimal value of 47 into the accumulator.

 Single Step Example - This example shows how to execute a program one instruction at a time.

 Examine Register Examples 1 and 2 - These examples show how to view the various 8085 register contents.

 The Go Example - This program will run the program entered in the Substitute Memory Example 2. SUBSTITUTE MEMORY EXAMPLE 1 SUBSTITUTE MEMORY EXAMPLE 2

Using to list the first few Using to enter a small Monitor locations: program:

KEY ADDR DATA KEY ADDR DATA . 0 0000. 2 0002. 0000 3E. 0 0020. 0001 00. 0 0200. 0002 32. 0 2000. 0003 00. 2000 **. - 3 2000 03. E 2000 3E. 2001 **. < 4 > 2001 04. SINGLE STEP EXAMPLE < 7> 2001 47. Single stepping through the SDK-85 Monitor, this is what you should see on the display: 2002 **. C 2002 0C. KEY ADDR DATA ****. ** F 2002 CF. 8 0008. -

000b. E1 NOTE: **. represents unpredictable values 000C. 22 After loading the above program, use 000F. F5 again to go back and check locations 2000-2002 to see that they 0010. E1 contain: To resume full speed operation at this point, do CORRESPONDING the following: 8085 ASSEMBLY LANGUAGE - ADDRESS DATA INSTRUCTIONS 0010. E1 2000 3E MVI A, 47H -80 85 2001 47 2002 CF RST 1

This program will load the A register with the number 47 and jump back to the monitor. EXAMINE REGISTER EXAMPLE 1 EXAMINE REGISTER EXAMPLE 2

Using to initialize the Using to examine the 8085's stack pointer to 20C2: contents of the 8085's Registers:

KEY ADDR DATA KEY ADDR DATA < 4 > SPH ** A A **. 2 SPH 02. b **. 0 SPH 20. C **. SPL **. d **. C SPL 0C. E **. 2 SPL C2. F **. - I **. H **. L **. SPH **. SPL **. PCH **. PCL **.

or -

NOTE: ** represents the contents of the register whose name is in the address field of the display. GO COMMAND EXAMPLE

Now you can execute the program you entered Recall that this small program loads the A register in example 2 of the command. with the number 47 and restarts the monitor. To First, check to make sure the 3 location program To verify that the A register now holds 47, and to is in memory, then the program will be executed. get more practice using the , try the following sequence:

KEY ADDR DATA COMMENTS KEY ADDR DATA COMMENT 2 0002. A A 47. (A reg now 0 0020. holds 47) 0 0200. 0 A 00. 0 2000. - (Now A holds 2000 3E. MVI A, 47 0) 2001 47.  ****. ** 2002 CF. RST 1 2 0002. - 0 0020. (Run the small < GO > **** ** program again) 2 0002. 0 0200. 0 0020. 0 2000. 0 0200. -80 85 0 2000. -80 85 A A 47 (Now A holds 47 again) NOTE: **** denotes "don't care" values Now try lacing other values in location 2001 using and use to execute the program again, seeing how those values are loaded into the A register after execution.

3) Examine the contents of ROM locations 0200, 0201, and 0202H. You will find values of 2A, F2, and 20H, respectively, in those memory locations. These bytes are part of the "MONITOR" program. Try changing any of these bytes. You will find that you can not. Why? Cycle the power off and on again. Do these memory locations contain the same values? 4) Enter the program for the Program Example - Decimal Counter, which is found on the next page of this handout. This program will display a decimal count. Once the program is running, the count can be stopped by pressing any key on the keypad.

PROGRAM EXAMPLE - DECIMAL COUNTER

ADDR. DATA ASSEMBLY

2000: 31 80 20 LXI SP, 2080H 2003: 3E 08 MVI A, 08 2005: 30 SIM 2006: FB LOOP: EI 2007: 78 MOV A,B 2008: 3C INR A 2009: 27 DAA 200A: 47 MOV B,A 200B: C5 PUSH B 200C: CD 6E 03 CALL UPDDT 200F: 16 18 MVI D,18H 2011: CD F1 05 CALL DELAY 2014: C1 POP B 2015: C3 06 20 JMP LOOP - 20CE: FB EI 20CF: 76 HLT 20D0: C9 RET

1) To execute this program, type 2000 .

2) Try to stop the count exactly at 00 using the key.

3) You can change the speed of the counter by varying the contents of memory location 2010. EET 211 - LAB #4 I/0 and Data Transfer with the SDK-85 K. Dudeck

1) Enter the following program, labeled I/O CONFIG , into your SDK 8085, beginning at address location 2000H .

2000: 3E FF I/O CONFIG: MVI,A FFH 2002: D3 03 OUT 03H 2004: 2F CMA 2005: D3 02 OUT 02H

These instructions will ALWAYS be required to be at the beginning of all your programs which use the ROM I/O ports. Port 02H and port 03H are the data direction control registers for port 00H and port 01H respectively. Therefore, to be consistent with the "hard wired" switches and lights, 00H must always be loaded into port 02H, and a FFH into port 03H.

Now, write a program which continually reads the input port, called SWITCHES, into the SDK-85 micro-computer, which will continuously display the binary result to the output port, called LEDS. You will need to use the JMP instruction to continuously loop, see instruction set for details.

SWITCHES = 00H (input port address) LEDS = 01H (output port address)

3) Run the program to see if it works.

4) Now write an another program which will continuously display the contents of a memory location called MEM, to the output port LEDS. The address of MEM is defined as:

MEM = $03 (SWITCHES) ,

such that the low address byte is current setting of the eight switches on the input port.

5) The program you have written is a pseudo-monitor program that can be used to examine the contents of any ROM location, ranging from 0300 to 03FFH. Record the contents of addresses 0390 to 03BFH using your program. You can verify the results by using the SDK-85 command.

6) Alter the program so that it can examine any RAM location.

Can your program be used to examine itself?

Recommended publications