Interface DAC To A PC: Engineering 4862 Microprocessors
Interface DAC To A PC: Engineering 4862 Microprocessors
Cheng Li
EN-4012
[email protected]
Group B
Port C Lower PC3-PC0
1 = input, 0 = output
Port B
1 = input, 0 = output
Mode Selection
0 = Mode0, 1 = Mode1
Group A
Port C Upper PC7-PC4
1 = input, 0 = output
Port A
1 = input, 0 = output
Mode Selection
00 = Mode0, 01 = Mode1
1x = Mode 2
Engr 4862 Microprocessors
1 = I / O Mode
0 = BSR Mode
D0
D7
D7
A2
System
Address
Bus
IOW
IOR
WR
RD
A0
A1
A0
A1
CS
A7
B
CL
CH
Interface DAC to PC
Example1
Interface MC1480 to Microprocessor through
PPI 8255
Example2
Interface AD558 directly to Microprocessor
Interface MC1480 to
Microprocessor through PPI 8255
Decimal
0
1
15
255
2.56V
0
0.010V
0.150V
2.55V
10V
0
0.039V
0.586V
9.961V
Address Bus
20 - bit
20 - bit
Address
Select
8088
Vout
AD 558
IOSEL5
CS
CE
IOW
DB0 ~ DB7
8 - bit
Data Bus
Engr 4862 Microprocessors
0 ~ 10 V Range
(LSB) DB0
16
Vout
DB1
15
Vout (Sense)
DB2
14
Vout (Select)
DB3
13
GND
DB4
12
GND
DB5
11
+VCC
DB6
10
CS
(MSB) DB7
CE
AD 558
Pin Description
Select
Counter 0
Counter 1
Counter 2
Control Reg.
Example:
Book P. 3-121
(1)Memory/Register Operand to/from Register Operand
(2)
100010dw
mod reg r/m
d = 1: SRC = EA, DEST = REG
d = 0: SRC = REG, DEST = EA d = 1
(3)Byte operation: w = 0
Book P. 6-55, Table 6-20
(4) MOD = 10: memory mode, 16-bit disp follows
Engr 4862 Microprocessors
(5) Format: __ __ A2 39
(6) w = 1, CL REG = 001
(7) MOD = 10, (BX + Disp) R/M = 111
Therefore, the final code is
10001010 10001111 A2 39 8A 8F A2 39
E.g3. 88 95 00 02
Book P. 6-61, Table 6-23
(1) 88 MOV Reg8 / Mem8, Reg8
10001000 Mod Reg R/M Disp_Lo Disp_Hi
d = 0: SRC = Reg, DEST = EA (P. 3-121)
w = 0: byte operation
Displacement: 0200 H
Mod Reg R/M = 1 0 0 1 0 1 0 1
Book P. 6-55
(2) Reg: 010 DL, R/M: 101 (DI) + D16
Therefore, MOV BYTE PTR [DI + 0200H], DL
E.g4.
36 81 8C 8E 00 F4 00
Book P. 6-61, Table 6-23
(1) 36 Segment override prefix: SS
(2) 81 many choices: ADD, OR, ADC, SBB,
xxx Reg16/Mem16, Immed16
(3) 8C help to explain:
10 001 100
Mod Reg R/M:
Reg: 001 OR Reg16/Mem16, Immed16
10000001 mod 001 r/m Disp-Lo Disp-Hi Data-Lo Data-Hi
10
110
Disp (008E)
Data (00F4H)
P. 6-55:
mod: 10, r/m: 110 (BP) + D16
Therefore,
OR WORD PTR [BP + 008EH], 00F4H
Practice Question:
C7 C7 A9 12 3B 47 F4
MOV DI, 12A9H
CMP AX, [BX - 12]
B8 00 02 8E D8 B9 08 00 E2 FE
MOV AX, 0200H
MOV DS, AX
MOV CX, 0008
here: LOOP here
Engr 4862 Microprocessors
About Test2
Friday 9:00 9:50, EN 1040
Bring the Intel 8086/88 Users Manual
Format:
1. Analysis
2. Design
3. Address encoding and decoding
4. Timing
Characteristics
Capacity, Organization, Speed
Examples
256 K memory chip with 8 data pins
Organization: 32K * 8 / Address: 15pins
Memory Fundamentals
In all computer designs, semiconductor memories are
used as primary storage for code and data
Requirement of primary memory Fast in
responding to CPU
Types: RAM and ROM
Memory capacity
The capacity of a memory IC chip is always given in bits
Chip capacity: the number of bits that a chip can store: Kbits, Mbits
Summary
Each memory chip contains 2x locations, x is the number of
address pins on the chip
Each location contains y bits, y is the number of data pins
The entire chip will contain 2x * y bits
Memory Types
ROM (non-volatile)
PROM (Programmable ROM), OTP, need burner or programmer
EPROM (Erasable Programmable ROM), UV-radiation to erase
EEPROM (Electrically erasable programmable ROM)
Advantage: 1. Much quicker, 2. One can select byte to be
erased, 3. One can program/erase while still on board
Memory organization
Memory Types
ROM (non-volatile)
Flash Memory EPROM
Since 1990s
Advantage: the process of erasure of the entire content takes
less than a second, erasure method is electrical
Widely used as a way to upgrade the BIOS ROM of the PC
Mask ROM
The kind of ROM whose contents are programmed by the IC
manufacturer Low cost
RAM (volatile)
Three types: SRAM, DRAM, NV-RAM
Engr 4862 Microprocessors
Memory Chip
Ex1: Find the organization and chip capacity for ROM
Memory Types
RAM (volatile)
SRAM (Static RAM)
Storage cells in SRAM are made of flip-flops and therefore do
not require refreshing in order to keep their data
The problem is that each cell requires at least 6 transistors to
build and the cell holds only one bit data
The capacity of SRAM is far below DRAM
SRAM is widely used for cache memory
DRAM (Dynamic RAM)
The use of a capacitor as a means to store data
Cuts down the number of transistors needed to build cell
However, it requires constant refreshing due to leakage
Memory Types
RAM (volatile)
DRAM (Dynamic RAM)
Advantage:
1. High density (capacity)
2. Cheaper cost per bit
3. Lower power consumption per bit
Disadvantage:
1. Must be refreshed periodically
2. While it is being refreshed, the data can not be accessed
Packaging in DRAM
To reduce the number of pins needed for address, multiplex /
demultiplexing is used
Method is to split the address into half and send in each half
of the address through the same pins requires fewer pins
Internally, DRAM is divided into a square of rows and
columns, the first half of the address is called the row and
the second half is called the column
Organization of DRAM
Most DRAM are x 1 and x 4