Tải bản đầy đủ (.pdf) (427 trang)

CNTT Ki thuat Vi xu li

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (4.62 MB, 427 trang )

<span class='text_page_counter'>(1)</span>Bài giảng Kỹ thuật Vi xử lý Ngành Điện tử-Viễn thông Đại học Bách khoa Đà Nẵng của Hồ Viết Việt, Khoa ĐTVT Tài liệu tham khảo [1] Kỹ thuật vi xử lý, Văn Thế Minh, NXB Giáo dục, 1997 [2] Kỹ thuật vi xử lý và Lập trình Assembly cho hệ vi xử lý, Đỗ Xuân Tiến, NXB Khoa học & kỹ thuật, 2001.

<span class='text_page_counter'>(2)</span> Chương 1 1.1 Các hệ thống số - Hệ thập phân. - Hệ nhị phân - Hệ thập lục phân. 1.2 Các hệ thống mã hoá - ASCII. - BCD. 1.3 Các linh kiện điện tử số cơ bản - Các cổng logic: AND, OR, XOR,NOT - Các bộ giải mã.

<span class='text_page_counter'>(3)</span> 1.1 Các hệ thống số „ „. Hệ đếm thập phân (Decimal) Còn gọi là hệ đếm cơ số mười. (Vì có quá ít người có chín ngón tay hoặc mười một ngón chân?). „. „. Dùng mười ký hiệu: 1,2,3,4,5,6,7,8,9,0 Ví dụ:1.1: Ba nghìn Chín trăm Bảy mươi Tám 3978 = 3x103 + 9x102 + 7x101 + 8x100 = 3000 + 900 + 70 + 8.

<span class='text_page_counter'>(4)</span> 1.1 Các hệ thống số „ „ „. Hệ đếm nhị phân (Binary) Còn gọi là Hệ đếm cơ số hai Sử dụng hai ký hiệu (bit): 0 và 1 (Các hệ thống điện tử số chỉ sử dụng hai mức điện áp?). „ „ „. Kích cỡ, LSB, MSB của số nhị phân Số nhị phân không dấu (Unsigned) Số nhị phân có dấu (Số bù hai).

<span class='text_page_counter'>(5)</span> Số nhị phân. „. Mỗi ký hiệu 0 hoặc 1 được gọi là 1 Bit (Binary Digit- Chữ số nhị phân) Kích cỡ của một số nhị phân là số bit của nó MSB (Most Significant Bit): Bit sát trái LSB (Least Significant Bit): Bit sát phải. „. Ví dụ 1.1: 1010101010101010. „. „ „. MSB. LSB. là một số nhị phân 16-bit.

<span class='text_page_counter'>(6)</span> Số nhị phân không dấu „. „. „. Chỉ biểu diễn được các giá trị không âm (>= 0) Với n-bit có thể biểu diễn các giá trị từ 0 đến 2n – 1 Ví dụ 1.3: Giá trị V của số nhị phân không dấu 1101 được tính: V(1101) = 1x23 + 1x22 + 0x21 + 1x20 = 8 + 4 + 0 + 1 = 13.

<span class='text_page_counter'>(7)</span> Số nhị phân không dấu „. Tổng quát: Nếu số nhị phân N n-bit: N = b( n-1) b( n-2) …. b1 b0 thì giá trị V của nó là: V = b(n -1) x 2(n-1)+b (n-2) x2 (n-2)+ … + b1 x 21 + b0 x 20. Các số nhị phân không dấu 4-bit biểu diễn được các giá trị từ ? đến ?.

<span class='text_page_counter'>(8)</span> 16 giá trị từ 0 đến 15 Nhị phân không dấu. Giá trị thập phân. 0000. 0. 0001. 1. 0010. 2. 0011. 3. 0100. 4. 0101. 5. 0110. 6. 0111. 7. 1000. 8. 1001. 9. 1010. 10. 1011. 11. 1100. 12. 1101. 13. 1110. 14. 1111. 15.

<span class='text_page_counter'>(9)</span> Số nhị phân không dấu „. „. Dải giá tri của các số không dấu 8-bit là [0,255] (unsigned char trong C) Dải giá tri của các số không dấu 16bit là [0,65535] (unsigned int trong C).

<span class='text_page_counter'>(10)</span> Chuyển đổi thập phân sang nhị phân „. Ví dụ 1.4 Chuyển 25 sang nhị phân không dấu. Dùng phương pháp chia 2 liên tiếp Chia 2. „ „ „ „ „. 25/2 12/2 6/2 3/2 1/2. Thương số. Dư số. 12 6 3 1 0. 1 0 0 1 1. = = = = =. Kết quả là: 11001. LSB. MSB.

<span class='text_page_counter'>(11)</span> Số nhị phân có dấu „ „ „. „. Biểu diễn được cả các giá trị âm Còn gọi là Số bù hai Với n-bit có thể biểu diễn các giá trị từ – 2(n-1) đến 2(n-1) – 1 Ví dụ 1.3: Giá trị V của số nhị phân có dấu 1101 được tính: V(1101) = – 1x23 + 1x22 + 0x21 + 1x20 =–8 + 4 + 0 +1 =–3.

<span class='text_page_counter'>(12)</span> Số nhị phân có dấu „. Tổng quát: Nếu số nhị phân N n-bit: N = b( n-1) b( n-2) …. b1 b0 thì giá trị V của nó là: V = –b(n -1) x 2(n-1)+b (n-2) x2 (n-2)+ … + b1 x 21 + b0 x 20. Các số nhị phân có dấu 4-bit biểu diễn được các giá trị từ ? đến ?.

<span class='text_page_counter'>(13)</span> 16 giá trị từ - 8 đến 7 Nhị phân có dấu. Giá trị thập phân. 0000. 0. 0001. 1. 0010. 2. 0011. 3. 0100. 4. 0101. 5. 0110. 6. 0111. 7. 1000. -8. 1001. -7. 1010. -6. 1011. -5. 1100. -4. 1101. -3. 1110. -2. 1111. -1.

<span class='text_page_counter'>(14)</span> Số nhị phân có dấu „. „. Dải giá tri của các số có dấu 8-bit là [-128,+127] (char trong C) Dải giá tri của các số có dấu 16-bit là [-32768,+32767] (int trong C).

<span class='text_page_counter'>(15)</span> Tìm đối số (Lấy bù 2) „ „. Tổng của một số với đối số của nó bằng 0 Ví dụ 1.5. Đối số của số nhị phân có dấu 10011101?. „ „. 10011101 01100010 + 1 ------------01100011. Số có dấu (-99) Lấy bù 1 Cộng 1 Kết quả. (+99).

<span class='text_page_counter'>(16)</span> Chuyển số thập phân sang nhị phân có dấu „. „. „. Vơí số dương:Giống như chuyển thập phân sang nhị phân không dấu rồi thêm bit 0 vào sát bên trái Ví dụ: Chuyển 25 sang nhị phân có dấu: Kết quả: 011011 Với số âm: Chuyển đối số sang nhị phân có dấu rồi lấy bù 2.

<span class='text_page_counter'>(17)</span> Chuyển số thập phân sang nhị phân có dấu Ví dụ 1.6 Chuyển – 26 sang nhị phân 1. chuyển đối số: +26 = 11010 2. Đưa 0 vào sát trái: 011010 3. Bù 1: 100101 4. Cộng 1: + 1 -------------26 = 100110.

<span class='text_page_counter'>(18)</span> Số thập lục phân „ „ „. „ „. Quen gọi là số Hexa (Hexadecimal) Còn gọi là hệ đếm cơ số mười sáu Sử dụng 16 ký hiệu để biểu diễn: 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F Mỗi ký hiệu tương ứng với 4-bit Mục đích: Biểu diễn số nhị phân ở dạng ngắn gọn 11110000 = F0 10101010. =. AA. 01010101 Nhị phân. =. 55 Thập lục phân.

<span class='text_page_counter'>(19)</span> Mỗi ký hiệu tương ứng với 4-bit Hexa 0 1 2 3 4 5 6 7. Binary 0000 0001 0010 0011 0100 0101 0110 0111. Hexa 8 9 A B C D E F. Binary 1000 1001 1010 1011 1100 1101 1110 1111.

<span class='text_page_counter'>(20)</span> Chuyển đổi Hexa & nhị phân Ví dụ 1.7 Chuyển số hexa 2F8 và ABBA sang nhị phân Thay thế mỗi ký hiệu hexa bằng 4-bit tương ứng với nó 2 F 8 0010 1111 1000 A B B A 1010 1011 1011 1010 „ Kết quả 2F8h = 001011111000b ABBAh = 1010101110111010b „.

<span class='text_page_counter'>(21)</span> Chuyển đổi Hexa & nhị phân „. Ví dụ 1.8 Chuyển số nhị phân 1100101011111110 sang hexa - Trước hết theo hướng từ LSB về MSB chia số nhị phân đó thành các nhóm 4-bit - Sau đó thay thế mỗi nhóm 4-bit bằng ký hiệu hexa tương ứng với nó 1100 C. „. 1010 A. 1111 F. Kết quả: 1100101011111110b. =. 1110 E CAFEh.

<span class='text_page_counter'>(22)</span> 1.2 Các hệ thống mã hoá „ „. ASCII: American Standard Code for Information Interchange. Dùng để biểu diễn các ký tự (characters): Gồm ký tự hiển thị được và ký tự điều khiển. „. Mỗi ký tự được biểu diễn bằng 8-bit gọi là mã ASCII của ký tự đó • • • • •. Các chữ cái in và thường: A..Z và a..z Các chữ số thập phân: 0,1,…,9 Các dấu chấm câu: ; , . : vân vân Các ký tự đặc biệt: $ & @ / { vân vân Các ký tự điều khiển: carriage return (CR) , line feed (LF), beep, vân vân.

<span class='text_page_counter'>(23)</span> Mã ASCII „. Với bảng mã được sắp xếp theo trật tự tăng dần của mã ASCII: • Các chữ số thập phân: 0,1,…,9 nằm liên tiếp nhau, chữ số 0 có mã ASCII là 30h • Các chữ cái in:A..Z nằm liên tiếp nhau, chữ A có mã ASCII là 41h • Các chữ cái thường: a..z nằm liên tiếp nhau, chữ a có mã ASCII là 61h • Mã ASCII của chữ in và chữ thường tương ứng chỉ khác nhau ở bit 5 A: 01000001 B: 01000010 Z: 01011010 z: 01111010 a: 01100001 b: 01100010 • 32 ký tự điều khiển được xếp đầu bảng mã (00h đến 1Fh).

<span class='text_page_counter'>(24)</span> Bảng mã ASCII.

<span class='text_page_counter'>(25)</span> Bảng mã ASCII.

<span class='text_page_counter'>(26)</span> Mã BCD „ „ „. „. „. „. BCD (Binary Coded Decimal) Quen gọi là số BCD Dùng để mã hoá các số thập phân bằng các ký hiệu nhị phân Mỗi chữ số thập phân được biểu diễn bằng một tổ hợp 4-bit Các tổ hợp 4-bit không sử dụng gọi là các tổ hợp cấm Nhiều linh kiện điện tử sử dụng mã này (Bộ giải mã BCD-LED bảy đoạn 7447).

<span class='text_page_counter'>(27)</span> Bảng mã BCD Thập phân 0 1 2 3 4 5 6 7. BCD 0000 0001 0010 0011 0100 0101 0110 0111. Thập phân 8 9. BCD 1000 1001 1010 1011 1100 1101 1110 1111.

<span class='text_page_counter'>(28)</span> Mã BCD „. Đừng nhầm mã hoá BCD với việc chuyển đổi thập phân sang nhị phân: Ví dụ 1.9: Cho số thập phân 15 Mã BCD của nó là:. 00010101. Số nhị phân không dấu 8-bit tương ứng là: 00001111.

<span class='text_page_counter'>(29)</span> Bit, Nibble, Byte, Word „ „ „ „ „ „. „. „. „. Bit: Một chữ số nhị phân 0 hoặc 1 Nibble: 4-bit (nửa byte) Byte: 8-bit (Còn gọi là Octet) Word (Từ): 16-bit Double Word (Từ kép): 32-bit K = 210 = 1024 Kb (kilôbit) = 1024 bit = 128 byte KB (kilôbyte) = 1024 byte Kbps (Kilobit per second): Kilôbit trên giây M = 220 = 1024 K = 1048576 Mb (Mêgabit) = 1024 Kb = 1048576 MB (Mêgabyte) = 1024 KB = 1048576 G = 230 = 1024 M = 1048576 K Gb (Gigabit) = 1024 Mb = 1048576 GB (Gigabyte) = 1024 MB = 1048576 T=?. bit byte Kb KB.

<span class='text_page_counter'>(30)</span> 1.3 Các linh kiện điện tử số cơ bản „. Phân chia linh liện số theo mật độ tích hợp: SSI, MSI, LSI, VLSI. SSI (Small Scale Integration): Vi mạch tích hợp cỡ nhỏ MSI (Medium Scale Integration): Vi mạch tích hợp cỡ trung LSI (Large Scale Integration): Vi mạch tích hợp cỡ lớn VLSI (Very Large Scale Integration):Vi mạch tích hợp cỡ cực lớn „ „ „. SSI: Các cổng logic and, or, xor, not MSI: Các bộ giải mã, Các chốt, đệm LSI,VLSI: Các bộ vi xử lý, vi điều khiển, DSPs.

<span class='text_page_counter'>(31)</span> Cổng logic AND A. B. A AND B. 1. 1. 1. 1. 0. 0. 0. 1. 0. 0. 0. 0. A. A AND B. B Cổng AND có thể có nhiều hơn 2 đầu vào Trên một chip có thể có nhiều cổng AND.

<span class='text_page_counter'>(32)</span> Cổng logic AND: IC 7408.

<span class='text_page_counter'>(33)</span> Cổng logic AND: IC 7411.

<span class='text_page_counter'>(34)</span> Cổng logic OR A 1. B 1. A OR B 1. 1. 0. 1. 0. 1. 1. 0. 0. 0. A. A OR B. B Cổng OR có thể có nhiều hơn 2 đầu vào Trên một chip có thể có nhiều cổng OR.

<span class='text_page_counter'>(35)</span> Cổng logic OR: IC 7432.

<span class='text_page_counter'>(36)</span> Cổng logic XOR A 1. B 1. A XOR B. A. 0. B. 1. 0. 1. 0. 1. 1. 0. 0. 0. A XOR B. Cổng XOR có thể có nhiều hơn 2 đầu vào Trên một chip có thể có nhiều cổng XOR.

<span class='text_page_counter'>(37)</span> Cổng logic NOT A. NOT A. 1. 0. 1. 0. 0. 1. 0. 1. A. NOT A.

<span class='text_page_counter'>(38)</span> Đệm 3 trạng thái. c 0 1. z HiZ x. c 1 0. z HiZ x.

<span class='text_page_counter'>(39)</span> Chip giải mã 74138.

<span class='text_page_counter'>(40)</span> Chip giải mã 74138.

<span class='text_page_counter'>(41)</span> Flip Flop kiểu D.

<span class='text_page_counter'>(42)</span> Flip Flop kiểu D.

<span class='text_page_counter'>(43)</span> Flip Flop kiểu D.

<span class='text_page_counter'>(44)</span> Flip Flop kiểu D.

<span class='text_page_counter'>(45)</span> Chốt 8-bit 74373.

<span class='text_page_counter'>(46)</span> Chốt 8-bit 74573.

<span class='text_page_counter'>(47)</span> IC 74244.

<span class='text_page_counter'>(48)</span> IC 74244.

<span class='text_page_counter'>(49)</span> Đệm 2 chiều 74245.

<span class='text_page_counter'>(50)</span> Đệm 2 chiều 74245.

<span class='text_page_counter'>(51)</span> Bài giảng Kỹ thuật Vi xử lý Ngành Điện tử-Viễn thông Đại học Bách khoa Đà Nẵng của Hồ Viết Việt, Khoa ĐTVT Tài liệu tham khảo [1] Kỹ thuật vi xử lý, Văn Thế Minh, NXB Giáo dục, 1997 [2] Kỹ thuật vi xử lý và Lập trình Assembly cho hệ vi xử lý, Đỗ Xuân Tiến, NXB Khoa học & kỹ thuật, 2001.

<span class='text_page_counter'>(52)</span> Chương 2. Vi xử lý và Hệ thống vi xử lý 2.1 Bộ vi xử lý - Bộ vi xử lý (Microprocessor) là gì? - Các thành phần của bộ vi xử lý. - Ứng dụng của bộ vi xử lý. 2.2 Các họ vi xử lý - Họ x86 của Intel- Luật Moore. - Họ 68x của Motorola. 2.3 Hệ thống vi xử lý -. Bộ nhớ Các cổng I/O Bus hệ thống: D-Bus, A-Bus, C-Bus Thiết kế hệ thống vi xử lý?.

<span class='text_page_counter'>(53)</span> 2.1 Bộ vi xử lý „. „. „. Một bộ vi xử lý là một mạch tích hợp chứa hàng ngàn, thậm chí hàng triệu transistor (LSI, VLSI) được kết nối với nhau Các transistor ấy cùng nhau làm việc để lưu trữ và xử lý dữ liệu cho phép bộ vi xử lý có thể thực hiện rất nhiều chức năng hữu ích Chức năng cụ thể của một bộ vi xử lý được xác định bằng phần mềm (có thể lập trình được).

<span class='text_page_counter'>(54)</span> Bộ vi xử lý „. „ „. „. Bộ vi xử lý đầu tiên của Intel,4004, được giới thiệu vào năm 1971. 4004 chứa 2300 transistor. Bộ vi xử lý Pentium 4 hiện nay chứa 55 triệu transistor. Bộ vi xử lý thường được sử dụng trong các máy vi tính (microcomputer) với vai trò là CPU. Ngoài ra, chúng còn có mặt ở nhiều thiết bị khác..

<span class='text_page_counter'>(55)</span> Các thành phần của bộ vi xử lý.

<span class='text_page_counter'>(56)</span> ALU và Control Unit ALU „ Thực hiện các phép toán logic (AND, OR, XOR, NOT) và các phép toán số học (cộng, trừ, nhân, chia) „ Thực hiện việc chuyển dữ liệu „ Việc thực hiện lệnh thực sự diễn ra ở ALU Control Unit „ Có trách nhiệm liên quan đến việc tìm và thực hiện các lệnh bằng cách cung cấp các tín hiệu điều khiển và định thời cho ALU và các mạch khác biết phải làm gì và làm khi nào..

<span class='text_page_counter'>(57)</span> Các thanh ghi (Registers) „. „. „. „. Thanh ghi là nơi mà bộ vi xử lý có thể lưu trữ được một số nhị phân (Kích cỡ của thanh ghi tính bằng bit) Bộ vi xử lý dùng các thanh ghi để lưu trữ dữ liệu tạm thời trong quá trình thực hiện chương trình Các thanh ghi có thể được truy cập bằng các câu lệnh ngôn ngữ máy thường được gọi là các thanh ghi người sử dụng có thể nhìn thấy được (có thể truy cập được) Các thanh ghi điều khiển và các thanh ghi trạng thái được CU dùng để điều khiển việc thực hiện chương trình. Đa số các thanh ghi này người sử dụng không thể nhìn thấy được.

<span class='text_page_counter'>(58)</span> 2.2 Các họ vi xử lý „. „. „. „. Hiện nay, có rất nhiều nhà sản xuất ra các chip vi xử lý:Intel, AMD, Motorola, Cyrix … Thông thường, một họ vi xử lý là các chip vi xử lý được sản xuất bởi một nhà sản xuất nào đó. Trong phạm vi một họ vi xử lý, theo thời gian và theo công nghệ chế tạo có các đời (thế hệ) vi xử lý khác nhau phân biệt theo Độ dài Từ của chúng (bit) và tốc độ (Hz). Độ dài Từ (Word Length) của một chip vi xử lý là kích cỡ tối đa của các toán hạng nhị phân mà nó có thể thực hiện các phép toán trên đó..

<span class='text_page_counter'>(59)</span> Tốc độ của họ vi xử lý x86 của Intel The Continuing Evolution of Intel Microprocessors CIS105 December 2002 1600 1,400 1400. Speed (MHZ). 1200 1000 800 550. 600 400. 400. 400. 1998. 1999. 333. 200. 200. 200. 233. 1993. 1995. 1997. 100 0.74. 2. 8. 12. 33. 1971. 1974. 1979. 1982. 1985. 0 1989. Year. 1998. 1999. 2000.

<span class='text_page_counter'>(60)</span> Họ vi xử lý x86 của Intel Model 4004 8008 8080 8086 80286. Năm sản xuất 1971 1972 1974 1978 1982. Số lượng Transistor 2,300 2,500 5,000 29,000 120,000. 80386™ processor. 1985. 275,000. 80486™ DX processor Pentium® processor Pentium II processor Pentium III processor Pentium 4 processor. 1989 1993 1997 1999 2000. 1,180,000 3,100,000 7,500,000 24,000,000 55,000,000.

<span class='text_page_counter'>(61)</span> Họ vi xử lý x86 của Intel 70’s Introduced Clock Speeds Bus Width Number of Transistors Addressable Memory Virtual Memory Brief Description. 4004. 8008. 8080. 8086. 11/15/71 108KHz 4 bits 2,300 (10 microns) 640 bytes -First microcomputer chip, Arithmetic manipulation. 4/1/72 200KHz 8 bits 3,500 (10 microns) 16 KBytes -Data/character manipulation. 4/1/74 2MHz 8 bits 6,000 (6 microns) 64 KBytes -10X the performance of the 8008. 6/8/78 5MHz, 8MHz, 10MHz 16 bits 29,000 (3 microns) 1 MB -10X the performance of the 8080.

<span class='text_page_counter'>(62)</span> Họ vi xử lý x86 của Intel 80’s. Introduced Clock Speeds Bus Width Number of Transistors Addressable Memory Virtual Memory Brief Description. 80286. Intel386TM DX Microprocessor. Intel386TM SX Microprocessor. 2/1/82 6MHz, 8MHz, 10MHz, 12.5MHz 16 bits 134,000 (1.5 microns). 10/17/85 16MHz, 20MHz, 25MHz, 33MHz 32 bits 275,000 (1 micron). 6/16/88 16MHz, 20MHz, 25MHz, 33MHz 16 bits 275,000 (1 micron). 16 megabytes 1 gigabyte 3-6X the performance of the 8086. 4 gigabytes 64 terabytes First X86 chip to handle 32-bit data sets. 16 megabytes 64 terabytes 16-bit address bus enabled low-cost 32-bit processing. Intel486TM DX CPU Microprocessor 4/10/89 25MHz, 33MHz, 50MHz 32 bits 1.2 million (1 micron) (.8 micron with 50MHz) 4 gigabytes 64 terabytes Level 1 cache on chip.

<span class='text_page_counter'>(63)</span> Họ vi xử lý x86 của Intel 90’s. Introduced Clock Speeds Bus Width Number of Transistors Addressable Memory Virtual Memory Brief Description. Intel486TM SX Microprocessor. Pentium® Processor. Pentium® Pro Processor. Pentium® II Processor. 4/22/91 16MHz, 20MHz, 25MHz, 33MHz 32 bits 1.185 million (1 micron) 4 gigabytes 64 terabytes Identical in design to Intel486TM DX but without math coprocessor. 3/22/93 60MHz,66MHz. 11/01/95 150MHz, 166MHz, 180MHz, 200MHz 64 bits 5.5 million (0.35 micron) 64 gigabytes 64 terabytes Dynamic execution architecture drives high-performing processor. 5/07/97 200MHz, 233MHz, 266MHz, 300MHz 64 bits 7.5 million (0.35 micron) 64 gigabytes 64 terabytes Dual independent bus, dynamic execution, Intel MMXTM technology. 64 bits 3.1 million (.8 micron) 4 gigabytes 64 terabytes Superscalar architecture brought 5X the performance of the 33-MHz Intel486TM DX processor.

<span class='text_page_counter'>(64)</span>

<span class='text_page_counter'>(65)</span> 2.3 Hệ thống vi xử lý.

<span class='text_page_counter'>(66)</span> Luật Moore. Dr. Gordon E. Moore, Chairman Emeritus of Intel Corporation, dự đoán rằng Cứ một năm rưỡi thì số lượng transistor được tích hợp trên chip vi xử lý tăng gấp đôi.

<span class='text_page_counter'>(67)</span> 2.3 Hệ thống vi xử lý Address Bus. I/O Ports. MEMORY Microprocessor Data Bus. Control Lines (Control Bus). Sơ đồ khối chức năng của một hệ thống vi xử lý.

<span class='text_page_counter'>(68)</span> Hệ thống vi xử lý „. „. „. Gồm 3 khối chức năng: Vi xử lý, Bộ nhớ, Các cổng I/O Bộ nhớ được thực hiện bằng các chip nhớ bán dẫn ROM hoặc RWM, là nơi lưu trữ chương trình và dữ liệu. Đối với vi xử lý, bộ nhớ là một tập hợp các ô nhớ phân biệt theo địa chỉ của chúng. Các cổng I/O được thực hiện bằng các chip MSI hoặc LSI, là phần mạch giao tiếp giữa vi xử lý với các thiết bị I/O. Bộ vi xử lý cũng phân biệt các cổng I/O theo địa chỉ của chúng..

<span class='text_page_counter'>(69)</span> Hệ thống vi xử lý „. „. „. 3 khối chức năng: Vi xử lý, Bộ nhớ, Các cổng I/O của một hệ thống vi xử lý trao đổi tín hiệu với nhau thông qua Bus hệ thống. Bus hệ thống là một tập hợp các đường truyền dẫn dùng chung, bao gồm: Bus địa chỉ (A-Bus), Bus dữ liệu (D-Bus) và Bus điều khiển (C-Bus) Các tín hiệu địa chỉ di chuyển trên A-Bus theo hướng từ vi xử lý đến Bộ nhớ và các cổng I/O. Số lượng đường truyền dẫn của A-Bus (gọi là Độ rộng của A-Bus) tính bằng bit, phản ánh khả năng quản lý bộ nhớ của chip vi xử lý..

<span class='text_page_counter'>(70)</span> Hệ thống vi xử lý „. „. Các tín hiệu dữ liệu di chuyển trên D-Bus theo cả 2 hướng từ vi xử lý đến Bộ nhớ và các cổng I/O và ngược lại (mỗi lúc một hướng). Số lượng đường truyền dẫn của DBus (gọi là Độ rộng của D-Bus) tính bằng bit, phản ánh một phần tốc độ trao đổi dữ liệu của chip vi xử lý vớI các khối chức năng khác. Đa số các tín hiệu trên C-Bus là các tín hiệu điều khiển riêng lẽ, có tín hiệu xuất phát từ vi xử lý, có tín hiệu đi vào vi xử lý. Vi xử lý sử dụng các tín hiệu này để điều khiển hoạt động và nhận biết trạng thái của các khối chức năng khác..

<span class='text_page_counter'>(71)</span> Thiết kế phần cứng của hệ thống vi xử lý „. „. Thiết kế bộ nhớ cho hệ thống vi xử lý: Ghép nối các chip nhớ bán dẫn sẵn có với bus hệ thống sao cho khi bộ vi xử lý truy cập bộ nhớ thì không xảy ra xung đột giữa các chip nhớ với nhau và không xung đột với các chip dùng làm cổng I/O Tương tự, Thiết kế các cổng I/O cho hệ thống vi xử lý: Ghép nối các chip MSI hoặc LSI thường dùng làm cổng I/O với bus hệ thống sao cho khi bộ vi xử lý truy cập các thiết bị I/O thì không xảy ra xung đột giữa các chip đó với nhau và không xung đột với các chip dùng làm bộ nhớ.

<span class='text_page_counter'>(72)</span> Thiết kế phần mềm của hệ thống vi xử lý „. „. „. „. „. Viết chương trình điều khiển hoạt động của hệ thống phần cứng theo chức năng mong muốn (thường dùng ngôn ngữ Assembly của chip vi xử lý dùng trong hệ thống) Dịch chương trình đã viết sang ngôn ngữ máy sử dụng các chương trình dịch thích hợp Nạp chương trình ngôn ngữ máy vào bộ nhớ của hệ thống vi xử lý Kiểm tra hoạt động của hệ thống và thực hiện các hiệu chỉnh nếu cần thiết Có thể nhờ sự trợ giúp của các chương trình mô phỏng trên máy tính.

<span class='text_page_counter'>(73)</span> Bay giảng Kỹ thuật Vi xử lý Ngành Điện tử-Viễn thông Đại học Bách khoa Đà Nẵng của Hồ Viết Việt, Khoa ĐTVT. Tài liệu tham khảo [1] Kỹ thuật vi xử lý, Văn Thế Minh, NXB Giáo dục, 1997 [2] Kỹ thuật vi xử lý và Lập trình Assembly cho hệ vi xử lý, Đỗ Xuân Tiến, NXB Khoa học & kỹ thuật, 2001.

<span class='text_page_counter'>(74)</span> Chương 3 Vi xử lý 8088-Intel 3.1 Kiến trúc và hoạt động của 8088 - Nguyên lý hoạt động - Sơ đồ khối chức năng 3.2 Cấu trúc thanh ghi của 8088 3.3 Phương pháp quản lý bộ nhớ 3.4 Mô tả tập lệnh Assembly.

<span class='text_page_counter'>(75)</span> Nguyên lý hoạt động của một bộ vi xử lý. Lấy - Giải mã - Thực hiện lệnh. Tìm và copy các byte lệnh từ bộ nhớ. Tạo ra các tín hiệu điều khiển để thực hiện lệnh. Giải mã lệnh.

<span class='text_page_counter'>(76)</span> Chu kỳ lệnh và Chu kỳ máy • Chu kỳ lệnh: Tổng thời gian tìm lệnh, giải mã lệnh và thực hiện 1 lệnh • Nói chung, Chu kỳ lệnh của các lệnh khác nhau là khác nhau • Chu kỳ lệnh bao giờ cũng bằng một số nguyên lần chu kỳ máy • Chu kỳ máy bằng nghịch đảo của tần số hoạt động (tốc độ đồng hồ) của bộ vi xử lý.

<span class='text_page_counter'>(77)</span> 3.1 Kiến trúc và Hoạt động của 8088.

<span class='text_page_counter'>(78)</span> Đơn vị giao tiếp Bus - BIU • Phát các tín hiệu địa chỉ đến bộ nhớ và các cổng I/O thông qua A-Bus • Đọc mã lệnh từ bộ nhớ thông qua D-Bus • Đọc dữ liệu từ bộ nhớ thông qua D-Bus • Ghi dữ liệu vào bộ nhớ thông qua D-Bus • Đọc dữ liệu từ các cổng I thông qua D-Bus • Ghi dữ liệu ra các cổng O thông qua D-Bus.

<span class='text_page_counter'>(79)</span> Đơn vị thực hiện - EU • Bao gồm CU và ALU • CU : Giải mã lệnh để tạo ra các tín hiệu điều khiển nhằm thực hiện lệnh đã được giải mã • ALU: thực hiện các thao tác khác nhau đối với các toán hạng của lệnh.

<span class='text_page_counter'>(80)</span> Tổ chức của microprocessor CPU Control registers. ALU BIU Control. Control Address Data. General purpose registers. Status Registers.

<span class='text_page_counter'>(81)</span> Xử lý lệnh của các vi xử lý trước 8086/8088. • Một thủ tục đơn giản gồm 3 bước: – Lấy lệnh từ bộ nhớ – Giải mã lệnh – Thực hiện lệnh • Lấy các toán hạng từ bộ nhớ (nếu có) • Lưu trữ kết quả. Fetch 1. Busy. Decode 1. Idle. Execute 1. Busy. Fetch 2. Busy. Decode 2. Idle. Execute 2. ….... Busy. ….... Microprocessor. Bus.

<span class='text_page_counter'>(82)</span> Cơ chế Pipelining P ip e lin in g. F e tc h 1. F e tc h 2 D ecode 1. F e tc h 3. F e tc h 4. S to r e 1. D ecode D ecode D ecode 2 3 4. Exec. 1. Exec. 2. Exec. 3. M e m o ry re q u e s t. F e tc h 5 Id le. Exec. 4. F e tc h 6. Load 2. D ecode D ecode 5 6. IdIdlele. Exec. 5. M e m o ry re q u e s t. Bus. … .... F e tc h 7 Id le. Decode 7. Exec. 6. Id le. … .... Exec. 7. In s tr u c tio n U n it. E x e c u tio n U n it.

<span class='text_page_counter'>(83)</span> 3.2 Cấu trúc thanh ghi của 8088 8088 có 14 thanh ghi 16-bit.

<span class='text_page_counter'>(84)</span> Cấu trúc thanh ghi của họ x86 General Purpose Special Registers Accumulator. AH. AL AX. EAX BL. Flags. BX CH. CL CX. Data. DL DX. EDX. FLAG. SP. ESP. Base Pointer. BP. EBP. Segment Registers. Dest Index. DI EDI. ECX DH. Stack Pointer. EFLAG. EBX. Count. IP EIP. BH. Base. Index Registers. Instr Pointer. CS. Code Segment. DS. Data Segment. ES. Extra Segment. SS. Stack Segment. FS GS. Source Index ESI. SI.

<span class='text_page_counter'>(85)</span> Cấu trúc thanh ghi 8086/8088 7. Accumulator Base Counter Data. 0. 7. AL BL CL DL. AH BH CH DH 15. Code Segment Data Segment Stack Segment Extra Segment. Destination Index. AX BX CX DX 0. CS DS SS ES 15. Instruction Pointer Stack Pointer Base Pointer Source Index. 0. 0. IP SP BP SI DI. }. } }.

<span class='text_page_counter'>(86)</span> Các thanh ghi đa năng 7. Accumulator Base Counter Data. 0. AH BH CH DH. 7. 0. AL BL CL DL. AX BX CX DX. - Có thể truy cập như các thanh ghi 8-bit. - Lưu trữ tạm thời dữ liệu để truy cập nhanh hơn và tránh khỏi phải truy cập bộ nhớ - Có công dụng đặc biệt đối với một số câu lệnh.

<span class='text_page_counter'>(87)</span> Các thanh ghi segment 15. Code Segment Data Segment Stack Segment Extra Segment. 0. CS DS SS ES. - Lưu trữ địa chỉ segment của một ô nhớ cần truy cập. - Kết hợp với các thanh ghi offset nhất định.

<span class='text_page_counter'>(88)</span> Các thanh ghi offset Instruction Pointer Stack Pointer Base Pointer Source Index Destination Index. IP SP BP SI DI. - Lưu trữ địa chỉ offset của một ô nhớ cần truy cập. - Kết hợp với các thanh ghi segment nhất định.

<span class='text_page_counter'>(89)</span> Thanh ghi cờ 15. x. 0. x. x. x OF DF IF TF SF ZF x AF x PF x CF. - Không phải tất cả các bit đều được sử dụng - Mỗi bit được sử dụng được gọi là một cờ - Các cờ đều có tên và có thể được Lập/Xoá riêng lẽ - Bao gồm các cờ trạng thái và các cờ điều khiển.

<span class='text_page_counter'>(90)</span> Flags register AC (Alignment check) (VM) Virtual mode (RF) Resume (NT) Nested task (IOPL) Input/output privilege level (O) Overflow (D) Direction (I) Interrupt (T) Trace (S) Sign (Z) Zero (A) Auxiliary Carry (P) Parity (C) Carry 8086, 8088, 80186. 80286. 80386, 80486DX 80486SX.

<span class='text_page_counter'>(91)</span> 3.3 Phương pháp quản lý bộ nhớ - Bộ nhớ được xem là một tập hợp các ô nhớ - Mỗi ô nhớ được nhận dạng bằng một Địa chỉ vật lý duy nhất 20-bit - Trong hoạt động truy cập một ô nhớ, Địa chỉ vật lý của nó được tạo ra từ hai giá trị 16-bit: Địa chỉ segment và Địa chỉ Offset - Địa chỉ logic = Địa chỉ segment:Địa chỉ offset.

<span class='text_page_counter'>(92)</span> Mối liên hệ giữa ĐCVL và ĐCLG A=Bus. 19. 0 Địa chỉ vật lý. 15. 0. Thanh ghi offset.. 15. 0 Thanh ghi Segment. 0000.

<span class='text_page_counter'>(93)</span> 3.4 Mô tả tập lệnh Assembly của 8086/8088 - Khuôn dạng: Mnemonics Các toán hạng - Nhóm lệnh chuyển số liệu - Nhóm lệnh số học - Nhóm lệnh logic - Nhóm lệnh Rẽ nhánh - Nhóm lệnh thao tác string - Nhóm lệnh hỗn hợp.

<span class='text_page_counter'>(94)</span> Nhóm lệnh chuyển số liệu Data Transfer Instructions -Chuyển số liệu (sao chép số liệu) từ vị trí này sang vị trí khác - Nguồn số liệu không thay đổi - Đich sẽ có giá trị như giá trị của Nguồn - Các lệnh chuyển số liệu không ảnh hưởng đến các cờ trạng thái trên thanh ghi cờ - Một số lệnh tiêu biểu: MOV, XCHG.

<span class='text_page_counter'>(95)</span> Data Transfer Instructions - MOV Khuôn dạng: MOV Đích,Nguồn - Tác dụng: (Đích) Å (Nguồn) - Đích: có thể là: 1. Một thanh ghi 8 hoặc 16 bit của VXL 2. Một vị trí nhớ (1 hoặc 2 ô nhớ liên tiếp nhau). -. Nguồn: có thể là:. 1. Một thanh ghi 8 hoặc 16 bit của VXL 2. Một vị trí nhớ (1 hoặc 2 ô nhớ liên tiếp nhau) 3. Một giá trị cụ thể.

<span class='text_page_counter'>(96)</span> Một số lưu ý đối với MOV - Đích và Nguồn phải có cùng kích cỡ - Đích và Nguồn không thể đồng thời thuộc bộ nhớ - Nếu Đích là một thanh ghi segment của VXL thì Nguồn không thể là một giá trị cụ thể (nói cách khác, không thể nạp giá trị trực tiếp cho một thanh ghi segment bằng lệnh MOV).

<span class='text_page_counter'>(97)</span> Data Transfer Instructions - XCHG. Khuôn dạng: XCHG T/h1,T/h2 - Tác dụng: (T/h1) Å (T/h2) - T/h1: có thể là: 1. Một thanh ghi 8 hoặc 16 bit của VXL 2. Một vị trí nhớ (1 hoặc 2 ô nhớ liên tiếp nhau). -. T/h2: có thể là:. 1. Một thanh ghi 8 hoặc 16 bit của VXL 2. Một vị trí nhớ (1 hoặc 2 ô nhớ liên tiếp nhau).

<span class='text_page_counter'>(98)</span> Một số lưu ý đối với XCHG - T/h1 và T/h2 phải có cùng kích cỡ - T/h1 và T/h2 không thể đồng thời thuộc bộ nhớ - T/h1 và T/h2 không thể là các thanh ghi segment.

<span class='text_page_counter'>(99)</span> Các mode địa chỉ - Khi thực hiện lệnh, VXL sẽ thực hiện những thao tác nhất định trên số liệu, các số liệu này được gọi chung là các toán hạng. - Các toán hạng trong một câu lệnh có thể là một phần của câu lệnh (ở dạng mã máy), có thể nằm ở một thanh ghi của VXL hoặc ở Bộ nhớ -Cách xác định toán hạng trong các câu lệnh được gọi là các mode (định) địa chỉ.

<span class='text_page_counter'>(100)</span> Các mode địa chỉ - Mode địa chỉ thanh ghi: MOV AX,BX - Mode địa chỉ tức thì: MOV AL,55h - Các mode địa chỉ bộ nhớ: Các cách thức xác định địa chỉ vât lý của toán hạng nằm trong bộ nhớ: Mode địa chỉ trực tiếp Các mode địa chỉ gián tiếp ….

<span class='text_page_counter'>(101)</span> Mode địa chỉ trực tiếp (Direct Addressing Mode).

<span class='text_page_counter'>(102)</span> Mode địa chỉ gián tiếp thanh ghi (Register Indirect Addressing Mode).

<span class='text_page_counter'>(103)</span> Mode địa chỉ cơ sở-chỉ số (Based-Indexed Addressing Mode).

<span class='text_page_counter'>(104)</span> Nhớ các mode địa chỉ bộ nhớ như thế nào?. BX. SI. BP. DI. DISP. • Tất cả bắt đầu trong bảng sau đây:. • Lấy ra 0 hoặc 1 phần tử từ mỗi cột • (Không lấy 2 phần tử từ một cột) • Phải lấy ít nhất 1 phần tử từ bảng.

<span class='text_page_counter'>(105)</span> Các ví dụ Instruction. Comment. Addressing Mode. Memory Contents. MOV AX, BX. Move to AX the 16-bit value in BX. Register. 89 D8. OP. MODE. MOV AX, DI. Move to AX the 16-bit value in DI. Register. 89 F8. OP. MODE. MOV AH, AL. Move to AL the 8-bit value in AX. Register. 88 C4. OP. MODE. MOV AH, 12h. Move to AH the 8-bit value 12H. Immediate. B4 12. OP. DATA8. MOV AX, 1234h. Move to AX the value 1234h. Immediate. B8 34. OP. DATA16. MOV AX, CONST. Move to AX the constant defined as CONST. Immediate. B8 lsb msb. OP. DATA16. MOV AX, X. Move to AX the address or offset of the variable X. Immediate. B8 lsb msb. OP. DATA16. MOV AX, [1234h]. Move to AX the value at memory location 1234h. Direct. A1 34 12. OP. DISP16. MOV AX, [X]. Move to AX the value in memory location DS:X. Direct. A1 lsb msb. OP. DISP16.

<span class='text_page_counter'>(106)</span> Các ví dụ Instruction. Comment. Addressing Mode. Memory Contents. MOV [X], AX. Move to the memory location pointed to by DS:X the value in AX. Direct. A3 lsb msb. OP. DATA16. MOV AX, [DI]. Move to AX the 16-bit value pointed to by DS:DI. Indexed. 8B 05. OP. MODE. MOV [DI], AX. Move to address DS:DI the 16-bit value in AX. Indexed. 89 05. OP. MODE. MOV AX, [BX]. Move to AX the 16-bit value pointed to by DS:BX. Register Indirect. 8B 07. OP. MODE. MOV [BX], AX. Move to the memory address DS:BX the 16-bit value stored in AX. Register Indirect. 89 07. OP. MODE. MOV [BP], AX. Move to memory address SS:BP the 16-bit value in AX. Register Indirect. 89 46. OP. MODE. MOV AX, TAB[BX]. Move to AX the value in memory at DS:BX + TAB. Register Relative. 8B 87 lsb msb. OP. MODE. DISP16. MOV TAB[BX], AX. Move value in AX to memory address DS:BX + TAB. Register Relative. 89 87 lsb msb. OP. MODE. DISP16. MOV AX, [BX + DI]. Move to AX the value in memory at DS:BX + DI. Base Plus Index. 8B 01. OP. MODE.

<span class='text_page_counter'>(107)</span> Các ví dụ Instruction. Comment. Addressing Mode. Memory Contents. MOV [BX + DI], AX. Move to the memory location pointed to by DS:X the value in AX. Base Plus Index. 89 01. OP. MODE. MOV AX, [BX + DI + 1234h]. Move word in memory location DS:BX + DI + 1234h to AX register. Base Rel Plus Index. 8B 81 34 12. OP. MODE. MOV word [BX + DI + 1234h], 5678h. Move immediate value 5678h to memory location BX + DI + 1234h. Base Rel Plus Index. C7 81 34 12 78 56. DISP16.

<span class='text_page_counter'>(108)</span> Mã máy. Một lệnh có thể dài từ1 đến 6 byte • Byte 1 gồm:. – Opcode (6 bit) xác định phép toán cần thực hiện – Bit D xác định toán hạng ở REG của Byte 2 là nguồn hay đích: 1: Đích 0: Nguồn – Bit W xác định kích cỡ của toán hạng là 8 bit hay 16 bit 0: 8 bit 1: 16 bit • Byte 2 gồm:Mode field (MOD), Register field (REG) Register/memory field (R/M field).

<span class='text_page_counter'>(109)</span> Anatomy of an instruction Opcode. D W. OPCODE. MOD. REG. R/M. Mode. Displacement. Data/Immediate. • Opcode contains the type of instruction we execute plus two special bits, D and W • The mode byte is used only in instructions that use register addressing modes and encodes the source and destination for instructions with two operands • D stands for direction and defines the data flow of the instruction – D=0, data flows from REG to R/M – D=1, data flows from R/M to REG. • W stands for the size of data – W=0, byte-sized data – W=1, word (in real mode) or double-word sized (in protected mode).

<span class='text_page_counter'>(110)</span> Anatomy of an instruction Opcode. Mode. D W. OPCODE. MOD. REG. R/M. • • • • • •. Displacement. Data/Immediate. MOD field specifies the addressing mode 00 – no displacement 01 – 8-bit displacement, sign extended 10 – 16-bit displacement 11 – R/M is a register, register addressing mode If MOD is 00,01, or 10, the R/M field selects one of the memory addressing modes.

<span class='text_page_counter'>(111)</span> Registers in the REG and R/M fields Code. W=0 (Byte). W=1 (Word). W=1 (DWord). 000. AL. AX. EAX. 001. CL. CX. ECX. 010. DL. DX. EDX. 011. BL. BX. EBX. 100. AH. SP. ESP. 101. CH. BP. EBP. 110. DH. SI. ESI. 111. BH. DI. EDI.

<span class='text_page_counter'>(112)</span> Example • • • • • • •. Consider the instruction 8BECh 1000 1011 1110 1100 binary Opcode 100010 -> MOV D=1 data goes from R/M to REG W=1 data is word-sized MOD=11, register addressing REG=101 destination, R/M=100 source • MOV BP, SP. Code. W=0. W=1. W=1. 000. AL. AX. EAX. 001. CL. CX. ECX. 010. DL. DX. EDX. 011. BL. BX. EBX. 100. AH. SP. ESP. 101. CH. BP. EBP. 110. DH. SI. ESI. 111. BH. DI. EDI.

<span class='text_page_counter'>(113)</span> Displacement addressing • If MOD is 00, 01, or 10 R/M has an entirely different meaning MOD. FUNCTION. R/M Code. Function. 000. DS:BX+SI. 001. DS:BX+DI. 010. SS:BP+SI. Examples:. 011. SS:BP+DI. If MOD=00 and R/M=101 mode is [DI]. 100. DS:SI. If MOD=01 and R/M=101 mode is [DI+33h]. 101. DS:DI. 110. SS:BP. If MODE=10 and R/M=101 modes is [DI+2233h]. 111. DS:BX. 00. No displacement. 01. 8-bit sign-extended displacement. 10. 16-bit displacement. 11. R/M is a register (register addressing mode).

<span class='text_page_counter'>(114)</span> Example • • • • • • • • •. Instruction 8A15h 1000 1010 0001 0101 Opcode 100010 -> MOV D=1, data flows from R/M to REG W=0, 8-bit argument MOD=00 (no displacement) REG=010 (DL) REG=101 ([DI] addressing mode) MOV DL, [DI]. Code. W=0. W=1. W=1. 000. AL. AX. EAX. 001. CL. CX. ECX. 010. DL. DX. EDX. 011. BL. BX. EBX. 100. AH. SP. ESP. 101. CH. BP. EBP. 110. DH. SI. ESI. 111. BH. DI. EDI. R/M Code. Function. 000. DS:BX+SI. 001. DS:BX+DI. 010. SS:BP+SI. 011. SS:BP+DI. 100. DS:SI. 101. DS:DI. 110. SS:BP. 111. DS:BX.

<span class='text_page_counter'>(115)</span> Direct Addressing Mode • MOD is always 00 • R/M is always 110 • REG encodes the register to/from we take data as usual • Third byte contains the lower-order bytes of the displacement, fourth byte contains the high order byte of the displacement.

<span class='text_page_counter'>(116)</span> Direct Addressing • • • • • • • • •. Example: 8816 00 10 1000 1000 0001 0110 0000 0000 0001 0000 Opcode 100010 -> MOV W=0 (byte-sized data) D=0 data flows from REG MOD 00, REG=010 (DL), R/M=110 Low-order byte of displacement 00 High-order byte of displacement 10 MOV [1000h], DL Code. W=0. W=1. W=1. 000. AL. AX. EAX. 001. CL. CX. ECX. 010. DL. DX. EDX. 011. BL. BX. EBX. 100. AH. SP. ESP. 101. CH. BP. EBP. 110. DH. SI. ESI. 111. BH. DI. EDI.

<span class='text_page_counter'>(117)</span> Segment MOV instructions • Different opcode 100011 • Segments are selected by setting the REG Example MOV BX, CS field REG Code. Segment reg.. 000. ES. 001. CS. 010. SS. 011. DS. 100. FS. 101. GS. Opcode 10001100 MOD=11 (register addressing) REG=001 (CS) R/M=011 (BX) 8CCB.

<span class='text_page_counter'>(118)</span> Mã máy REG xác định thanh ghi cho toán hạng thứ nhất.

<span class='text_page_counter'>(119)</span> Mã máy MOD và R/M cùng nhau xác định toán hạng thứ hai.

<span class='text_page_counter'>(120)</span> Mã máy MOD và R/M cùng nhau xác định toán hạng thứ hai.

<span class='text_page_counter'>(121)</span> Ví dụ Mã hoá lệnh MOV. BL,AL. • Opcode đối với MOV là 100010 • Ta mã hoá AL sao cho AL là toán hạng nguồn: – D = 0 (AL là toán hạng nguồn) • W bit = 0 (8-bit) • MOD = 11 (register mode) • REG = 000 (mã của AL) • R/M = 011 (mã của BL) Kết quả:: 10001000 11000011 = 88 C3.

<span class='text_page_counter'>(122)</span> Nhóm lệnh Số học • Bên cạnh tác dụng, cần chú ý đến ảnh hưởng của lệnh đối với các cờ trạng thái • Các lệnh số học th/thường: ADD, SUB, … • Các lệnh số học khác: CMP. NEG, INC, DEC, … • Ảnh hưởng đến các cờ trạng thái – CF – OF – AF. Phụ thuộc vào quá trình thực hiện phép toán. – ZF = 1 nếu Kết quả bằng 0 – SF = 1 nếu MSB của Kết quả = 1 – PF = 1 nếu byte thấp của kết quả có Parity chẳn.

<span class='text_page_counter'>(123)</span> Arithmetic Instructions - ADD Khuôn dạng: ADD Đích,Nguồn - Tác dụng: (Đích) Å (Đích)+(Nguồn) - Đích: có thể là: 1. Một thanh ghi 8 hoặc 16 bit của VXL 2. Một vị trí nhớ (1 hoặc 2 ô nhớ liên tiếp nhau). -. Nguồn: có thể là:. 1. Một thanh ghi 8 hoặc 16 bit của VXL 2. Một vị trí nhớ (1 hoặc 2 ô nhớ liên tiếp nhau) 3. Một giá trị cụ thể.

<span class='text_page_counter'>(124)</span> Ảnh hưởng của ADD – ZF = 1 nếu Kết quả bằng 0 – SF = 1 nếu MSB của Kết quả = 1 – PF = 1 nếu byte thấp của kết quả có Parity chẳn. • CF được lập nếu tràn không dấu (có nhớ từ MSB) • OF được lập nếu tràn có dấu: - Có nhớ từ MSB, Không có nhớ vào MSB - Có nhớ vào MSB, Không có nhớ từ MSB • AF được lập nếu có nhớ từ nibble thấp vào nibble cao (từ bit 3 vào bit 4).

<span class='text_page_counter'>(125)</span> Các cờ trên thanh ghi cờ • Các bit nhất định trên thanh ghi cờ điều khiển hoạt động hoặc phản ánh trạng thái của vi xử lý – Các cờ điều khiển (TF, IF, DF) • Quyết định cách đáp ứng của vi xử lý trong các tình huống nhất định. – Các cở trạng thái (CF, PF, AF, ZF, SF, OF) • Bị ảnh hưởng bởi các phép toán nhất định • Phục vụ cho các lệnh có điều kiện.

<span class='text_page_counter'>(126)</span> Các cờ điều khiển • DF - Direction flag (Cờ hướng) – DF = 1: huớng xuống – DF = 0: hướng lên. • IF – Interrupt flag (Cờ ngắt) – IF = 1: cho phép ngắt ngoài – IF = 0: cấm ngắt ngoài (đối với ngắt che được). • TF - Trace flag – TF = 1: vi xử lý thực hiện từng lệnh một.

<span class='text_page_counter'>(127)</span> Các cờ trạng thái • Carry – carry or borrow at MSB in add or subtract – last bit shifted out. • Parity – low byte of result has even parity. • Auxiliary – carry or borrow at bit 3. • Zero – result is 0. • Sign – result is negative. • Overflow – signed overflow occurred during add or subtract.

<span class='text_page_counter'>(128)</span> (Signed) Overflow • Can only occur when adding numbers of the same sign (subtracting with different signs) • Detected when carry into MSB is not equal to carry out of MSB – Easily detected because this implies the result has a different sign than the sign of the operands. • Programs can ignore the Flags!.

<span class='text_page_counter'>(129)</span> Signed Overflow Example 10010110 + 10100011 00111001. 00110110 + 01100011 10011001. Carry in = 0, Carry out = 1 Neg+Neg=Pos Signed overflow occurred OF = 1 (set). Carry in = 1, Carry out = 0 Pos+Pos=Neg Signed overflow occurred OF = 1 (set).

<span class='text_page_counter'>(130)</span> Examples of No Signed Overflow 10010110 + 01100011 11111001. 10010110 + 11110011 10001001. Carry in = 0, Carry out = 0 Neg+Pos=Neg No Signed overflow occurred OF = 0 (clear). Carry in = 1, Carry out = 1 Neg+Neg=Neg No Signed overflow occurred OF = 0 (clear).

<span class='text_page_counter'>(131)</span> Unsigned Overflow • The carry flag is used to indicate if an unsigned operation overflowed • The processor only adds or subtracts - it does not care if the data is signed or unsigned!. 10010110 + 11110011 10001001 Carry out = 1 Unsigned overflow occurred CF = 1 (set).

<span class='text_page_counter'>(132)</span> DEBUG's Register Display -R …000 SP=0010 BP=0000 SI=0000 DI=0000 …00F IP=004F NV UP DI PL NZ NA PO NC. • The state of the Flags are shown in line 2 • • • • •. OV/NV: EI/DI: NG/PL: AC/NA: CY/NC:. (no)oVerflow DN/UP: direction En(Dis)abled Interrupts sign ZR/NZ: (not)Zero (no)Auxiliary PE/PO: Even/Odd (no)Carry (set/clear).

<span class='text_page_counter'>(133)</span> Arithmetic Instructions - SUB Khuôn dạng: SUB Đích,Nguồn - Tác dụng: (Đích) Å (Đích)-(Nguồn) - Đích: có thể là: 1. Một thanh ghi 8 hoặc 16 bit của VXL 2. Một vị trí nhớ (1 hoặc 2 ô nhớ liên tiếp nhau). -. Nguồn: có thể là:. 1. Một thanh ghi 8 hoặc 16 bit của VXL 2. Một vị trí nhớ (1 hoặc 2 ô nhớ liên tiếp nhau) 3. Một giá trị cụ thể.

<span class='text_page_counter'>(134)</span> Ảnh hưởng của SUB – ZF = 1 nếu Kết quả bằng 0 – SF = 1 nếu MSB của Kết quả = 1 – PF = 1 nếu byte thấp của kết quả có Parity chẳn. • CF được lập nếu tràn không dấu (có mượn vào MSB) • OF được lập nếu tràn có dấu: - Có mượn từ MSB, Không có mượn từ MSB - Có mượn từ MSB, Không có mượn vào MSB • AF được lập nếu có mượn từ nibble cao vào nibble thấp (từ bit 4 vào bit 3).

<span class='text_page_counter'>(135)</span> Arithmetic Instructions - CMP Khuôn dạng: CMP Đích,Nguồn - Tác dụng: (Đích)-(Nguồn) - Đích: có thể là: 1. Một thanh ghi 8 hoặc 16 bit của VXL 2. Một vị trí nhớ (1 hoặc 2 ô nhớ liên tiếp nhau). -. Nguồn: có thể là:. 1. Một thanh ghi 8 hoặc 16 bit của VXL 2. Một vị trí nhớ (1 hoặc 2 ô nhớ liên tiếp nhau) 3. Một giá trị cụ thể.

<span class='text_page_counter'>(136)</span> Arithmetic Instructions – INC, DEC, NEG • INC T/h • Trong đó: T/h có thể là các thanh ghi hoặc vị trí nhớ. • Tác dụng: (T/h) Å (T/h)+1 • DEC T/h • Trong đó: T/h có thể là các thanh ghi hoặc vị trí nhớ. • Tác dụng: (T/h) Å (T/h)-1 • Lưu ý: Các lệnh INC và DEC không ảnh hưởng đến cờ CF. • Lệnh NEG T/h: Đảo dấu của T/h (Lấy bù 2) • Lệnh NEG sẽ lập cờ OF nếu giá trị của T/h là giá trị âm nhất trong dải giá trị của các số có dấu tương ứng.

<span class='text_page_counter'>(137)</span> Nhóm lệnh Logic • Cần chú ý đến ảnh hưởng của lệnh đối với các cờ trạng thái • Các lệnh logic th/thường: NOT, AND, OR, XOR NOT A: ~A AND A,B: A &= B OR A,B : A |= B XOR A,B: A ^= B • NOT không ảnh huởng đến các cờ trạng thái. • Các lệnh khác: – – – – – –. CF = 0 OF = 0 ZF = 1 nếu Kết quả bằng 0 SF = 1 nếu MSB của Kết quả = 1 PF = 1 nếu byte thấp của kết quả có Parity chẳn AF không xác định.

<span class='text_page_counter'>(138)</span> Một số ví dụ AL. 1100 1010 NOT AL AL 0011 0101 AL 0011 0101 BL 0110 1101 AND AL, BL AL 0010 0101 AL 0011 0101 BL 0000 1111 AND AL, BL AL 0000 0101. AL BL. 0011 0101 0110 1101 OR AL, BL AL 0111 1101 AL BL. 0011 0101 0000 1111 OR AL, BL AL 0011 1111 AL 0011 0101 BL 0110 1101 XOR AL, BL AL 0101 1000.

<span class='text_page_counter'>(139)</span> Một số ứng dụng • Bài toán Xoá bit: Xoá một bit nào đó của một toán hạng mà không làm ảnh hưởng đến các bit còn lại của toán hạng đó • Bài toán Kiểm tra bit: Xác định một bit nào đó của một toán hạng là bằng 0 hay 1 (thông qua giá trị của một cờ trạng thái) • Bài toán Lập bit: Lập một bit nào đó của một toán hạng mà không làm ảnh hưởng đến các bit còn lại của toán hạng đó.

<span class='text_page_counter'>(140)</span> Nhóm lệnh logic • Các lệnh logic khác: Lệnh TEST, Các lệnh dịch (Shift) và Các lệnh quay (Rotate) • Lệnh TEST chỉ khác lệnh AND là không giữ lại kết quả của phép toán • Các lệnh dịch và Các lệnh quay đều có hai khuôn dạng: Khuôn dạng 1: Mnemonic Toán hạng,1 Khuôn dạng 2: Mnemonic Toán hạng,CL • Tác dụng của một câu lệnh theo khuôn dang 2 giống như tác dụng liên tiếp của N câu lệnh tương ứng theo khuôn dạng 1, với N là giá trị của thanh ghi CL.

<span class='text_page_counter'>(141)</span> Các lệnh Dịch trái: SHL, SAL CF. Register 0.

<span class='text_page_counter'>(142)</span> Shift right SHR. Register. 0. CF.

<span class='text_page_counter'>(143)</span> Shift right SAR Register. CF.

<span class='text_page_counter'>(144)</span> Rotate through Carry L/R (Quay trái/phải thông qua carry) RCL. RCR.

<span class='text_page_counter'>(145)</span> Rotate left/right (Quay trái/phải không qua carry). ROL. ROR.

<span class='text_page_counter'>(146)</span> Nhóm lệnh rẽ nhánh • Làm thay đổi trật tự thực hiện lệnh bình thường của vi xử lý • • • •. Lệnh nhảy không điều kiện: JMP Các lệnh nhảy có điều kiện: Jxxx Lệnh lặp: LOOP và các biến thể của nó Các lệnh có liên quan đến Chương trình con: - CALL (gọi chương trình con) - RET (trở về chương trình gọi) • Các lệnh có liên quan đến Chương trình con phục vụ ngắt - INT (gọi chương trình con phục vụ ngắt - Gọi ngắt) - IRET (quay về chương trình gọi ngắt).

<span class='text_page_counter'>(147)</span> Lệnh nhảy không điều kiện • JMP nhãn – Nhảy gần: E9 xx xx (3 byte) – Nhảy ngắn: EB xx (2 byte) – Nhảy xa: EA xx xx xx xx (5 byte) • Nhãn: tên do ngườI lập trình tự đặt ra theo qui tắc đặt tên của Assembler và có thể đặt vào trước một câu lệnh bất kỳ trong chương trình cùng với dấu : nhãn: Câu lệnh cần thực hiện • Nhãn sẽ được dịch thành địa chỉ • Khoảng cách nhảy: Khoảng cách đại số (có dấu) từ lệnh nhảy đến lệnh cần thực hiện.

<span class='text_page_counter'>(148)</span> Cơ chế thực hiện lệnh nhảy • Các lệnh nhảy ngắn và gần chỉ làm thay đổi giá trị của thanh ghi IP – Lệnh nhảy ngắn cộng khoảng cách nhảy 8-bit có dấu vào giá trị hiện thời của IP – Lệnh nhảy gần cộng khoảng cách nhảy 16-bit có dấu vào giá trị hiện thời của IP. • Lệnh nhảy xa làm thay đổi cả CS và IP – Gán cho CS và IP các giá trị mới.

<span class='text_page_counter'>(149)</span> Mã máy của lệnh nhảy 1106:0100 EB2A JMP 012C • 012C-0102=002A 1106:0102 EBFC JMP 0100 • 0100-0104=FFFC 1106:0104 E97F00 JMP 0186 • 0186-0106=0080 (too far for short!) • 0186-0107=007F 1106:0107 E9F5FE JMP FFFF • FFFF-010A=FEF5.

<span class='text_page_counter'>(150)</span> Các lệnh nhảy có điều kiện • Jxxx nhãn – Có gần 40 menmonic khác nhau. • Các lệnh nhảy điều kiện đơn: phụ thuộc vào giá trị của 1 cờ. • JNZ/JNE - Nhảy nếu cờ ZF = 0, nghĩa là kết quả của phép toán trước đó khác không • JC - Nhảy nếu CF = 1, nghĩa là câu lệnh trước đó lập cờ carry • JZ/JE • JNC.

<span class='text_page_counter'>(151)</span> Các lệnh nhảy có điều kiện • Tất cả các lệnh nhảy có điều kiện phải là nhảy ngắn – khoảng cách nhảy: -128 to +127 bytes. • Tổ hợp với lệnh nhảy không điều kiện để có thể vượt qua giới hạn này. • Các lệnh nhảy điều kiện kép: phụ thuộc vào giá trị của nhiều cờ • JB/JNAE • JNL/JGE.

<span class='text_page_counter'>(152)</span> ứng dụng của các lệnh nhảy có điều kiện • Kết hợp với JMP để xây dựng các cấu trúc lập trình cơ bản: - Cấu trúc điều kiện - Cấu trúc lặp • Các lệnh nhảy thường theo sau các lệnh làm thay đổi giá trị của các cờ trạng thái: – CMP – TEST ….

<span class='text_page_counter'>(153)</span> Cấu trúc điều kiện mov ax,n cmp ax,7 jz nhan1 lệnh 1 jmp nhan2 nhan1:lệnh 2 nhan2:lệnh 3.

<span class='text_page_counter'>(154)</span> Cấu trúc lặp mov ax,n nhan1: cmp ax,0 jz nhan2 lệnhi sub ax,2 jmp nhan1 nhan2: lệnhk.

<span class='text_page_counter'>(155)</span> Cấu trúc điều kiện - AND char n; int w,x; if (n>='A' && w==x) whatever();. ;if(n>='A'&&w==x) mov ah,n cmp ah,'A' jl nogo mov ax,w cmp ax,x jne no_go ;then-part call whatever nogo:.

<span class='text_page_counter'>(156)</span> Cấu trúc điều kiện - OR char n,k; unsigned int w; if (n<>k || w<=10) whatever();. ;if(n<>k||w<=10) mov ah,n cmp ah,k jne then_ cmp w,10 ja end_if then_: call whatever end_if:.

<span class='text_page_counter'>(157)</span> Lệnh LOOP • LOOP nhan – Giảm CX đi 1 – Nếu (CX) <> 0 thì JMP nhan. Nếu không thì tiếp tục thực hiện lệnh theo trật tự bình thường. mov cx,9 nhan: lệnh 1 lệnh 2 lệnh 3 loop nhan.

<span class='text_page_counter'>(158)</span> LOOPZ/E và LOOPNZ/E • Các biến thể của LOOP • Giá trị của cờ ZF có thể làm kết thúc sớm vòng lặp • Loop while ZF/equal && CX!=0 • Loop while (NZ/ not equal) && CX!=0. • Lưu ý: LOOP giảm CX nhưng không ảnh huởng đến các cờ • LOOPZ == LOOPE • LOOPNZ==LOOPNE • Các lệnh trong vòng lặp có thể tác động đến cờ ZF (CMP ?).

<span class='text_page_counter'>(159)</span> Chương trình con • Chương trình con trong ngôn ngữ Assembly được gọi là Thủ tục (Procedure) • Một thủ tục có thể được thực hiện nhiều lần • Có liên quan đến stack: - lưu giữ Địa chỉ quay về - lưu giữ giá trị của các thanh ghi của vi xử lý.

<span class='text_page_counter'>(160)</span> Stack ? • Cấu trúc dữ liệu LIFO ở RWM - PUSH : ghi dữ liệu vào stack, - POP: đọc dữ liệu từ stack. • (SS:SP) trỏ đến đỉnh của stack • (SS:BP) truy cập stack ngẫu nhiên (không theo LIFO).

<span class='text_page_counter'>(161)</span> Stack Initialization • The .stack directive hides an array allocation statement that looks like this – The_Stack. DB. Stack_Size dup (?). • On program load… – SS is set to a segment address containing this array (usually The_Stack starts at offset 0) – SP is set to the offset of The_Stack+Stack_Size which is one byte past the end of the stack array • This is the condition for an empty stack.

<span class='text_page_counter'>(162)</span> Initial Stack Configuration .stack 12 ;Reserve space for the stack • Loader determines actual segment address for the start of the stack – This is an empty stack Stack Size: 000C. SS:0340 SS:0340. SP:000C SP:000C.

<span class='text_page_counter'>(163)</span> How Does The Stack Work? • The stack grows backwards through memory towards the start of the stack segment Stack Size: 000C. SS:0340 SS:0340. • Push decrements stack pointer Pop increments stack pointer. SP:0008 SP:0008.

<span class='text_page_counter'>(164)</span> PUSH • PUSH nguồn – Push nguồn vào stack. • PUSHF – Push thanh ghi cờ vào stack. • Lệnh PUSH trước hết sẽ giảm SP đi 2 rồi lưu giá trị của nguồn vào vị trị nhớ được trỏ bởi (SS:SP).

<span class='text_page_counter'>(165)</span> Ví dụ PUSH Stack Size: 000C 3C 09 A4 40 2C FF A2 43 07 06 4C 2A 09 46. SS:0340 SS:0340. PUSH AX. SP:0008 SP:0008 AX: AX:0123 0123. 3C 09 A4 40 2C FF A2 23 01 06 4C 2A 09 46. SS:0340 SS:0340. SP:0006 SP:0006.

<span class='text_page_counter'>(166)</span> POP • POP đích – Pop dữ liệu từ đỉnh stack vào đích. • POPF – Pop dữ liệu từ đỉnh stack vào thanh ghi cờ. • Lệnh POP trước hết copy dữ liệu được trỏ bởi (SS:SP) đến đích rồi tăng SP lên 2.

<span class='text_page_counter'>(167)</span> Ví dụ POP 3C 09 A4 40 2C FF A2 23 01 06 4C 2A 09 46. SS:0340 SS:0340. SP:0006 SP:0006. POP ES 3C 09 A4 40 2C FF A2 23 01 06 4C 2A 09 46. SS:0340 SS:0340. ES: ES:0123 0123. SP:0008 SP:0008.

<span class='text_page_counter'>(168)</span> Tràn stack! Stack Size: 000C. SS:0340 SS:0340. SP:FFFE SP:FFFE. • Stack Overflow • Stack Underflow Stack Size: 000C. SS:0340 SS:0340. SP:000D SP:000D.

<span class='text_page_counter'>(169)</span> Thủ tục Tên_Thủ_tục PROC kiểu ;thân của thủ tục RET ;quay về chuơng trình gọi Tên_Thủ_tục ENDP. • kiểu là NEAR hoặc FAR – ngầm định là NEAR. • Một thủ tục có thể có nhiều lệnh RET.

<span class='text_page_counter'>(170)</span> Lệnh CALL và RET • Gọi một thủ tục (NEAR) CALL Tên_Thủ_tục – push IP vào stack – copy địa chỉ của Tên_Thủ_tục vào IP. • Trở về từ một thủ tục (NEAR) RET – pop giá trị ở đỉnh stack vào IP.

<span class='text_page_counter'>(171)</span> Thủ tục Far • Gọi thủ tục (FAR) CALL Tên_thủ_tục – lần lượt push CS và IP vào stack – copy địa chỉ của Tên_thủ_tục vào CS và IP. • Trở về từ thủ tục (FAR) RET – pop giá trị từ đỉnh stack lần lượt vào IP và CS.

<span class='text_page_counter'>(172)</span> Gọi ngắt • Gọi ngắt là một lời gọi thủ tục đặc biêt – FAR – Thanh ghi cờ phải được bảo toàn. • INT Số ngắt – Thanh ghi cờ được push, TF và IF bị xoá – CS và rồI IP được push – Địa chỉ của một chương trình con phục vụ ngắt (Vector ngắt) tương ứng với Số ngắt được copy vào CS và IP.

<span class='text_page_counter'>(173)</span> Trở về từ ngắt • IRET • Tác dụng của lênh: – Giá trị ở đỉnh của stack được pop vào IP – Giá trị ở đỉnh của stack được pop vào CS – Giá trị ở đỉnh của stack được pop vào thanh ghi cờ. • Chương trình bị ngắt tiếp tục thực hiện dường như không có chuyện gì xảy ra.

<span class='text_page_counter'>(174)</span> Xuất ký tự ra màn hình PC • Ngắt 21h – Ngắt này hỗ trợ rất nhiều dịch vụ trên PC – Nhận dạng dịch vụ bằng số dịch vụ (số hàm). Số dịch vụ cần được nạp voà thanh ghi AH – Tuỳ theo từng dịch vụ, có thể cần thêm một số đối số khác được nạp vào các thanh ghi xác định. • AH = 2, DL = Mã ASCII của ký tự cần xuất – Ký tự được hiển thị tại vị trí hiện thờI của con trỏ.

<span class='text_page_counter'>(175)</span> Xuất xâu ký tự ra màn hình PC • Dịch vụ 09h của ngắt 21h – DX = Địa chỉ Offset của xâu (trong đoạn dữ liệu) – DS = Địa chỉ segment của xâu – Xâu ký tự phải kết thúc bằng ký tự '$'. • Để nạp địa chỉ offset của xâu vào DX, có thể: – LEA – MOV. DX, Tênxâu DX, OFFSET Tên xâu.

<span class='text_page_counter'>(176)</span> Nhập 1 ký tự từ bàn phím PC • Dịch vụ 01h của ngắt 21h • Khi NSD gõ một ký tự từ bàn phím: – Ký tự sẽ hiện trên màn hình – AL sẽ chứa mã ASCII của ký tự đó • AL=0 nếu ký tự được nhập là ký tự điều khiển.

<span class='text_page_counter'>(177)</span> Nhóm lệnh thao tác string • Chúng ta hiểu: string là một mảng byte hoặc từ nằm trong bộ nhớ • Các thao tác string: – – – –. Sao chép Tìm kiếm Lưu trữ So sánh.

<span class='text_page_counter'>(178)</span> Các đặc điểm • Nguồn: (DS:SI), Đích: (ES:DI) – DS, ES chứa Địa chỉ Segment của string – SI, DI chứa Địa chỉ Offset của string. • Cờ hướng DF (0 = Up, 1 = Down) – DF = 0 - Tăng địa chỉ (trái qua phải) – DF = 1 - Giảm địa chỉ (phảI qua trái).

<span class='text_page_counter'>(179)</span> Chuyển (Sao chép) • MOVSB, MOVSW – Chuyển 1 byte hoặc 1 word từ vị trí nhớ này sang vị trí nhớ khác – Tác dụng của lệnh: • Sao chép byte/word từ (DS:SI) đến (ES:DI) • Tăng/Giảm SI và DI 1 hoặc 2 giá trị. – Nếu CX chứa một giá trị khác không: • REP MOVSB hoặc REP MOVSW sẽ tự động sao chép (CX) lần và CX sẽ về không.

<span class='text_page_counter'>(180)</span> Ví dụ:Sao chép mảng ; Sao chép 10 byte từ mảng a sang mảng b, giả sử (DS) = (ES). mov mov mov cld rep. cx, 10 di, offset b si, offset a ;xoá cờ DF movsb.

<span class='text_page_counter'>(181)</span> Ví dụ: Tịnh tiến các ô nhớ mov mov mov std rep. cx, 7 di, offset a+9 si, offset a+6 ;lập cờ DF movsb SI a. DI.

<span class='text_page_counter'>(182)</span> Ví dụ pattern. db "!@#*" db 96 dup (?) cx,96 si, offset pattern di, offset pattern+4. mov mov mov cld rep. movsb. SI. a. ! @ # *. DI.

<span class='text_page_counter'>(183)</span> Lưu trữ string STOSB, STOSW • Copy AL hoặc AX vào một mảng byte hoặc word – Đích (ES:DI). • Tăng hoặc Giảm DI – phụ thuộc DF. • Thường được sử dụng có tiền tố REP và số lần lặp trong CX.

<span class='text_page_counter'>(184)</span> Ví dụ: arr dw 200 dup (?) mov ax,50A0h mov di,offset arr mov cx,200 cld AX 50 A0 rep stosw. A0 50 A0 50 arr. DI.

<span class='text_page_counter'>(185)</span> Nạp String • LODSB, LODSW – Byte hoặc word tại (DS:SI) được copy vào AL hoặc AX – SI tăng hoặc giảm 1 hoặc 2 giá trị phụ thuộc DF. • Thường được dùng với STOSx trong một vòng lặp để xử lý từng phần tử trong một mảng.

<span class='text_page_counter'>(186)</span> Ví dụ: mov di, offset b mov si, offset a mov cx,30 cld lp: lodsb and al,0DFh stosb loop lp.

<span class='text_page_counter'>(187)</span> Quét String SCASB, SCASW • So sánh AL hoặc AX với byte hoặc word tạI (ES:DI) và tự động tăng hoặc giảm DI • Lệnh này ảnh hưởng đến các cờ trạng thái – Tuỳ theo kết quả so sánh – Dùng trong một vòng lặp REPs • REPZ, REPE, REPNZ, REPNE.

<span class='text_page_counter'>(188)</span> Ví dụ arr db 'abcdefghijklmnopqrstuvwxyz' mov di, offset arr mov cx,26 cld mov al,target repne scasb jne. nomatch.

<span class='text_page_counter'>(189)</span> So sánh String CMPSB, CMPSW • So sánh byte hoặc word tại (DS:SI) với byte hoặc word tạI (ES:DI), tác động đến các cờ và tăng hoặc giảm SI và DI • Thường dùng để so sánh hai mảng với nhau.

<span class='text_page_counter'>(190)</span> Ví dụ mov si, offset str1 mov di, offset str2 cld mov cx, 12 repe cmpsb jl str1smaller jg str2smaller ;the strings are equal - so far ;if sizes different, shorter string is less.

<span class='text_page_counter'>(191)</span> Nhóm lệnh hỗn hợp - Các lệnh Lập/Xoá trực tiếp các cờ: STC, CLC STD, CLD STI, CLI - Lệnh NOP (No Operation): Không làm gì!!! - Lệnh NOP thường được dùng trong các vòng lặp tạo trễ (delay)bằng phần mềm - Các lệnh Nhập/Xuất dữ liệu đối với các cổng I/O IN OUT.

<span class='text_page_counter'>(192)</span> Lệnh IN - Nếu Địa chỉ của cổng Nhỏ hơn hoặc bằng FFh: IN Acc, Địa chỉ cổng - Trong đó: Acc có thể là AL hoặc AX - Nhập dữ liệu từ cổng vào Acc - Nếu Địa chỉ của cổng Lớn hơn FFh: MOV DX, Địa chỉ cổng IN Acc, DX - Trong đó: Acc có thể là AL hoặc AX - Nhập dữ liệu từ cổng vào Acc.

<span class='text_page_counter'>(193)</span> Lệnh OUT - Nếu Địa chỉ của cổng Nhỏ hơn hoặc bằng FFh: OUT Địa chỉ cổng, Acc - Trong đó: Acc có thể là AL hoặc AX - Xuất dữ liệu từ Acc ra cổng - Nếu Địa chỉ của cổng Lớn hơn FFh: MOV DX, Địa chỉ cổng OUT DX, Acc - Trong đó: Acc có thể là AL hoặc AX - Xuất dữ liệu từ Acc ra cổng.

<span class='text_page_counter'>(194)</span> Tóm tắt chương - Tính tương thích về Cấu trúc thanh ghi của các vi xử lý họ x86 - Tính tương thích về Tập lệnh của các vi xử lý họ x86.

<span class='text_page_counter'>(195)</span> Kỹ thuật Vi xử lý Điện tử-Viễn thông Đại học Bách khoa Đà Nẵng.

<span class='text_page_counter'>(196)</span> Chương 4 4.1 4.2 4.3 4.4 4.5. Phân loại bộ nhớ bán dẫn Hoạt động của các chip EPROM Hoạt động của các chip SRAM Bus hệ thống của hệ vi xử lý 8088 Bài toán thiết kế bộ nhớ.

<span class='text_page_counter'>(197)</span> Mục tiêu và biện pháp thiết kế „. „. Ghép nối các chip nhớ EPROM và SRAM với Bus hệ thống sao cho không xảy ra xung đột: Các chip nhớ bị cấm khi vi xử lý truy cập các cổng I/O Chỉ có một chip nhớ hoạt động khi vi xử lý truy cập bộ nhớ Thực hiện một mạch giải mã địa chỉ bộ nhớ dùng các chip giải mã hoặc các cổng logic hoặc kết hợp cả hai.

<span class='text_page_counter'>(198)</span> 4.1 Phân loại bộ nhớ bán dẫn Bộ nhớ bán dẫn (Semiconductor memory) RAM. SAM (Sequential Access Memory). (Random Access Memory). ROM (Read Only Memory) PROM. EPROM. EEPROM. Flash ROM. RWM (Read Write memory) SRAM. DRAM.

<span class='text_page_counter'>(199)</span> 4.2 Các chip EPROM. p chân địa chỉ. A0 A1 A2 A3 A4 A5 A6 A7 A8 A p-1. Điều khiển đọc Chọn chip Các chân điều khiển. OE PGM CE Vpp. D0 D1 D2 D3 D4 D5 D6. EPROM. Dm-1. m chân dữ liệu.

<span class='text_page_counter'>(200)</span> Dung lượng của 1 chip nhớ „. „. „ „. Một chip nhớ được xem như một mảng gồm n ô nhớ. Mỗi ô nhớ lưu trữ được m-bit dữ liệu Dung lượng của chip thường được biểu diễn: nxm Ví dụ: Một chip có dung lượng 2Kx8 nghĩa là chip đó có 2048 ô nhớ và mỗi ô nhớ có thể lưu trữ được 1 byte dữ liệu m chính là số chân dữ liệu của chip log2(n) = p là số chân địa chỉ của chip.

<span class='text_page_counter'>(201)</span> Hoạt động ghi dữ liệu vào EPROM „ „ „ „. Việc ghi dữ liệu vào EPROM được gọi là lập trình cho EPROM Được thực hiện bằng thiết bị chuyên dụng gọi là Bộ nạp EPROM Chân Vpp được cấp điện áp tương ứng với từng loại chip gọi là điện áp lập trình Dữ liệu tại các chân dữ liệu sẽ được ghi vào một ô nhớ xác định nhờ các tín hiệu đưa vào ở các chân địa chỉ và một xung (thường gọi là xung lập trình) đưa vào chân PGM.

<span class='text_page_counter'>(202)</span> Hoạt động đọc dữ liệu từ một chip EPROM Để đọc dữ liệu từ 1 ô nhớ nào đó của 1 chip EPROM nào đó, Bộ vi xử lý cần phải: „. Chọn chip đó: 0 -----> CE. „. Áp các tín hiệu địa chỉ của ô nhớ cần đọc vào các. „ „. chân địa chỉ Ap-1 – A0 Đọc: 0 ------ > OE Kết quả là m bit dữ liệu cần đọc xuất hiện ở các chân dữ liệu Dm-1 – D0.

<span class='text_page_counter'>(203)</span> Họ EPROM thông dụng 27x Số hiệu của chip. Dung lượng. 2716. 2Kx8. 2732. 4Kx8. 2764. 8Kx8. 27128. 16Kx8. 27256. 32Kx8. 27512. 64Kx8. Bảng 4.1 Họ EPROM 27x.

<span class='text_page_counter'>(204)</span> EPROM 1 2 „. Sơ đồ chân của 2716 và 2732. 3 4 5 6 7 8 9 10 11 12. A7. Vcc. A6. A8. A5. A9. A2 A1. D7. D0. D6. D1. D5. D2. D4. GND. D3. A11. 22. 19 A10 __ CE/PGM 18. A0. Vpp __ OE. 23. 20. A3. 2732. 24. 21. A4. 2716. 17 16 15 14 13. __ OE / Vpp.

<span class='text_page_counter'>(205)</span> EPROM 2764 Các chân địa chỉ. Các chân dữ liệu Chọn chip Điều khiển đọc.

<span class='text_page_counter'>(206)</span> EPROM 2764.

<span class='text_page_counter'>(207)</span> Lập trình cho 2764 „. Trước hết cần phải xoá • Xoá một chip tức là làm cho tất cả các bit = 1. „ „. Xoá một chip EPROM bằng tia cực tím Lập trình bằng cách: • VPP mắc ở mức 12.5V • E và P đều ở mức thấp TTL. „ „. Các bit dữ liệu đưa vào các chân dữ liệu Các bit địa chỉ đưa vào các chân địa chỉ.

<span class='text_page_counter'>(208)</span> 4.3 Các chip SRAM. P chân địa chỉ. A0 A1 A2 A3 A4 A5 A6 A7 A8 A p-1. Điều khiển đọc Chọn chip Điều khiển ghi. OE CS WE. D0 D1 D2 D3 D4 D5 D6. SRAM. Dm-1. m chân dữ liệu.

<span class='text_page_counter'>(209)</span> Đọc dữ liệu từ một chip SRAM Để đọc dữ liệu từ 1 ô nhớ nào đó của 1 chip SRAM nào đó, vi xử lý cần phải: „ „ „. Chọn chip đó: 0 -----------> CS Áp các tín hiệu địa chỉ vào Ap-1 – A0 Đọc: 0 ----------- > OE. Kết quả là m bit dữ liệu cần đọc xuất hiện ở các chân dữ liệu Dm-1 – D0.

<span class='text_page_counter'>(210)</span> Ghi dữ liệu vào một chip SRAM Để ghi m bit dữ liệu vào 1 ô nhớ nào đó của 1 chip SRAM nào đó, vi xử lý cần phải: „ Chọn chip đó: 0 --------> CS „ Áp các tín hiệu địa chỉ vào Ap-1 – A0 „ Áp m bit dữ liệu cần ghi vào các chân dữ liệu Dm-1 – D0 „ Ghi: 0 --------- > WE Kết quả là các bit dữ liệu ở các chân dữ liệu sẽ được ghi vào ô nhớ đã chọn.

<span class='text_page_counter'>(211)</span> SRAM 6264 Dung lượng 8Kx8 „ 8 chân dữ liệu „ 13 chân địa chỉ „ Hai chân chọn chip „ Chân điều khiển đọc „ Chân điều khiển ghi „. A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 OE WE CS1 CS2. I/O0 I/O1 I/O2 I/O3 I/O4 I/O5 I/O6 I/O7. 6264.

<span class='text_page_counter'>(212)</span> 32K x 8 Static RAM 1 2 3 4 5 6 7 8 9 10 11 12 13 14. Vcc __. A14. WE. A12 A6. A8. A5. A9. A4. A11 __ OE. A3 A2. A10. 25 24 23 22 21. __. A1. CE. A0. D7. D0. D6. D1. D5. D2. D4. GND. D3 51256S. 27 26. A13. A7. 28. 20 19 18 17 16 15.

<span class='text_page_counter'>(213)</span> Sơ đồ khối 6264.

<span class='text_page_counter'>(214)</span> Chức năng của 6264.

<span class='text_page_counter'>(215)</span> 4.4 Bus hệ thống của 8088 „. „. „. „. Bus địa chỉ 20-bit: gồm các đường địa chỉ được ký hiệu từ A19 đến A0 Bus dữ liệu 8-bit: gồm các đường dữ liệu được ký hiệu từ D7 đến D0 Bus điều khiển gồm các đường điều khiển riêng lẽ phục vụ cho hoạt động truy cập bộ nhớ và các cổng I/O, mỗi đường thường được ký hiệu bằng tên của tín hiệu điều khiển Bus hệ thống không nối trực tiếp với các chân của 8088: thông qua các mạch đệm, chốt..

<span class='text_page_counter'>(216)</span> 80x86 Microprocessors Product. 8008. 808 0. 808 5. 808 6. 808 8. 8028 6. 80386. 80486. Pent.. Pent. Pro. Year Introduced. 1972. 1974. 1976. 1978. 1979. 1982. 1985. 1989. 1992. 1995. Technology. PMOS. NMO S 5-10. NMO S 5-8. CMOS. CMOS. 0.50.50.8 18. NMO S 3-8. NMOS. Clock Rate. NMO S 2-3. 1616-40. 66. BICMO S 150. 40. 40. 40. 40. 101016?. 132. 168. BICMO S 606066+ 273. 130K. 275K. 1.2M. 3M. 5.5M. Number of Pins. 387. Number of transistors Number of instructions. 3000. 4500. 6500. 29K. 29K. 66. 111. 113. 133. 133. Physical Memory. 16K. 64K. 64K. 1M. 1M. 16M. 16M4GB. 4GB. 4GB. 64G. Virtual Memory. none. none. none. none. none. 1G. 64T. 64T. 64T. 64T. Internal Data Bus. 8. 8. 8. 16. 16. 16. 32. 32. 64. 32. External Data Bus. 8. 8. 8. 16. 8. 16. 16,32. 32. 64. 64. Address Bus. 8. 16. 16. 20. 20. 24. 24,32. 32. 32. 36. Data Types. 8. 8. 8. 8,16. 8,16. 8,16. 8,16,32. 8,16,3 2. 8,16,3 2. 8,16,3 2.

<span class='text_page_counter'>(217)</span> 8088/8086 Microprocessor „ „. DIP 40 pin Data bus • Bus dữ liệu trong :16 bit • Bus dữ liệu ngoài của 8088: 8 bit dùng AD0-AD7 • Bus dữ liệu ngoài của 8086:16 bit dùng AD0-AD15 • ALE (Address Latch Enable).

<span class='text_page_counter'>(218)</span> 8088/8086 Microprocessor „. Bus địa chỉ • ALE = 1 • Sử dụng 74LS373 để tách và chốt địa chỉ Đầu vào: AD0-AD7 (8088) hoặc AD0-AD15 (8086) và ALE „ Đầu ra: A0-A7 (8088) hoặc A0-A15 (8086) „.

<span class='text_page_counter'>(219)</span> Sơ đồ chân của 8088.

<span class='text_page_counter'>(220)</span> Sơ đồ chân 8088/8086 (Min Mode).

<span class='text_page_counter'>(221)</span> Minimum/Maximum Mode „ „. Ảnh hưởng đến các chân 24-31 Minimum Mode • Các chân 24-31 là các tín hiệu điều khiển I/O và bộ nhớ • Các tín hiệu điều khiển đều từ 8088/8086 • Tương tự với 8085A. „. Maximum Mode • Một số tín hiệu điều khiển được tạo ra từ ngoài • Một số chân có thêm chức năng mới • Khi có dùng bộ đồng xử lý toán 8087.

<span class='text_page_counter'>(222)</span> Sơ đồ chân của 8088 MN / MX. AD0. READY. AD1 AD2. CLK RESET. AD3 AD4. TEST. AD5 AD6 AD7. HLDA A8 HOLD NMI. A9 A10 A11 A12 A13 A14. 8088. A15 A16 / S3 A17 / S4 A18 / S5 A19 / S6 SSO DEN DT / R IO / M RD WR ALE. INTR. INTA.

<span class='text_page_counter'>(223)</span> Tín hiệu ở các chân của 8088 MN / MX. AD0. READY. AD1 AD2. CLK RESET. AD3 AD4. TEST. AD5 AD6. Các chân Địa chỉ/Dữ liệu. AD7 HLDA A8 HOLD NMI. A9 A10 A11 A12. Các chân địa chỉ. A13 A14. 8088. A15 A16 / S3 A17 / S4 A18 / S5. Các chân Địa chỉ/Trạng thái. A19 / S6 SSO DEN DT / R IO / M RD WR ALE INTR. INTA. Cho phép chốt Địa chỉ.

<span class='text_page_counter'>(224)</span> Các chân Địa chỉ/Dữ liệu „ „. „ „. Các chân AD7 đến AD0 Kỹ thuật Multiplexing: Tín hiệu ở các chân này lúc này là tín hiệu địa chỉ, lúc khác là tín hiệu dữ liệu phụ thuộc vào tín hiệu điều khiển ALE (Address Latch Enable): ALE = 1: AD7 đến AD0 = A7 đến A0 ALE = 0: AD7 đến AD0 = D7 đến D0.

<span class='text_page_counter'>(225)</span> Các chân Địa chỉ và Các chân Địa chỉ/Trạng thái „ „. „. „ „. Các chân địa chỉ: A15 đến A8 Tín hiệu ở các chân này luôn là tín hiệu địa chỉ Các chân địa chỉ/trạng thái: A19/S6 đến A16/S3: ALE = 1: A19 đến A16 ALE = 0: S6 đến S3.

<span class='text_page_counter'>(226)</span> Processor Timing Diagram of 8088 (Minimum Mode) for Memory or I/O Read (with 74245) T1. T2. T3. T4. CLOCK __. DT/R ALE D7 - D0. D7 - D0 (from memory). from memory to 74LS245. AD7 - AD0. A7 - A0. A15 - A8 A19/S6 - A16/S3 A19 - A0 from 74LS373 to memory. garbage. D7 - D0 from 74LS245. A15 - A8. A19 - A16. S6 - S3. A19 - A0 from 74LS373. __. IO/M ____. RD ______. DEN. if I/O ACCESS this is HIGH, if MEMORY ACCESS this is LOW.

<span class='text_page_counter'>(227)</span> 74LS373 D0. Q0. D1 D2. Q1 Q2. D3. Q3. D4 D5. Q4 Q5. D6 D7 OE LE. 74LS373. Q6 Q7.

<span class='text_page_counter'>(228)</span> 74LS373.

<span class='text_page_counter'>(229)</span> Dùng 74LS373 để tách và chốt địa chỉ.

<span class='text_page_counter'>(230)</span> Mô tả chân – Min „ „ „. DEN Data Enable Dữ liệu có nghĩa.

<span class='text_page_counter'>(231)</span> Mô tả chân – Min „ „. „. „. DT/R Điều khiển hướng của tín hiệu dữ liệu: 1: Tín hiệu dữ liệu đi ra từ 8088 0: Tín hiệu dữ liệu đi vào 8088.

<span class='text_page_counter'>(232)</span> Mô tả chân – Min „ „. IO/M Phân biệt: truy cập I/O hay Bộ nhớ • 1: 8088 truy cập I/O • 0: 8088 truy cập bộ nhớ.

<span class='text_page_counter'>(233)</span> Mô tả chân – Min „ „. „ „. WR 0: Tín hiệu trên bus dữ liệu được ghi vào bộ nhớ hoặc I/O Ghi bộ nhớ: ? Xuất dữ liệu ra cổng: ?.

<span class='text_page_counter'>(234)</span> Mô tả chân – Min „ „ „. HLDA Hold Acknowledge 0: Chấp nhận yêu cầu DMA ở HOLD • Báo cho Bộ điều khiển DMA được phép sử dụng bus hệ thống.

<span class='text_page_counter'>(235)</span> Mô tả chân – Min „ „. „. HOLD Nhận tín hiệu yêu cầu DMA từ Bộ điều khiển DMA (DMAC) DMAC muốn sử dụng bus hệ thống.

<span class='text_page_counter'>(236)</span> Mô tả chân – Min „ „ „. SSO 8088 Dùng với IO/M và DT/R để xác định trạng thái của chu kỳ bus hiện thời.

<span class='text_page_counter'>(237)</span> Các tín hiệu điều khiển „. Có thể sử dụng các cổng logic để tạo ra các tín hiệu điều khiển khác từ các tín hiệu điều khiển sẵn có • 3 Tín hiệu: „. RD, WR and IO/M. RD W R 0 1. IO/M Signal 0. MEMR. 1. 0. 0. MEMW. 0. 1. 1. IOR. 1. 0. 1. IOW. 0. 0. X. Never happens.

<span class='text_page_counter'>(238)</span> Tạo ra các tín hiêụ điều khiển (Min Mode).

<span class='text_page_counter'>(239)</span> Tạo ra các tín hiêụ điều khiển (Min Mode).

<span class='text_page_counter'>(240)</span> 8088 Bus – Min Mode.

<span class='text_page_counter'>(241)</span> 74LS245 A0. B0. A1. B1. A2. B2. A3. B3. A4. B4. A5. 74LS245. B5. A6. B6. A7. B7. E. DIR.

<span class='text_page_counter'>(242)</span> Bus hệ thống của hệ 8088 ở Mode Minimum A7 - A0 DEN. E. DT / R. DIR. AD7 - AD0. B7 - B0. 74LS245. D7 - D0. Q7 - Q0. D7 - D0. Bus dữ liệu. Bus địa chỉ. A7 - A0 A15 - A8. GND. OE LE. D7 - D0. A15 - A8 GND. 8088. OE LE. A19/S6 - A16/ S3. OE LE. Q7 - Q0. WR. MEMORY. Q7 - Q4 Q3 - Q0. 74LS373. RD IO / M. A19 - A16. 74LS373. D7 - D4 D3 - D0 GND. ALE. 74LS373. MEMR. RD. WR. MEMW.

<span class='text_page_counter'>(243)</span> Minimum Mode 8088 D7 - D0. D7 - D0. A19 - A0. A19 - A0. 8088 Minimum Mode. MEMORY. Bộ nhớ được chọn khi nào?. MEMR. RD. MEMW. WR.

<span class='text_page_counter'>(244)</span> Minimum Mode 8088. 220 ô nhớ (1MB). D7 - D0. D7 - D0. A19 - A0. A19 - A0. MEMORY. 8088 Minimum Mode. MEMR. RD. MEMW. WR. CS.

<span class='text_page_counter'>(245)</span> Không gian địa chỉ bộ nhớ 1M A19 đến A0 (HEX) 00000. AAAA 1111 9876. AAAA 1111 5432. AAAA 1198 1000. AAAA 7654. AAAA 3210. 0000. 0000. 0000. 0000. 0000. FFFFF. 1111. 1111. 1111. 1111. 1111. Ví dụ: Một địa chỉ bất kỳ 34FD0h 0011 0100 11111 1101 0000.

<span class='text_page_counter'>(246)</span> Bộ nhớ đầy đủ 1MB AX BX. 3F1C 0023. FFFFF FFFFE. 36 25. CX. 0000. FFFFD. 19. DX. FCA1. CS SS. XXXX XXXX. DS ES. 2000 XXXX. BP. XXXX. SP. XXXX. SI DI. XXXX XXXX. IP. XXXX. A19 : A0. A19 : A0. D7 :. D7 :. D0. D0. MEMR. MEMW. RD. WR. CS. : :. : :. 20023 20022. 13 7D. 20021 20020. 12 29. : :. : :. 10008 10007. 8A F4. 10006 10005. 07 88. 10004 10003. 42 39. 10002 10001. 27 98. 10000. 45. : :. : :. 00001. 95. 00000. 23.

<span class='text_page_counter'>(247)</span> Nếu chỉ cần bộ nhớ có dung lượng nhỏ hơn 1MB thì giải quyết như thế nào? „ „. „. Phụ thuộc vào các chip nhớ sẵn có Phụ thuộc yêu cầu phân bố địa chỉ cho các loại bộ nhớ vật lý khác nhau ….

<span class='text_page_counter'>(248)</span> 512K đầu tiên của không gian địa chỉ bộ nhớ (Các địa chỉ có bit cao nhất A19 = 0). A18 đến A0 (HEX) 00000. AAAA 1111 9876. AAAA 1111 5432. AAAA 1198 1000. AAAA 7654. AAAA 3210. 0000. 0000. 0000. 0000. 0000. 7FFFF. 0111. 1111. 1111. 1111. 1111.

<span class='text_page_counter'>(249)</span> 512K tiếp theo của không gian địa chỉ bộ nhớ (Các địa chỉ có bit cao nhất A19 = 1). A18 đến A0 (HEX) 80000. AAAA 1111 9876. AAAA 1111 5432. AAAA 1198 1000. AAAA 7654. AAAA 3210. 1000. 0000. 0000. 0000. 0000. FFFFF. 1111. 1111. 1111. 1111. 1111.

<span class='text_page_counter'>(250)</span> Bộ nhớ 512KB. AX. 3F1C. BX CX. 0023 0000. DX. FCA1. CS SS. XXXX XXXX. DS ES. 2000 XXXX. BP. XXXX. SP. XXXX. SI DI. XXXX XXXX. IP. XXXX. Làm gì với A19? A19 A18 :. A18 :. 7FFFF 7FFFE. 36 25. A0. A0. 7FFFD. 19. D7. D7. : :. : D0. : D0. 20023 20022. 13 7D. MEMR. RD. 20021 20020. 12 29. MEMW. WR. CS. : : 00001 00000. : :. : : 95 23.

<span class='text_page_counter'>(251)</span> Điều gì xảy ra nếu 8088 đọc ô nhớ A0023h? AX. 3F1C. BX CX DX. 0023 0000 FCA1. CS. XXXX. SS DS ES. XXXX A000 XXXX. BP. XXXX. SP. XXXX. SI DI. XXXX XXXX. IP. XXXX. A19 A18 : A0. A18. 7FFFF. 36. : A0. 7FFFE 7FFFD. 25 19. D7 :. D7 :. D0. D0. MEMR. RD. MEMW. WR. CS. : :. : :. 20023. 13. 20022 20021 20020. 7D 12 29. : : 00001 00000. : : 95 23. MOV AH, [BX].

<span class='text_page_counter'>(252)</span> Điều gì xảy ra nếu 8088 đọc ô nhớ A0023h?. A19 đến A0 (HEX) A0023. AAAA 1111 9876. AAAA 1111 5432. AAAA 1198 1000. AAAA 7654. AAAA 3210. 1010. 0000. 0000. 0010. 0011. A19 không được nối đến bộ nhớ nên nếu 8088 phát logic “1” trên A19 thì bộ nhớ cũng không nhận biết được..

<span class='text_page_counter'>(253)</span> Điều gì xảy ra nếu 8088 đọc ô nhớ 20023h?. A18 đến A0 (HEX) 20023. AAAA 1111 9876. AAAA 1111 5432. AAAA 1198 1000. AAAA 7654. AAAA 3210. 0010. 0000. 0000. 0010. 0011. Với bộ nhớ tình hình không có gì khác!.

<span class='text_page_counter'>(254)</span> Nếu Bộ nhớ gồm 2 khối 512KB như thế này? AX. 3F1C. A19. BX CX. 0023 0000. A18 :. A18 :. DX. FCA1. A0. A0. CS. XXXX. SS. XXXX. D7 :. D7 :. DS. 2000. D0. D0. ES. XXXX. MEMR MEMW. BP. XXXX. SP. XXXX. SI. XXXX. DI. XXXX XXXX. IP. 7FFFF. 36. 7FFFE 7FFFD. 25 19. :. :. 20023. 13. 20022. 7D. 20021. 12. 20020. 29. RD WR. : 00001. : 95. CS. 00000. 23. 7FFFF. 12. A18. 7FFFE. 98. : A0. 7FFFD :. 2C :. 20023. 33. 20022. 45. 20021. 92. 20020. A3. RD. :. :. WR CS. 00001 00000. D4 97. D7 : D0.

<span class='text_page_counter'>(255)</span> Có vấn đề !!! „. „. Vấn đề là: Xung đột Bus. Hai khối nhớ sẽ cung cấp dữ liệu cùng một lúc khi 8088 đọc bộ nhớ Giải pháp: Dùng A19 làm “người phân xử” để giải quyết xung đột trên bus. Nếu A19 ở mức logic “1” thì khối nhớ trên hoạt động (khối nhớ dưới bị cấm) và ngược lại.

<span class='text_page_counter'>(256)</span> Bộ nhớ gồm hai khối nhớ 512KB AX. 3F1C. A19. BX. 0023. A18. CX. 0000. :. DX. FCA1. A0. A0. D7. D7. CS. XXXX. SS. XXXX. DS. 2000. ES. XXXX. BP. XXXX. SP. XXXX. SI. XXXX. DI. XXXX. IP. XXXX. :. 7FFFF. 36. A18. 7FFFE. 25. :. 7FFFD. 19. :. :. 20023. 13. 20022. 7D. 20021. 12. 20020. 29. :. D0. D0. MEMR. RD. :. :. MEMW. WR. 00001. 95. CS. 00000. 23. 7FFFF. 12. A18. 7FFFE. 98. :. 7FFFD. 2C. :. :. 20023. 33. 20022. 45. 20021. 92. 20020. A3. RD. :. :. WR. 00001. D4. CS. 00000. 97. A0 D7 : D0.

<span class='text_page_counter'>(257)</span> Không gian địa chỉ bộ nhớ 1M A19 đến A0 (HEX) 00000. AAAA 1111 9876. AAAA 1111 5432. AAAA 1198 1000. AAAA 7654. AAAA 3210. 0000. 0000. 0000. 0000. 0000. 7FFFF. 0111. 1111. 1111. 1111. 1111. 80000. 1000. 0000. 0000. 0000. 0000. FFFFF. 1111. 1111. 1111. 1111. 1111.

<span class='text_page_counter'>(258)</span> Bộ nhớ gồm hai khối nhớ 512KB AX BX. 3F1C 0023. A19 A18. 7FFFF 7FFFE. 36 25. CX DX. 0000 FCA1. : A0. : A0. 7FFFD : 20023 20022. 19 : 13 7D. CS. XXXX. SS DS ES. XXXX 2000 XXXX. D7 : D0. D7 : D0 RD WR. 20021 20020 : 00001. 12 29 : 95. MEMR MEMW. BP SP. XXXX XXXX. CS. 00000. 23. SI. XXXX. 7FFFF. 12. DI. XXXX. 7FFFE 7FFFD : 20023. 98 2C : 33. IP. XXXX. RD. 20022 20021 20020 :. 45 92 A3 :. WR CS. 00001 00000. D4 97. A18. Khi µP xuất một địa chỉ từ 00000h 80000h đến to FFFFFh, 7FFFFh, Bộ nhớ này hoạt động. A18 : A0 D7 : D0.

<span class='text_page_counter'>(259)</span> Bộ nhớ gồm hai khối nhớ 512KB AX BX. 3F1C 0023. A19 A18. CX. 0000. :. DX. FCA1. A0. A0. D7. D7. : D0. : D0. MEMR MEMW. CS. XXXX. SS. XXXX. DS. 2000. ES. XXXX. BP. XXXX. SP. XXXX. SI. XXXX. DI. XXXX. IP. XXXX. A18. 7FFFF 7FFFE. 36 25. :. 7FFFD. 19. :. :. 20023. 13. 20022. 7D. 20021. 12. 20020. 29. RD. :. :. WR. 00001. 95. CS. 00000. 23. 7FFFF. 12. A18. 7FFFE. 98. :. 7FFFD. 2C. :. :. 20023. 33. 20022. 45. 20021. 92. 20020. A3. RD. :. :. WR CS. 00001 00000. D4 97. A0 D7 : D0.

<span class='text_page_counter'>(260)</span> Thiết kế Bộ nhớ cho Hệ vi xử lý AX BX. 3F1C 0023. A19 A18. CX. 0000. :. DX. FCA1. CS. XXXX. SS. XXXX. DS. 2000. ES. XXXX. BP. XXXX. SP. XXXX. SI. XXXX. DI. XXXX. IP. XXXX. A19 A18. A18. 7FFFF 7FFFE. 36 25. :. :. 7FFFD. 19. A0. A0. A0. :. :. D7. D7. D7. 20023. 13. : D0. : D0. : D0. 20022. 7D. 20021. 12. 20020. 29. MEMR. RD. MEMW. WR. Ghép nối các chip nhớ: RD WR 00001 riêng lẽ với Bus hệ CS 00000 thống sao cho không xảy ra xung đột nhờ7FFFF A18 7FFFE mạch giải mã địa chỉ : 7FFFD A0 : bộ nhớ. : 95 23. 12 98 2C :. 20023. 33. 20022. 45. 20021. 92. 20020. A3. RD. :. :. WR CS. 00001 00000. D4 97. D7 : D0.

<span class='text_page_counter'>(261)</span> Nếu bỏ đi khối nhớ bên dưới? AX BX. 3F1C 0023. A19 A18. 7FFFF 7FFFE. 36 25. CX DX. 0000 FCA1. : A0. : A0. 7FFFD : 20023 20022. 19 : 13 7D. CS. XXXX. SS DS ES. XXXX 2000 XXXX. D7 : D0. D7 : D0 RD WR. 20021 20020 : 00001. 12 29 : 95. MEMR MEMW. BP SP. XXXX XXXX. CS. 00000. 23. SI. XXXX. 7FFFF. 12. DI. XXXX. 7FFFE 7FFFD : 20023. 98 2C : 33. IP. XXXX. RD. 20022 20021 20020 :. 45 92 A3 :. WR CS. 00001 00000. D4 97. A18. A18 : A0 D7 : D0.

<span class='text_page_counter'>(262)</span> Nếu bỏ đi khối nhớ bên dưới thì … AX BX. 3F1C 0023. A19 A18. 7FFFF 7FFFE. 36 25. CX DX. 0000 FCA1. : A0. : A0. 7FFFD : 20023 20022. 19 : 13 7D. CS. XXXX. SS DS ES. XXXX 2000 XXXX. D7 : D0. D7 : D0 RD WR. 20021 20020 : 00001. 12 29 : 95. MEMR MEMW. BP SP. XXXX XXXX. CS. 00000. 23. SI. XXXX. DI. XXXX. IP. XXXX. A18. Khi Khi µP µP xuất xuất ra ra một một dịa chỉ từ 00000h địa chỉ từ 80000h đến Không đến 7FFFFh, FFFFFh, Chip có hoạt nhớchip nàynhớ hoạtnào động động!. !.

<span class='text_page_counter'>(263)</span> Giải mã đầy đủ và không đầy đủ „. Giải mã đầy đủ (Full Decoding) • Tất cả các đường địa chỉ có nghĩa đều được sử dụng vào mạch giải mã • Mỗi ô nhớ chỉ có một địa chỉ vật lý duy nhất. „. Giải mã không đầy đủ (Partial Decoding) • Không phải tất cả các đường địa chỉ có nghĩa đều được sử dụng vào mạch giải mã • Một ô nhớ có hơn một địa chỉ vật lý.

<span class='text_page_counter'>(264)</span> Giải mã đầy đủ AX BX. 3F1C 0023. A19 A18. 7FFFF 7FFFE. 36 25. CX DX. 0000 FCA1. : A0. : A0. 7FFFD : 20023 20022. 19 : 13 7D. CS. XXXX. SS DS ES. XXXX 2000 XXXX. D7 : D0. D7 : D0 RD WR. 20021 20020 : 00001. 12 29 : 95. MEMR MEMW. BP SP. XXXX XXXX. CS. 00000. 23. SI. XXXX. DI. XXXX. IP. XXXX. A18.

<span class='text_page_counter'>(265)</span> Giải mã đầy đủ A19 đến A0 (HEX) 80000. AAAA 1111 9876. AAAA 1111 5432. AAAA 1198 1000. AAAA 7654. AAAA 3210. 1000. 0000. 0000. 0000. 0000. FFFFF. 1111. 1111. 1111. 1111. 1111. A19 phải ở mức “1” thì chip nhớ mới hoạt động (được chọn).

<span class='text_page_counter'>(266)</span> Giải mã đầy đủ A19 đến A0 (HEX) 00000. AAAA 1111 9876. AAAA 1111 5432. AAAA 1198 1000. AAAA 7654. AAAA 3210. 0000. 0000. 0000. 0000. 0000. 7FFFF. 0111. 1111. 1111. 1111. 1111. Do đó, nếu vi xử lý phát ra một địa chỉ từ 00000h đến 7FFFFh (A19 ở mức logic “0”) chip nhớ sẽ không được chọn..

<span class='text_page_counter'>(267)</span> Giải mã không đầy đủ AX BX. 3F1C 0023. CX DX. 0000 FCA1. CS. XXXX. SS DS ES. XXXX 2000 XXXX. BP SP. XXXX XXXX. SI. XXXX. DI. XXXX. IP. XXXX. A19 A18 : A0. A18 : A0. D7 : D0. D7 : D0. MEMR MEMW. 7FFFF 7FFFE 7FFFD : :. 36 25 19 : :. 20023 20022 20021. 13 7D 12. RD. 20020. 29. WR. : :. CS. : :. 00001. 95. 00000. 23.

<span class='text_page_counter'>(268)</span> Giải mã không đầy đủ A19 đến A0 (HEX) 00000. AAAA 1111 9876. AAAA 1111 5432. AAAA 1198 1000. AAAA 7654. AAAA 3210. 0000. 0000. 0000. 0000. 0000. 7FFFF. 0111. 1111. 1111. 1111. 1111. 80000. 1000. 0000. 0000. 0000. 0000. FFFFF. 1111. 1111. 1111. 1111. 1111. A19 không có ý nghĩa với chip nhớ.

<span class='text_page_counter'>(269)</span> Giải mã không đầy đủ A19 đến A0 (HEX) 00000. AAAA 1111 9876. AAAA 1111 5432. AAAA 1198 1000. AAAA 7654. AAAA 3210. 0000. 0000. 0000. 0000. 0000. 7FFFF. 0111. 1111. 1111. 1111. 1111. 80000. 1000. 0000. 0000. 0000. 0000. FFFFF. 1111. 1111. 1111. 1111. 1111. Địa chỉ thực tế.

<span class='text_page_counter'>(270)</span> Giải mã không đầy đủ A19 đến A0 (HEX) 00000. AAAA 1111 9876. AAAA 1111 5432. AAAA 1198 1000. AAAA 7654. AAAA 3210. 0000. 0000. 0000. 0000. 0000. 7FFFF. 0111. 1111. 1111. 1111. 1111. 80000. 1000. 0000. 0000. 0000. 0000. FFFFF. 1111. 1111. 1111. 1111. 1111. Địa chỉ thực tế.

<span class='text_page_counter'>(271)</span> Bộ nhớ gồm 2 chip 512Kx8 A19 A18 :. A18 :. A0. A0. D7. D7. :. :. D0. D0. MEMR. RD. MEMW. WR. 8088 Minimum Mode. 512KB #2. CS. A18 : A0 D7 : D0 RD WR CS. 512KB #1.

<span class='text_page_counter'>(272)</span> Bộ nhớ chỉ có một chip 512Kx8 (Ver. 1) A19 A18 :. A18 :. A0. A0. D7. D7. :. :. D0. D0. MEMR. RD. MEMW. WR. 8088 Minimum Mode. CS. 512KB.

<span class='text_page_counter'>(273)</span> Bộ nhớ chỉ có một chip 512Kx8 (Ver. 2) A19 A18 :. A18 :. A0. A0. D7. D7. :. :. D0. D0. MEMR. RD. MEMW. WR. 8088 Minimum Mode. CS. 512KB.

<span class='text_page_counter'>(274)</span> Bộ nhớ chỉ có một chip 512Kx8 (Ver. 3) A19 A18 :. A18 :. A0. A0. D7. D7. :. :. D0. D0. MEMR. RD. MEMW. WR. 8088 Minimum Mode. CS. 512KB.

<span class='text_page_counter'>(275)</span> A17 :. Bộ nhớ gồm 4 chip 256Kx8. A0 D7 :. D0 RD WR A19 A18. CS. A17. A17. :. A0 D7 :. D0 MEMR MEMW. 8088 Minimum Mode. 256KB #4. :. A0 D7 :. D0 RD WR. 256KB #3. CS A17 :. A0 D7 :. D0 RD WR. 256KB #2. CS A17 :. A0 D7 :. D0 RD WR CS. 256KB #1.

<span class='text_page_counter'>(276)</span> A17 :. Bộ nhớ gồm 4 chip 256Kx8. A0 D7 :. D0 RD WR A19 A18. CS. A17. A17. :. A0 D7 :. D0 MEMR MEMW. 8088 Minimum Mode. 256KB #4. :. A0 D7 :. D0 RD WR. 256KB #3. CS A17 :. A0 D7 :. D0 RD WR. 256KB #2. CS A17 :. A0 D7 :. D0 RD WR CS. 256KB #1.

<span class='text_page_counter'>(277)</span> Dải địa chỉ của chip #1 A19 đến A0 (HEX). AAAA 1111 9876. AAAA 1111 5432. AAAA 1198 1000. AAAA 7654. AAAA 3210. ----- ----. ----. ----. ----. ----. ----- ----. ----. ----. ----. ----.

<span class='text_page_counter'>(278)</span> Dải địa chỉ của chip #2 A19 đến A0 (HEX). AAAA 1111 9876. AAAA 1111 5432. AAAA 1198 1000. AAAA 7654. AAAA 3210. ----- ----. ----. ----. ----. ----. ----- ----. ----. ----. ----. ----.

<span class='text_page_counter'>(279)</span> Dải địa chỉ của chip #3 A19 đến A0 (HEX). AAAA 1111 9876. AAAA 1111 5432. AAAA 1198 1000. AAAA 7654. AAAA 3210. ----- ----. ----. ----. ----. ----. ----- ----. ----. ----. ----. ----.

<span class='text_page_counter'>(280)</span> Dải địa chỉ của chip #4 A19 đến A0 (HEX). AAAA 1111 9876. AAAA 1111 5432. AAAA 1198 1000. AAAA 7654. AAAA 3210. ----- ----. ----. ----. ----. ----. ----- ----. ----. ----. ----. ----.

<span class='text_page_counter'>(281)</span> A17. Bộ nhớ gồm 4 chip 256Kx8 dùng các cổng logic. :. A0 D7 :. D0 RD WR A19 A18. CS. A17. A17. :. A0 D7 :. D0 MEMR MEMW. 8088 Minimum Mode. 256KB #4. :. A0 D7 :. D0 RD WR. 256KB #3. CS A17 :. A0 D7 :. D0 RD WR. 256KB #2. CS A17 :. A0 D7 :. D0 RD WR CS. 256KB #1.

<span class='text_page_counter'>(282)</span> A17. Bộ nhớ gồm 4 chip 256Kx8 dùng các cổng logic. :. A0 D7 :. D0 RD WR A19 A18. CS. A17. A17. :. A0 D7 :. D0 MEMR MEMW. 8088 Minimum Mode. 256KB #4. :. A0 D7 :. D0 RD WR. 256KB #3. CS A17 :. A0 D7 :. D0 RD WR. 256KB #2. CS A17 :. A0 D7 :. D0 RD WR CS. 256KB #1.

<span class='text_page_counter'>(283)</span> A17. Bộ nhớ gồm 4 chip 256Kx8 dùng một chip giải mã 2-4. :. A0 D7 :. D0 RD WR A19 A18. I1 I0. O3. A17. CS A17. :. :. A0 D7. A0 D7. :. :. D0 MEMR MEMW. 8088 Minimum Mode. 256KB #4. D0 RD WR O2. 256KB #3. CS A17 :. A0 D7 :. D0 RD WR O1. 256KB #2. CS A17 :. A0 D7 :. D0 RD WR O0. CS. 256KB #1.

<span class='text_page_counter'>(284)</span> A12 :. Ghép nối các chip nhớ 8Kx8 với µP 8088. A19 A18 A17 A16 A15 A14 A13. A0 D7 :. D0 RD WR CS. A12. : :. :. A0 D7 :. D0 MEMR MEMW. 8088 Minimum Mode. 8KB #?. A12 :. A0 D7 :. D0 RD WR. 8KB #2. CS A12 :. A0 D7 :. D0 RD WR CS. 8KB #1.

<span class='text_page_counter'>(285)</span> A12 :. Bộ nhớ gồm 128 chip 8Kx8. A19 A18 A17 A16 A15 A14 A13. A0 D7 :. D0 RD WR CS. A12. : :. :. A0 D7 :. D0 MEMR MEMW. 8088 Minimum Mode. 8KB #128. A12 :. A0 D7 :. D0 RD WR. 8KB #2. CS A12 :. A0 D7 :. D0 RD WR CS. 8KB #1.

<span class='text_page_counter'>(286)</span> A12 :. Bộ nhớ gồm 128 chip 8Kx8. A19 A18 A17 A16 A15 A14 A13. A0 D7 :. D0 RD WR CS. A12. : :. :. A0 D7 :. D0 MEMR MEMW. 8088 Minimum Mode. 8KB #128. A12 :. A0 D7 :. D0 RD WR. 8KB #2. CS A12 :. A0 D7 :. D0 RD WR CS. 8KB #1.

<span class='text_page_counter'>(287)</span> Dải địa chỉ của Chip #__ A19 AAAA đến 1111 A0 9876 (HEX). AAAA 1111 5432. AAAA 1198 1000. AAAA 7654. AAAA 3210. ----- ----. ----. ----. ----. ----. ----- ----. ----. ----. ----. ----.

<span class='text_page_counter'>(288)</span> A12 :. Bộ nhớ gồm 128 chip 8Kx8. A19 A18 A17 A16 A15 A14 A13. A0 D7 :. D0 RD WR CS. A12. : :. :. A0 D7 :. D0 MEMR MEMW. 8088 Minimum Mode. 8KB #128. A12 :. A0 D7 :. D0 RD WR. 8KB #2. CS A12 :. A0 D7 :. D0 RD WR CS. 8KB #1.

<span class='text_page_counter'>(289)</span> Phát biểu bài toán „. „. „. „. Thiết kế bộ nhớ cho hệ vi xử lý 8088 thoả mãn các yêu cầu: ROM có dung lượng 2Kx8 chiếm dụng các địa chỉ từ FFFFFh trở xuống RWM có dung lượng 2Kx8 chiếm dụng các địa chỉ tiếp theo ngay sau ROM Chỉ được phép sử dụng: EPROM 2716 2Kx8, SRAM 4016 2Kx8 Chip giải mã 74LS138 và các cổng logic.

<span class='text_page_counter'>(290)</span> Bước 1: Vẽ bản đồ bộ nhớ cần thiết kế FFFFFh. ROM. 2K. FF800h FF7FFh RWM. Các Địa chỉ biên. 2K. FF000h. Chưa sử dụng 00000h.

<span class='text_page_counter'>(291)</span> Bước 2: Chuyển các địa chỉ biên từ H sang B A19 đến A0 (HEX) FF800. AAAA 1111 9876. AAAA 1111 5432. AAAA 1198 1000. AAAA 7654. AAAA 3210. 1111. 1111. 1000. 0000. 0000. FFFFF. 1111. 1111. 1111. 1111. 1111.

<span class='text_page_counter'>(292)</span> Bước 2: Chuyển các địa chỉ biên từ H sang B A19 đến A0 (HEX) FF000. AAAA 1111 9876. AAAA 1111 5432. AAAA 1198 1000. AAAA 7654. AAAA 3210. 1111. 1111. 0000. 0000. 0000. FF7FF. 1111. 1111. 0111. 1111. 1111.

<span class='text_page_counter'>(293)</span> Nhận xét „. „. Khi các địa chỉ dành cho ROM được phát lên A-Bus: A19 – A12 = 1 và A11 = 1 Khi các địa chỉ dành cho RWM được phát lên A-Bus: A19 – A12 = 1 và A11 = 0.

<span class='text_page_counter'>(294)</span> Bước 3: Vẽ mạch giải mã địa chỉ bộ nhớ „. „. „. Ghép các chân dữ liệu của các chip nhớ với D-Bus Ghép các chân địa chỉ và các chân điều khiển: Khi vi xử lý truy cập các cổng I/O thì các chip nhớ bị cấm (Khi IO/M = 1) Khi vi xử lý truy cập bộ nhớ (IO/M = 0) thì chỉ có một chip nhớ làm việc Có thể có nhiều lời giải khác nhau.

<span class='text_page_counter'>(295)</span> 74LS138: Một chip giải mã 3-8 C. Y0. B. Y1. A. Y2 Y3. 74LS138. Y4. G1. Y5. G2A. Y6. G2B. Y7. U1 74LS138 74LS138 A2 A1 A0 E3 E2 E1. Q7 Q6 Q5 Q4 Q3 Q2 Q1 Q0.

<span class='text_page_counter'>(296)</span> Bộ nhớ cần thiết kế A19 A18 A17 :. A0 D7 :. D0 MEMR MEMW. 8088 Minimum Mode. C B A 74LS138. G1 G2A G2B. Y0 Y1 Y2 Y3 Y4 Y5 Y6 Y7. A10 :. A0 D7 :. D0 OE WE. 2Kx8 4016. CS. A10 :. A0 D7 :. D0 OE CE. 2Kx8 2716.

<span class='text_page_counter'>(297)</span> Bài giảng Kỹ thuật Vi xử lý Ngành Điện tử-Viễn thông Đại học Bách khoa Đà Nẵng của Hồ Viết Việt, Khoa ĐTVT. Tài liệu tham khảo [1] Kỹ thuật vi xử lý, Văn Thế Minh, NXB Giáo dục, 1997 [2] Kỹ thuật vi xử lý và Lập trình Assembly cho hệ vi xử lý, Đỗ Xuân Tiến, NXB Khoa học & kỹ thuật, 2001.

<span class='text_page_counter'>(298)</span> Chương 5 Thiết kế các cổng I/O 5.1 I/O được phân vùng nhớ và I/O tách biệt - I/O được phân vùng nhớ (Memory Mapped I/O) - I/O tách biệt (Isolated I/O). 5.2 Các chip MSI dùng làm cổng I/O - Cổng ra - Cổng vào. 5.3 Chip 8255 - Sơ đồ chân, Sơ đồ khối chức năng - Các mode hoạt động - Giải mã địa chỉ - Lập trình cho 8255.

<span class='text_page_counter'>(299)</span> 5.1 Cần phân biệt 2 kiểu thiết kế • I/O được phân vùng nhớ (Memory mapped I/O): - 1 cổng được xem như một ô nhớ - 1 cổng có địa chỉ 20-bit - được truy cập khi IO/M = 0 - không cần mạch giải mã địa chỉ riêng • I/O tách biệt (isolated I/O) - 1 cổng được xem đúng là 1 cổng - 1 cổng có địa chỉ 16-bit, 12-bit, 8-bit - được truy cập khi IO/M = 1 - cần mạch giải mã địa chỉ I/O riêng.

<span class='text_page_counter'>(300)</span> 5.2 Các chip MSI thường dùng làm cổng I/O. • • • • • •. 74LS373 74LS374 74LS244 74LS245 Khi số lượng cổng ít và cố định Cách mắc mạch sẽ quyết định cho chip là cổng ra hay cổng vào và địa chỉ của nó.

<span class='text_page_counter'>(301)</span> Sử dụng 74LS245 làm cổng ra A19 A18 : A0. 8088 Minimum Mode. D7 D6 D5 D4 D3 D2 D1 D0. A0 B0 A1 B1 A2 B2 A3 B3 A4 B4 74LS245 A5 B5 A6 B6 A7 B7 E. IOR IOW. A A A A A A A A A A A A A A A A IOW 1111119876543210 543210. DIR. 5V. : mov al, 55 mov dx, F000 out dx, al :.

<span class='text_page_counter'>(302)</span> Sử dụng 74LS373 làm cổng ra A19 A18 : A0 D7 D6 D5 D4. 8088 Minimum Mode. D3 D2 D1 D0. D0 Q0 D1 Q1 D2 Q2 D3 Q3 D4 Q4 74LS373 D5 Q5 D6 Q6 D7 Q7 LE. IOR IOW. A A A A A A A A A A A A A A A A IOW 1111119876543210 543210. OE. : mov al, 55 mov dx, F000 out dx, al :.

<span class='text_page_counter'>(303)</span> Sử dụng 74LS245 làm cổng vào 5V. A19 A18 : A0 D7 D6 D5 D4. 8088 Minimum Mode. D3 D2 D1 D0. A0 B0 A1 B1 A2 B2 A3 B3 A4 B4 74LS245 A5 B5 A6 B6 A7 B7 E. IOR IOW. DIR. : mov dx, F000 in al, dx : A A A A A A A A A A A A A A A A IOR 1111119876543210 543210.

<span class='text_page_counter'>(304)</span> Cổng ra.

<span class='text_page_counter'>(305)</span> Cổng vào.

<span class='text_page_counter'>(306)</span> 5.3 Chip LSI thường dùng làm cổng I/O • PPI 8255 • Khi số lượng cổng I/O nhiều và không cố định • Cách mắc mạch sẽ quyết định địa chỉ cho các cổng còn vai trò của cổng sẽ được quyết định bởi phần mềm.

<span class='text_page_counter'>(307)</span> 8255 PPI.

<span class='text_page_counter'>(308)</span> Sơ đồ khối chức năng của 8255.

<span class='text_page_counter'>(309)</span> Các mode làm việc • Mode 0 - PA, PB, PCH (CU) và PCL (CL) - Có thể là Input hoặc Output - Việc Nhập hoặc Xuất dữ liệu là độc lập • Mode 1 - PA, PB - Có thể là Input hoặc Output - Việc Nhập hoặc Xuất dữ liệu là phụ thuộc vào một số bít của PC (các tín hiệu handshaking) • Mode 2 - PA - PA vừa là Input vừa là Output - Việc Nhập/Xuất dữ liệu với PA là phụ thuộc vào một số bít của PC (các tín hiệu handshaking).

<span class='text_page_counter'>(310)</span> Nhóm làm việc • Nhóm A: PA và PCH • Nhóm B: PB và PCL • Định cấu hình làm việc cho 1 chip 8255: Gửi 1 Từ điều khiển định cấu hình đến thanh ghi điều khiển của chip đó • Lập/xoá một bit của PC: Gửi 1 Từ điều khiển Lập/Xoá bit đến thanh ghi điều khiển của chip đó.

<span class='text_page_counter'>(311)</span> Từ điều khiển định cấu hình làm việc cho một chip 8255.

<span class='text_page_counter'>(312)</span> Từ điều khiển lập/xoá bit cho một chip 8255.

<span class='text_page_counter'>(313)</span>

<span class='text_page_counter'>(314)</span>

<span class='text_page_counter'>(315)</span>

<span class='text_page_counter'>(316)</span>

<span class='text_page_counter'>(317)</span>

<span class='text_page_counter'>(318)</span>

<span class='text_page_counter'>(319)</span> The 8255 Programmable Peripheral Interface • Intel has developed several peripheral controller chips designed to support the 80x86 processor family. The intent is to provide a complete I/O interface in one chip. • 8255 PPI provides three 8 bit input ports in one 40 pin package making it more economical than 74LS373 and 74LS244 • The chip interfaces directly to the data bus of the processor, allowing its functions to be programmed; that is in one application a port may appear as an output, but in another, by reprogramming it as an input. This is in contrast with the 74LS373 and 74LS244 which are hard wired and fixed. 8255 Pins • PA0 - PA7: input, output, or bidirectional port • PB0 - PB7: input or output • PC0 - PC7: This 8 bit port can be all input or output. It can also be split into two parts, CU (PC4 - PC7) and CL (PC0 - PC3). Each can be used for input and output. • RD or WR – IOR and IOW of the system are connected to these two pins • RESET • A0, A1, and CS – CS selects the entire chip whereas A0 and A1 select the specific port (A, B, or C) or Control Register..

<span class='text_page_counter'>(320)</span> Giải mã địa chỉ cho 8255.

<span class='text_page_counter'>(321)</span> Mode 0 - Simple input/output • Simple I/O mode: any of the ports A, B, CL, and CU can be programmed as input or output. • Example: Configure port A as input, B as output, and all the bits of port C as output assuming a base address of 50h • Control word should be 1001 0000b = 90h MOV AL, 90h OUT 53h,AL IN AL, 50h OUT 51h, AL OUT 52h, AL. Mode 1: I/O with Handshaking Capability • Handshaking refers to the process of communicating back and forth between two intelligent devices • Example. Process of communicating with a printer – a byte of data is presented to the data bus of the printer – the printer is informed of the presence of a byte of data to be printed by activating its strobe signal – whenever the printer receives the data it informs the sender by activating an output signal called ACK – the ACK signal initiates the process of providing another byte of data to the printer • 8255 in mode 1 is equipped with resources to handle handshaking signals.

<span class='text_page_counter'>(322)</span> Mode 1 Strobed Output Signals • OBFa (output buffer full for port A) – indicates that the CPU has written a byte of data into port A – must be connected to the STROBE of the receiving equipment • ACKa (acknowledge for port A) – through ACK, 8255 knows that data at port A has been picked up by the receiving device – 8255 then makes OBFa high to indicate that the data is old now. OBFa will not go low until the CPU writes a new byte of data to port A. • INTRa (interrupt request for port A) – it is the rising edge of ACK that activates INTRa by making it high. INTRa is used to get the attention of the microprocessor. – it is important that INTRa is high only if INTEa, OBFa, ACKa are all high – it is reset to zero when the CPU writes a byte to port A.

<span class='text_page_counter'>(323)</span> Mode 1 Input Ports with Handshaking Signals • STB – When an external peripheral device provides a byte of data to an input port, it informs the 8255 through the STB pin. STB is of limited duration. • IBF (Input Buffer Full) – In response to STB, the 8255 latches into its internal register the data present at PA0-PA7 or PB0-PB7. – Through IBF it indicates that it has latched the data but it has not been read by the CPU yet. – To get the attention of the CPU, it IBF activates INTR • INTR – Falling edge of RD makes INTR low – The RD signal from the CPU is of limited duration and when it goes high the 8255 in turn makes IBF inactive by setting it low. – IBF in this way lets the peripheral know that the byte of data was latched by the 8255 and read into the CPU as well..

<span class='text_page_counter'>(324)</span>

<span class='text_page_counter'>(325)</span> Lập trình cho 8255.

<span class='text_page_counter'>(326)</span> Lời giải.

<span class='text_page_counter'>(327)</span> Lập trình cho 8255 B. A.

<span class='text_page_counter'>(328)</span> Lời giải.

<span class='text_page_counter'>(329)</span> Tạo chuỗi xung bằng phần mềm.

<span class='text_page_counter'>(330)</span> Bài giảng Kỹ thuật Vi xử lý Ngành Điện tử-Viễn thông Đại học Bách khoa Đà Nẵng của Hồ Viết Việt, Khoa ĐTVT. Tài liệu tham khảo [1] Kỹ thuật vi xử lý, Văn Thế Minh, NXB Giáo dục, 1997 [2] Kỹ thuật vi xử lý và Lập trình Assembly cho hệ vi xử lý, Đỗ Xuân Tiến, NXB Khoa học & kỹ thuật, 2001.

<span class='text_page_counter'>(331)</span> Chương 6 Các kiểu I/O 6.1 Thăm dò (Polling) 6.2 I/O điều khiển bằng ngắt (Interrupt) -. 6.3 DMA (Direct Memory Access).

<span class='text_page_counter'>(332)</span> Thăm dò 5V. A19 A18 : A0 D7 D6 D5 D4. 8088 Minimum Mode. D3 D2 D1 D0. A0 B0 A1 B1 A2 B2 A3 B3 A4 B4 74LS245 A5 B5 A6 B6 A7 B7 E. IOR IOW. DIR. mov L1: in cmp je A A A A A A A A A A A A A A A A IOR 1111119876543210 543210. dx, F000 al, dx al, FF L1 : :.

<span class='text_page_counter'>(333)</span> 5V. A19 A18 : A0. 8088 Minimum Mode. D7 D6 D5 D4 D3 D2 D1 D0. The Circuit A0 B0 A1 B1 A2 B2 A3 B3 A4 B4 74LS245 A5 B5 A6 B6 A7 B7 E. DIR D0 Q0 D1 Q1 D2 Q2 D3 Q3 D4 Q4 D574LS373 Q5 D6 Q6 D7 Q7. IOR IOW. A A A A A A A A A A A A A A A A IOR 1111119876543210 543210. LE. AAAAAAAAAAAAAAAAIOW 1111119876543210 543210. OE.

<span class='text_page_counter'>(334)</span> Bài toán • Chương trình tạo ra hiệu ứng “LED chạy”: - Ban đầu LED chạy từ trên xuống - Khi nhấn phím thấp nhất thì LED thay đổi hướng chạy - Khi nhấn phím cao nhất thì chương trình kết thúc.

<span class='text_page_counter'>(335)</span> Chương trình. L1: L2:. L3:. mov mov mov out mov dec jnz cmp jne rol cmp jne jmp ror cmp jne. dx, ah, al, dx, cx, cx L2 ah, L3 al, al, L1 L4 al, al, L1. F000 00 01 al FFFF. L4:. 00 1 01. L5: L6:. 1 80. L7:. mov bl, in al, cmp al, je L6 test al, jnz L5 xor ah, jmp L6 test al, jz L7 mov al, jmp L1. al dx FF 01 FF 80 bl.

<span class='text_page_counter'>(336)</span> Khuyết điểm của thăm dò • Tốn nhiều thời gian • NgườI sử dụng có thể nhả phím trước khi lệnh in al, dx được thực hiện, do đó bộ vi xi xử lý sẽ không biết rằng ngườI sử dụng đã nhấn phím • Làm sao để khắc phục các khuyết điểm đó?.

<span class='text_page_counter'>(337)</span> Khuyết điểm của thăm dò L1: L2:. L3:. mov mov mov out mov dec jnz cmp jne rol cmp jne jmp ror cmp jne. dx, ah, al, dx, cx, cx L2 ah, L3 al, al, L1 L4 al, al, L1. F000 00 01 al FFFF. L4:. 00 1 01. L5: L6:. 1 80. L7:. mov bl, in al, cmp al, je L6 test al, jnz L5 xor ah, jmp L6 test al, jz L7 mov al, jmp L1. al dx FF 01 FF 80 bl.

<span class='text_page_counter'>(338)</span> Ngắt là gì?.

<span class='text_page_counter'>(339)</span> Thăm dò instruction While studying, I’ll check the bucket every 5 minutes to see if it is already full so that I can transfer the content of the bucket to the drum.. µP THĂM DÒ. Input Memory Device.

<span class='text_page_counter'>(340)</span> Ngắt instruction I’ll just study. When the speaker starts playing music it means that the bucket is full. I can then transfer the content of the bucket to the drum.. Interrupt request µP INTERRUPT. Input Memory Device.

<span class='text_page_counter'>(341)</span> Interrupt- Ngắt • Bộ vi xử lý không cần phải kiểm tra tính sẵn sàng của thiết bị I/O. • Các thiết bị I/O sẽ báo cho vi xử lý biết khi chúng đã sẵn sàng • Bộ vi xử lý có thể làm công việc khác khi thiết bị I/O không có nhu cầu trao đổI dữ liệu.

<span class='text_page_counter'>(342)</span> Interrupt- Ngắt • Một số thuật ngữ cần nhớ: – Yêu cầu ngắt – Đầu vào ngắt – Đầu ra chấp nhận ngắt – Chương trình con phục vụ ngắt – Vector ngắt – Số ngắt – Bảng các vector ngắt.

<span class='text_page_counter'>(343)</span> Interrupt Service Routine (ISR) - Chương trình con phục vụ ngắt Interrupt vector - Vector ngắt. • Là chương trình được thực hiện khi có một yêu cầu ngắt được chấp nhận • Kết thúc bằng lệnh IRET • Địa chỉ của chương trình con phục vụ ngắt • Bao gồm 4 byte: – 2 byte cho địa chỉ Offset – 2 byte cho địa chỉ Segment.

<span class='text_page_counter'>(344)</span> Interrupt Vector Number Số ngắt • Là một số được dùng để phân biệt các yếu cầu ngắt. Bởi vì có thể có nhiều hơn một thiết bị phát yêu cầu ngắt đến bộ vi xử lý cho nên để cho bộ vi xử lý có thể nhận biết được thiết bị thì mỗI thiết bị sẽ được gán cho một số ngắt • Trong hệ thống 8088, co thể có đến 256 số ngắt (từ 00h đến FFh).

<span class='text_page_counter'>(345)</span> Interrupt Vector Table Bảng các vector ngắt • Là vùng nhớ được dành riêng để lưu trữ các vector ngắt • Có thể xem như là một mảng các vector ngắt – Mảng này có 256 phần tử – Mỗi phần tử gồm 4 byte: 2 byte đầu lưu địa chỉ offset, 2 byte sau lưu địa chỉ segment – Các vector ngắt được lưu trữ theo trật tự tăng dần của số ngắt.

<span class='text_page_counter'>(346)</span> Bảng các vector ngắt.

<span class='text_page_counter'>(347)</span> Phản ứng của vi xử lý khi không có ngắt • Khi bật công tấc nguồn hoặc nhấn nút reset. 1. Bộ vi xử lý được khởi động: – (IP) = 0000h – (CS) = FFFFh – IF = 0 2. Bộ vi xử lý tìm và lấy 1 byte lệnh. 3. IP tăng lên 1. 4. Bộ vi xử lý giải mã và thực hiện lệnh nếu tất cả các byte lệnh của một lệnh đã được lấy. 5. Quay trỏ lại bước 2..

<span class='text_page_counter'>(348)</span> Phản ứng của vi xử lý khi có ngắt •. Thiết bị I/O đưa yêu cầu ngắt đến bộ vi xử lý bằng cách làm cho đầu vào ngắt INTR chuyển sang mức cao. 6. Bộ vi xử lý sẽ hoàn thành lệnh đang thực hiện trước khi chấp nhận ngắt 7. Bộ vi xử lý chấp nhận ngắt bằng cách đưa ra tín hiệu chấp nhận ngắt ở mức thấp từ chân INTA. Lúc này thiết bị I/O sẽ làm cho tín hiệu ở INTR chuyển về mức thấp. 8. Thiết bị I/O sẽ đưa số ngắt được gán cho nó đến bộ vi xử lý thông qua D-Bus. Bộ vi xử lý sẽ lưu trữ số ngắt này vào một thanh ghi tạm thời.

<span class='text_page_counter'>(349)</span> Phản ứng của vi xử lý khi có ngắt 9. 10. 11. 12. 13.. Bộ vi xử lý lưu giá trị hiện thời của thanh ghi cờ vào stack. Bộ vi xử lý xoá cờ ngắt Bộ vi xử lý lưu giá trị hiện thời của CS vào stack. Bộ vi xử lý lưu giá trị hiện thời của IP vào stack. Bộ vi xử lý nhân số ngắt với 4. Kết quả này chính là địa chỉ của nơi lưu trữ vector ngắt tương ứng trong bảng các vector ngắt. Hai byte đầu tiên của vector ngắt được copy vào IP và hai byte tiếp theo được copy vào CS. 14. Quay trở về bước 2..

<span class='text_page_counter'>(350)</span> 8088 và một thiết bị ra đơn giản A19 A18 : A0 D7 D6 D5 D4. 8088 Minimum Mode. D3 D2 D1 D0. D0 Q0 D1 Q1 D2 Q2 D3 Q3 D4 Q4 74LS373 D5 Q5 D6 Q6 D7 Q7 LE. IOR IOW. A A A A A A A A A A A A A A A A IOW 1111119876543210 543210. OE.

<span class='text_page_counter'>(351)</span> 8088 và một thiết bị vào đơn giản 5V. A19 A18 : A0 D7 D6 D5 D4. 8088 Minimum Mode. D3 D2 D1 D0. A0 B0 A1 B1 A2 B2 A3 B3 A4 B4 74LS245 A5 B5 A6 B6 A7 B7 E. IOR IOW. A A A A A A A A A A A A A A A A IOR 1111119876543210 543210. DIR.

<span class='text_page_counter'>(352)</span> 8088 và thiết bị vào hoạt động theo cơ chế ngắt 5V. A19 A18 : A0 D7 D6 D5 D4. 8088 Minimum Mode. D3 D2 D1 D0. A7 B7 A6 B6 A5 B5 A4 B4 A3 B3 74LS245 A2 B2 A1 B1 A0 B0 E. DIR. IOR IOW INTR INTA INTR A A A A A A A A A A A A A A A A IOR 1111119876543210 543210.

<span class='text_page_counter'>(353)</span> 8088 và một thiết bị vào hoạt động theo cơ chế ngắt. 5V. A19 A18 : A0. 8088 Minimum Mode. D7. A7. B0. D6. A6. B1. D5. A5. B2. D4. A4. B3. D3. A3. B4. D2. 74LS245 B5 A2. D1. A1. B6. D0. A0. B7. E. DIR. IOR 5V. IOW INTR 5V. INTA. A A A A A A A A A A A A A A A A IOR 1111119876543210 543210. D. set. Q. clr. Q. 5V. INTR.

<span class='text_page_counter'>(354)</span> 8088 và một thiết bị vào hoạt động theo cơ chế ngắt 5V. A19 A18 : A0. 8088 Minimum Mode. D7. A7. B7. D6. A6. B6. D5. A5. B5. D4. A4. B4. D3. A3. B3. D2. 74LS245 B2 A2. D1. A1. B1. D0. A0. B0. E. DIR. IOR 5V. IOW INTR 5V. INTA. A A A A A A A A A A A A A A A A IOR 1111119876543210 543210. D. set. Q. clr. Q. INTA. INTR.

<span class='text_page_counter'>(355)</span> 8088 và một thiết bị vào hoạt động theo cơ chế ngắt. 5V. A19 A18 :. 5V. A0. 8088 Minimum Mode. D7. A7. B7. D6. A6. B6. D5. A5. B5. B4 B3. D4. A4. B4. A2. 74LS245 B2. D3 D2. A3 B3 74LS245 A2 B2. D1. A1. B1. D1. A1. B1. D0. A0. B0. D0. A0. B0. D7. A7. B7. D6. A6. B6. D5. A5. B5. D4 D3. A4 A3. D2. E. E. INTA. DIR. DIR. IOR 5V. IOW INTR INTA. 5V. A A A A A A A A A A A A A A A A IOR 1111119876543210 543210. D. set. Q. clr. Q. INTA. INTR.

<span class='text_page_counter'>(356)</span> 8088 và một thiết bị vào hoạt động theo cơ chế ngắt. 5V. A19. INT 3. A18 : A0. 8088 Minimum Mode. 5V. D7. A7. B7. D6. A6. B6. D5 D4. A5 A4. B5 B4. D3. A3. B3. D2. 74LS245 B2 A2. D1. A1. B1. D0. A0. B0. E. D7. A7. B7. D6. A6. B6. D5. A5. B5. D4 D3. A4 A3. B4 B3. D2. A2. 74LS245 B2. D1. A1. B1. D0. A0. B0. E. INTA. DIR. DIR. IOR IOW. 5V. INTR 5V. INTA. A A A A A A A A A A A A A A A A IOR 1111119876543210 543210. D. set. Q. clr. Q. INTR. INTA RESET.

<span class='text_page_counter'>(357)</span> 5V A19 : A0. 8088 Minimum Mode. D7 D6 D5 D4 D3 D2 D1 D0. A0 B0 A1 B1 A2 B2 A3 B3 A4 B4 74LS245 A5 B5 A6 B6 A7 B7 E. IOR IOW. DIR. D0 Q0 D1 Q1 D2 Q2 D3 Q3 D4 Q4 74LS373 D5 Q5 D6 Q6 D7 Q7 A A A A A A A A A A A A A A A A IOR 1111119876543210 543210. LE. A A A A A A A A A A A A A A A A IOW 1111119876543210 543210. OE.

<span class='text_page_counter'>(358)</span> Chương trình chính ISR bắt đầu từ 52800h mov mov mov mov mov mov mov sti mov mov mov. ax,0000 ds, ax bx, 000C ax, 2800 [bx], ax ax, 5000 [bx+02], ax dx, F000 ah, 00 al, 01. Kết thúc L1:. L2:. L3: L4:. cmp je out mov dec jnz cmp jne rol jmp ror jmp. ah, L4 dx, cx, cx L2 ah, L3 al, L1 al, L1. 88 al FFFF. 00 1 1.

<span class='text_page_counter'>(359)</span> Chương trình con phục vụ ngắt (ISR). S1:. S2:. mov in test jnz xor jmp test jnz mov mov iret. bl, al, al, S1 ah, S2 al, S2 ah, al,. al dx 01 FF 80 88 bl.

<span class='text_page_counter'>(360)</span> 8259.

<span class='text_page_counter'>(361)</span> 8259.

<span class='text_page_counter'>(362)</span> Khởi động 8259.

<span class='text_page_counter'>(363)</span> ICW.

<span class='text_page_counter'>(364)</span> ICW1, ICW2.

<span class='text_page_counter'>(365)</span> ICW3, ICW4.

<span class='text_page_counter'>(366)</span>

<span class='text_page_counter'>(367)</span> OCW1 và OCW2.

<span class='text_page_counter'>(368)</span> OCW3.

<span class='text_page_counter'>(369)</span> 8259 đơn. ICW1: 13H ICW2: 08H ICW3: 09H.

<span class='text_page_counter'>(370)</span> Ví dụ: Mạch điều khiển ngắt ở PC.

<span class='text_page_counter'>(371)</span> 8259s nối tầng.

<span class='text_page_counter'>(372)</span> 8259s nối tầng.

<span class='text_page_counter'>(373)</span> M2716 NMOS 16K (2K x 8) UV EPROM 2048 x 8 ORGANIZATION 525mW Max ACTIVE POWER, 132mW Max STANDBY POWER ACCESS TIME: – M2716-1 is 350ns – M2716 is 450ns SINGLE 5V SUPPLY VOLTAGE STATIC-NO CLOCKS REQUIRED INPUTS and OUTPUTS TTL COMPATIBLE DURING BOTH READ and PROGRAM MODES THREE-STATE OUTPUT with TIED-ORCAPABILITY EXTENDED TEMPERATURE RANGE PROGRAMMING VOLTAGE: 25V. 24. 1. FDIP24W (F). Figure 1. Logic Diagram. DESCRIPTION The M2716 is a 16,384 bit UV erasable and electrically programmable memory EPROM, ideally suited for applications where fast turn around and pattern experimentation are important requirements. The M2716 is housed in a 24 pin Window Ceramic Frit-Seal Dual-in-Line package. The transparent lid allows the user to expose the chip to ultraviolet light to erase the bit pattern. A new pattern can then be written to the device by following the programming procedure.. VCC. VPP. 11. 8. A0-A10. EP. Q0-Q7. M2716. G. Table 1. Signal Names A0 - A10. Address Inputs. Q0 - Q7. Data Outputs. EP. Chip Enable / Program. G. Output Enable. VPP. Program Supply. VCC. Supply Voltage. VSS. Ground. VSS AI00784B. July 1994. 1/9.

<span class='text_page_counter'>(374)</span> M2716. Table 2. Absolute Maximum Ratings Symbol. Parameter. Value. Unit. Ambient Operating Temperature. grade 1 grade 6. 0 to 70 –40 to 85. °C. TBIAS. Temperature Under Bias. grade 1 grade 6. –10 to 80 –50 to 95. °C. TSTG. Storage Temperature. –65 to 125. °C. VCC. Supply Voltage. –0.3 to 6. V. VIO. Input or Output Voltages. –0.3 to 6. V. VPP. Program Supply. –0.3 to 26.5. V. PD. Power Dissipation. 1.5. W. TA. Note: Except for the rating "Operating Temperature Range", stresses above those listed in the Table "Absolute Maximum Ratings" may cause permanent damage to the device. These are stress ratings only and operation of the device at these or any other conditions above those indicated in the Operating sections of this specification is not implied. Exposure to Absolute Maximum Rating conditions for extended periods may affect device reliability. Refer also to the SGS-THOMSON SURE Program and other relevant quality documents.. Figure 2. DIP Pin Connections. A7 A6 A5 A4 A3 A2 A1 A0 Q0 Q1 Q2 VSS. 1 2 3 4 5 6 7 8 9 10 11 12. M2716. 24 23 22 21 20 19 18 17 16 15 14 13. VCC A8 A9 VPP G A10 EP Q7 Q6 Q5 Q4 Q3. AI00785. DEVICE OPERATION The M2716 has 3 modes of operation in the normal system environment. These are shown in Table 3. Read Mode. The M2716 read operation requires that G = VIL, EP = VIL and that addresses A0-A10 have been stabilized. Valid data will appear on the output pins after time tAVQV, tGLQV or tELQV (see Switching Time Waveforms) depending on which is limiting.. 2/9. Deselect Mode. The M2716 is deselected by making G = VIH. This mode is independent of EP and the condition of the addresses. The outputs are Hi-Z when G = VIH. This allows tied-OR of 2 or more M2716’s for memory expansion. Standby Mode (Power Down). The M2716 may be powered down to the standby mode by making EP = VIH. This is independent of G and automatically puts the outputs in the Hi-Z state. The power is reduced to 25% (132 mW max) of the normal operating power. VCC and VPP must be maintained at 5V. Access time at power up remains either tAVQV or tELQV (see Switching Time Waveforms). Programming The M2716 is shipped from SGS-THOMSON completely erased. All bits will be at “1" level (output high) in this initial state and after any full erasure. Table 3 shows the 3 programming modes. Program Mode. The M2716 is programmed by introducing “0"s into the desired locations. This is done 8 bits (a byte) at a time. Any individual address, sequential addresses, or addresses chosen at random may be programmed. Any or all of the 8 bits associated with an address location may be programmed with a single program pulse applied to the EP pin. All input voltage levels including the program pulse on chip enable are TTL compatible. The programming sequence is: with VPP = 25V, VCC = 5V, G = VIH and EP = VIL, an address is selected and the desired data word is applied to the output pins (VIL = “0" and VIH = ”1" for both address and data). After the address and data signals are stable the program pin is pulsed from VIL to VIH with a.

<span class='text_page_counter'>(375)</span> M2716 ERASURE OPERATION. DEVICE OPERATION (cont’d) pulse width between 45ms and 55ms. Multiple pulses are not needed but will not cause device damage. No pins should be left open. A high level (VIH or higher) must not be maintained longer than tPHPL (max) on the program pin during programming. M2716’s may be programmed in parallel in this mode. Program Verify Mode. The programming of the M2716 may be verified either one byte at a time during the programming (as shown in Figure 6) or by reading all of the bytes out at the end of the programming sequence. This can be done with VPP = 25V or 5V in either case. VPP must be at 5V for all operating modes and can be maintained at 25V for all programming modes. Program Inhibit Mode. The program inhibit mode allows several M2716’s to be programmed simultaneously with different data for each one by controlling which ones receive the program pulse. All similar inputs of the M2716 may be paralleled. Pulsing the program pin (from VIL to VIH) will program a unit while inhibiting the program pulse to a unit will keep it from being programmed and keeping G = VIH will put its outputs in the Hi-Z state.. The M2716 is erased by exposure to high intensity ultraviolet light through the transparent window. This exposure discharges the floating gate to its initial state through induced photo current. It is recommended that the M2716 be kept out of direct sunlight. The UV content of sunlight may cause a partial erasure of some bits in a relatively short period of time. An ultraviolet source of 2537 Å yielding a total integrated dosage of 15 watt-seconds/cm2 power rating is used. The M2716 to be erased should be placed 1 inch away from the lamp and no filters should be used. An erasure system should be calibrated periodically. The erasure time is increased by the square of the distance (if the distance is doubled the erasure time goes up by a factor of 4). Lamps lose intensity as they age, it is therefore important to periodically check that the UV system is in good order. This will ensure that the EPROMs are being completely erased. Incomplete erasure will cause symptoms that can be misleading. Programmers, components, and system designs have been erroneously suspected when incomplete erasure was the basic problem.. Table 3. Operating Modes Mode. EP. G. VPP. Q0 - Q7. VIL. VIL. VCC. Data Out. VIH Pulse. VIH. VPP. Data In. Verify. VIL. VIL. VPP or VCC. Data Out. Program Inhibit. VIL. VIH. VPP. Hi-Z. Deselect. X. VIH. VCC. Hi-Z. Standby. VIH. X. VCC. Hi-Z. Read Program. Note: X = VIH or VIL.. 3/9.

<span class='text_page_counter'>(376)</span> M2716. Figure 4. AC Testing Load Circuit. AC MEASUREMENT CONDITIONS Input Rise and Fall Times. ≤ 20ns. Input Pulse Voltages. 0.45V to 2.4V. Input and Output Timing Ref. Voltages. 0.8V to 2.0V. 1.3V. 1N914. Note that Output Hi-Z is defined as the point where data is no longer driven. 3.3kΩ. Figure 3. AC Testing Input Output Waveforms 2.4V. DEVICE UNDER TEST. OUT CL = 100pF. 2.0V 0.8V. 0.45V. CL includes JIG capacitance. AI00827. AI00828. Table 4. Capacitance (1) (TA = 25 °C, f = 1 MHz ) Symbol CIN COUT. Parameter Input Capacitance Output Capacitance. Test Condition. Min. Max. Unit. VIN = 0V. 6. pF. VOUT = 0V. 12. pF. Note: 1. Sampled only, not 100% tested.. Table 5. Read Mode DC Characteristics (1) (TA = 0 to 70 °C or –40 to 85 °C; VCC = 5V ± 5% or 5V ± 10%; VPP = VCC) Symbol. Parameter. Test Condition. Min. Max. Unit. 0 ≤ VIN ≤ VCC. ±10. µA. VOUT = VCC, EP = VCC. ±10. µA. ILI. Input Leakage Current. ILO. Output Leakage Current. ICC. Supply Current. EP = VIL, G = VIL. 100. mA. ICC1. Supply Current (Standby). EP = VIH, G = VIL. 25. mA. IPP. Program Current. VPP = VCC. 5. mA. VIL. Input Low Voltage. –0.1. 0.8. V. VIH. Input High Voltage. 2. VCC + 1. V. VOL. Output Low Voltage. IOL = 2.1mA. 0.45. V. VOH. Output High Voltage. IOH = –400µA. 2.4. Note: 1. VCC must be applied simultaneously with or before VPP and removed simultaneously or after VPP.. 4/9. V.

<span class='text_page_counter'>(377)</span> M2716 Table 6. Read Mode AC Characteristics (1) (TA = 0 to 70 °C or –40 to 85 °C; VCC = 5V ± 5% or 5V ± 10%; VPP = VCC) M2716 Symbol. Alt. Parameter. Test Condition. -1 Min. tAVQV. tACC. Address Valid to Output Valid. tELQV. tCE. tGLQV. Unit. blank Max. Min. Max. EP = VIL, G = VIL. 350. 450. ns. Chip Enable Low to Output Valid. G = VIL. 350. 450. ns. 120. 120. ns. tOE. Output Enable Low to Output Valid. EP = VIL. tEHQZ. (2). tOD. Chip Enable High to Output Hi-Z. G = VIL. 0. 100. 0. 100. ns. tGHQZ. (2). tDF. Output Enable High to Output Hi-Z. EP = VIL. 0. 100. 0. 100. ns. tOH. Address Transition to Output Transition. EP = VIL, G = VIL. 0. tAXQX. 0. ns. Notes: 1. VCC must be applied simultaneously with or before VPP and removed simultaneously or after VPP. 2. Sampled only, not 100% tested.. Figure 5. Read Mode AC Waveforms. VALID. A0-A10 tAVQV. tAXQX. EP tEHQZ. tGLQV G. tGHQZ. tELQV. Hi-Z. Q0-Q7. DATA OUT AI00786. Table 7. Programming Mode DC Characteristics (1) (TA = 25 °C; VCC = 5V ± 5%; VPP = 25V ± 1V) Symbol. Parameter. Test Condition. Min. VIL ≤ VIN ≤ VIH. Max. Unit. ±10. µA. 100. mA. 5. mA. 30. mA. ILI. Input Leakage Current. ICC. Supply Current. IPP. Program Current. IPP1. Program Current Pulse. VIL. Input Low Voltage. –0.1. 0.8. V. VIH. Input High Voltage. 2. VCC + 1. V. EP = VIH Pulse. Note: 1. VCC must be applied simultaneously with or before VPP and removed simultaneously or after VPP.. 5/9.

<span class='text_page_counter'>(378)</span> M2716 Table 8. Programming Mode AC Characteristics (1) (TA = 25 °C; VCC = 5V ± 5%; VPP = 25V ± 1V) Symbol. Alt. tAVPH. tAS. tQVPH. Parameter. Test Condition. Min. Address Valid to Program High. G = VIH. 2. µs. tDS. Input Valid to Program High. G = VIH. 2. µs. tGHPH. tOS. Output Enable High to Program High. 2. µs. tPL1PL2. tPR. Program Pulse Rise Time. 5. ns. tPH1PH2. tPF. Program Pulse Fall Time. 5. ns. tPHPL. tPW. Program Pulse Width. 45. tPLQX. tDH. Program Low to Input Transition. 2. µs. tPLGX. tOH. Program Low to Output Enable Transition. 2. µs. tGLQV. tOE. Output Enable to Output Valid. tGHQZ. tDF. Output Enable High to Output Hi-Z. 0. tPLAX. tAH. Program Low to Address Transition. 2. EP = VIL. Max. 55. ms. 120. ns. 100. ns µs. Notes: 1. VCC must be applied simultaneously with or before VPP and removed simultaneously or after VPP. 2. Sampled only, not 100% tested.. Figure 6. Programming and Verify Modes AC Waveforms. VALID. A0-A10 tAVPH. tPLAX DATA IN. Q0-Q7. DATA OUT. tQVPH. tPLQX tPLGX. G tGHPH. tGHQZ. tGLQV. EP tPHPL PROGRAM. VERIFY AI00787. 6/9. Units.

<span class='text_page_counter'>(379)</span> M2716 ORDERING INFORMATION SCHEME Example:. M2716. -1. Speed and VCC Tolerance -1 blank. 350 ns, 5V ±10% 450 ns, 5V ±5%. F. 1. Package F. FDIP24W. Temperature Range 1. 0 to 70 °C. 6. –40 to 85 °C. For a list of available options (Speed, VCC Tolerance, Package, etc...) refer to the current Memory Shortform catalogue. For further information on any aspect of this device, please contact SGS-THOMSON Sales Office nearest to you.. 7/9.

<span class='text_page_counter'>(380)</span> M2716. FDIP24W - 24 pin Ceramic Frit-seal DIP, with window mm. Symb Typ. inches. Min. Max. A. Typ. Min. 5.71. 0.225. A1. 0.50. 1.78. 0.020. 0.070. A2. 3.90. 5.08. 0.154. 0.200. B. 0.40. 0.55. 0.016. 0.022. B1. 1.17. 1.42. 0.046. 0.056. C. 0.22. 0.31. 0.009. 0.012. D. 32.30. 1.272. E. 15.40. 15.80. 0.606. 0.622. E1. 13.05. 13.36. 0.514. 0.526. e1. 2.54. –. –. 0.100. –. –. e3. 27.94. –. –. 1.100. –. –. eA. 16.17. 18.32. 0.637. 0.721. L. 3.18. 4.10. 0.125. 0.161. S. 1.52. 2.49. 0.060. 0.098. –. –. –. –. α. 4°. 15°. 4°. 15°. N. 24. ∅. 7.11. 0.280. 24. FDIP24W. A2 A1 B1. B. A L α. e1. eA. C. e3 D S N ∅. E1. E. 1 FDIPW-a. Drawing is not to scale. 8/9. Max.

<span class='text_page_counter'>(381)</span> M2716. Information furnished is believed to be accurate and reliable. However, SGS-THOMSON Microelectronics assumes no responsibility for the consequences of use of such information nor for any infringement of patents or other rights of third parties which may result from its use. No license is granted by implication or otherwise under any patent or patent rights of SGS-THOMSON Microelectronics. Specifications mentioned in this publication are subject to change without notice. This publication supersedes and replaces all information previously supplied. SGS-THOMSON Microelectronics products are not authorized for use as critical components in life support devices or systems without express written approval of SGS-THOMSON Microelectronics.. © 1994 SGS-THOMSON Microelectronics - All Rights Reserved. SGS-THOMSON Microelectronics GROUP OF COMPANIES Australia - Brazil - China - France - Germany - Hong Kong - Italy - Japan - Korea - Malaysia - Malta - Morocco - The Netherlands Singapore - Spain - Sweden - Switzerland - Taiwan - Thailand - United Kingdom - U.S.A.. 9/9.

<span class='text_page_counter'>(382)</span> 82C59A CMOS Priority Interrupt Controller. March 1997. Features. Description. • 12.5MHz, 8MHz and 5MHz Versions Available - 12.5MHz Operation . . . . . . . . . . . . . . . . . . . 82C59A-12 - 8MHz Operation . . . . . . . . . . . . . . . . . . . . . . . 82C59A - 5MHz Operation . . . . . . . . . . . . . . . . . . . . . . 82C59A-5. The Intersil 82C59A is a high performance CMOS Priority Interrupt Controller manufactured using an advanced 2µm CMOS process. The 82C59A is designed to relieve the system CPU from the task of polling in a multilevel priority system. The high speed and industry standard configuration of the 82C59A make it compatible with microprocessors such as 80C286, 80286, 80C86/88, 8086/88, 8080/85 and NSC800.. • High Speed, “No Wait-State” Operation with 12.5MHz 80C286 and 8MHz 80C86/88 • Pin Compatible with NMOS 8259A. The 82C59A can handle up to eight vectored priority interrupting sources and is cascadable to 64 without additional circuitry. Individual interrupting sources can be masked or prioritized to allow custom system configuration. Two modes of operation make the 82C59A compatible with both 8080/85 and 80C86/88/286 formats.. • 80C86/88/286 and 8080/85/86/88/286 Compatible • Eight-Level Priority Controller, Expandable to 64 Levels • Programmable Interrupt Modes • Individual Request Mask Capability. Static CMOS circuit design ensures low operating power. The Intersil advanced CMOS process results in performance equal to or greater than existing equivalent products at a fraction of the power.. • Fully Static Design • Fully TTL Compatible • Low Power Operation - ICCSB . . . . . . . . . . . . . . . . . . . . . . . . . 10µA Maximum - ICCOP . . . . . . . . . . . . . . . . . . . . . 1mA/MHz Maximum • Single 5V Power Supply • Operating Temperature Ranges - C82C59A . . . . . . . . . . . . . . . . . . . . . . . . .0oC to +70oC - I82C59A . . . . . . . . . . . . . . . . . . . . . . . . -40oC to +85oC - M82C59A . . . . . . . . . . . . . . . . . . . . . . -55oC to +125oC. Ordering Information PART NUMBER 5MHz CP82C59A-5. 8MHz CP82C59A. 12.5MHz. PACKAGE. CP82C59A-12. TEMPERATURE RANGE. 28 Ld PDIP. 0oC to +70oC -40oC to +85oC. 28 Ld PLCC. 0oC to +70oC. PKG. NO. E28.6. IP82C59A-5. IP82C59A. IP82C59A-12. CS82C59A-5. CS82C59A. CS82C59A-12. IS82C59A-5. IS82C59A. IS82C59A-12. CD82C59A-5. CD82C59A. CD82C59A-12. ID82C59A-5. ID82C59A. ID82C59A-12. -40oC to +85oC. F28.6. MD82C59A-5/B. MD82C59A/B. MD82C59A-12/B. -55oC to +125oC. F28.6. -55oC to +125oC. J28.A. 0oC to +70oC. M28.3. 5962-8501601YA. 5962-8501602YA. MR82C59A-5/B. MR82C59A/B. 5962-85016013A. 5962-85016023A. CM82C59A-5. CM82C59A. -40oC to +85oC CERDIP. -. 0oC to +70oC. SMD#. MR82C59A-12/B -. 28 Pad CLCC. 28 Ld SOIC. CAUTION: These devices are sensitive to electrostatic discharge; follow proper IC Handling Procedures. or 407-727-9207 | Copyright © Intersil Corporation 1999. 4-1. N28.45 F28.6. F28.6. SMD#. CM82C59A-12. E28.6 N28.45. J28.A. File Number. 2784.2.

<span class='text_page_counter'>(383)</span> 82C59A Pinouts. D7 4. 25 IR7. D6 5. 24 IR6. D5 6. INTA. 26 INTA. A0. RD 3. VCC. 27 A0. CS. 28 VCC. WR 2. WR. CS 1. D7. 82C59A (PLCC, CLCC) TOP VIEW RD. 82C59A (PDIP, CERDIP, SOIC) TOP VIEW. 4. 3. 2. 1. 28. 27. 26. D6 5. 25 IR7. D5 6. 24 IR6. 23 IR5. D4 7. 23 IR5. D4 7. 22 IR4. D3 8. 22 IR4. D3 8. 21 IR3. D2 9. 21 IR3. D2 9. 20 IR2. D1 10. 20 IR2. D1 10. 19 IR1. D0 11. 18 IR0. CAS 0 12. 17 INT. CAS 1 13. 16 SP/EN. GND 14. 15 CAS 2. D0 11. PIN. CAS 1. GND. CAS 2. 16. 17. 18 IR0. 15. INT. 14. SP/ EN. 13. CAS 0. 19 IR1 12. DESCRIPTION. D7 - D0. Data Bus (Bidirectional). RD. Read Input. WR. Write Input. A0. Command Select Address. CS. Chip Select. CAS 2 - CAS 0. Cascade Lines. SP/EN. Slave Program Input Enable. INT. Interrupt Output. INTA. Interrupt Acknowledge Input. IR0 - IR7. Interrupt Request Inputs. Functional Diagram INTA. DATA BUS BUFFER. D7-D0. RD WR A0. CONTROL LOGIC. READ/ WRITE LOGIC. IN SERVICE REG (ISR). CS. CAS 0 CAS 1 CAS 2 SP/EN. INT. CASCADE BUFFER COMPARATOR. PRIORITY RESOLVER. INTERRUPT MASK REG (IMR). INTERNAL BUS. FIGURE 1.. 4-2. INTERRUPT REQUEST REG (IRR). IR0 IR1 IR2 IR3 IR4 IR5 IR6 IR7.

<span class='text_page_counter'>(384)</span> 82C59A Pin Description SYMBOL. PIN NUMBER. TYPE. DESCRIPTION. VCC. 28. I. VCC: The +5V power supply pin. A 0.1µF capacitor between pins 28 and 14 is recommended for decoupling.. GND. 14. I. GROUND. CS. 1. I. CHIP SELECT: A low on this pin enables RD and WR communications between the CPU and the 82C59A. INTA functions are independent of CS.. WR. 2. I. WRITE: A low on this pin when CS is low enables the 82C59A to accept command words from the CPU.. RD. 3. I. READ: A low on this pin when CS is low enables the 82C59A to release status onto the data bus for the CPU.. D7 - D0. 4 - 11. I/O. BIDIRECTIONAL DATA BUS: Control, status, and interrupt-vector information is transferred via this bus.. CAS0 - CAS2. 12, 13, 15. I/O. CASCADE LINES: The CAS lines form a private 82C59A bus to control a multiple 82C59A structure. These pins are outputs for a master 82C59A and inputs for a slave 82C59A.. SP/EN. 16. I/O. SLAVE PROGRAM/ENABLE BUFFER: This is a dual function pin. When in the Buffered Mode it can be used as an output to control buffer transceivers (EN). When not in the Buffered Mode it is used as an input to designate a master (SP = 1) or slave (SP = 0).. INT. 17. O. INTERRUPT: This pin goes high whenever a valid interrupt request is asserted. It is used to interrupt the CPU, thus, it is connected to the CPU's interrupt pin.. IR0 - IR7. 18 - 25. I. INTERRUPT REQUESTS: Asynchronous inputs. An interrupt request is executed by raising an IR input (low to high), and holding it high until it is acknowledged (Edge Triggered Mode), or just by a high level on an IR input (Level Triggered Mode). Internal pull-up resistors are implemented on IR0 - 7.. INTA. 26. I. INTERRUPT ACKNOWLEDGE: This pin is used to enable 82C59A interrupt-vector data onto the data bus by a sequence of interrupt acknowledge pulses issued by the CPU.. A0. 27. I. ADDRESS LINE: This pin acts in conjunction with the CS, WR, and RD pins. It is used by the 82C59A to decipher various Command Words the CPU writes and status the CPU wishes to read. It is typically connected to the CPU A0 address line (A1 for 80C86/88/286).. Functional Description CPU - DRIVEN MULTIPLEXER. Interrupts in Microcomputer Systems Microcomputer system design requires that I/O devices such as keyboards, displays, sensors and other components receive servicing in an efficient manner so that large amounts of the total system tasks can be assumed by the microcomputer with little or no effect on throughput. The most common method of servicing such devices is the Polled approach. This is where the processor must test each device in sequence and in effect “ask” each one if it needs servicing. It is easy to see that a large portion of the main program is looping through this continuous polling cycle and that such a method would have a serious, detrimental effect on system throughput, thus, limiting the tasks that could be assumed by the microcomputer and reducing the cost effectiveness of using such devices.. CPU. RAM. I/O (1). ROM. I/O (2). I/O (N). FIGURE 2. POLLED METHOD. 4-3.

<span class='text_page_counter'>(385)</span> 82C59A A more desirable method would be one that would allow the microprocessor to be executing its main program and only stop to service peripheral devices when it is told to do so by the device itself. In effect, the method would provide an external asynchronous input that would inform the processor that it should complete whatever instruction that is currently being executed and fetch a new routine that will service the requesting device. Once this servicing is complete, however, the processor would resume exactly where it left off. This is the Interrupt-driven method. It is easy to see that system throughput would drastically increase, and thus, more tasks could be assumed by the microcomputer to further enhance its cost effectiveness. INT CPU. The Programmable Interrupt Controller (PlC) functions as an overall manager in an Interrupt-Driven system. It accepts requests from the peripheral equipment, determines which of the incoming requests is of the highest importance (priority), ascertains whether the incoming request has a higher priority value than the level currently being serviced, and issues an interrupt to the CPU based on this determination. Each peripheral device or structure usually has a special program or “routine” that is associated with its specific functional or operational requirements; this is referred to as a “service routine”. The PlC, after issuing an interrupt to the CPU, must somehow input information into the CPU that can “point” the Program Counter to the service routine associated with the requesting device. This “pointer” is an address in a vectoring table and will often be referred to, in this document, as vectoring data.. 82C59A Functional Description PIC. RAM. I/O (1). ROM. I/O (2). The 82C59A is a device specifically designed for use in real time, interrupt driven microcomputer systems. It manages eight levels of requests and has built-in features for expandability to other 82C59As (up to 64 levels). It is programmed by system software as an I/O peripheral. A selection of priority modes is available to the programmer so that the manner in which the requests are processed by the 82C59A can be configured to match system requirements. The priority modes can be changed or reconfigured dynamically at any time during main program operation. This means that the complete interrupt structure can be defined as required, based on the total system environment.. I/O (N). Interrupt Request Register (IRR) and In-Service Register (ISR). FIGURE 3. INTERRUPT METHOD. The interrupts at the IR input lines are handled by two registers in cascade, the Interrupt Request Register (lRR) and the InService Register (lSR). The IRR is used to indicate all the interrupt levels which are requesting service, and the ISR is used to store all the interrupt levels which are currently being serviced. INTA. DATA BUS BUFFER. D 7 - D0. RD WR A0. CONTROL LOGIC. READ/ WRITE LOGIC. IN SERVICE REG (ISR). CS. CAS 0 CAS 1 CAS 2 SP/EN. INT. CASCADE BUFFER COMPARATOR. PRIORITY RESOLVER. INTERRUPT MASK REG (IMR). INTERNAL BUS. FIGURE 4. 82C59A FUNCTIONAL DIAGRAM. 4-4. INTERRUPT REQUEST REG (IRR). IR0 IR1 IR2 IR3 IR4 IR5 IR6 IR7.

<span class='text_page_counter'>(386)</span> 82C59A Priority Resolver. The Cascade Buffer/Comparator. This logic block determines the priorities of the bits set in the lRR. The highest priority is selected and strobed into the corresponding bit of the lSR during the INTA sequence.. The lMR stores the bits which disable the interrupt lines to be masked. The IMR operates on the output of the IRR. Masking of a higher priority input will not affect the interrupt request lines of lower priority.. This function block stores and compares the IDs of all 82C59As used in the system. The associated three I/O pins (CAS0 - 2) are outputs when the 82C59A is used as a master and are inputs when the 82C59A is used as a slave. As a master, the 82C59A sends the ID of the interrupting slave device onto the CAS0 - 2 lines. The slave, thus selected will send its preprogrammed subroutine address onto the Data Bus during the next one or two consecutive INTA pulses. (See section “Cascading the 82C59A”.). Interrupt (INT). Interrupt Sequence. This output goes directly to the CPU interrupt input. The VOH level on this line is designed to be fully compatible with the 8080, 8085, 8086/88, 80C86/88, 80286, and 80C286 input levels.. The powerful features of the 82C59A in a microcomputer system are its programmability and the interrupt routine addressing capability. The latter allows direct or indirect jumping to the specified interrupt routine requested without any polling of the interrupting devices. The normal sequence of events during an interrupt depends on the type of CPU being used.. Interrupt Mask Register (IMR). Interrupt Acknowledge (INTA) INTA pulses will cause the 82C59A to release vectoring information onto the data bus. The format of this data depends on the system mode (µPM) of the 82C59A. Data Bus Buffer This 3-state, bidirectional 8-bit buffer is used to interface the 82C59A to the System Data Bus. Control words and status information are transferred through the Data Bus Buffer. Read/Write Control Logic The function of this block is to accept output commands from the CPU. It contains the Initialization Command Word (lCW) registers and Operation Command Word (OCW) registers which store the various control formats for device operation. This function block also allows the status of the 82C59A to be transferred onto the Data Bus.. These events occur in an 8080/8085 system: 1. One or more of the INTERRUPT REQUEST lines (IR0 - IR7) are raised high, setting the corresponding IRR bit(s). 2. The 82C59A evaluates those requests in the priority resolver and sends an interrupt (INT) to the CPU, if appropriate. 3. The CPU acknowledges the lNT and responds with an INTA pulse. 4. Upon receiving an lNTA from the CPU group, the highest priority lSR bit is set, and the corresponding lRR bit is reset. The 82C59A will also release a CALL instruction code (11001101) onto the 8-bit data bus through D0 - D7. 5. This CALL instruction will initiate two additional INTA pulses to be sent to 82C59A from the CPU group.. Chip Select (CS) A LOW on this input enables the 82C59A. No reading or writing of the device will occur unless the device is selected. Write (WR) A LOW on this input enables the CPU to write control words (lCWs and OCWs) to the 82C59A. Read (RD) A LOW on this input enables the 82C59A to send the status of the Interrupt Request Register (lRR), In-Service Register (lSR), the Interrupt Mask Register (lMR), or the interrupt level (in the poll mode) onto the Data Bus. A0 This input signal is used in conjunction with WR and RD signals to write commands into the various command registers, as well as to read the various status registers of the chip. This line can be tied directly to one of the system address lines.. 6. These two INTA pulses allow the 82C59A to release its preprogrammed subroutine address onto the data bus. The lower 8-bit address is released at the first INTA pulse and the higher 8-bit address is released at the second INTA pulse. 7. This completes the 3-byte CALL instruction released by the 82C59A. In the AEOI mode, the lSR bit is reset at the end of the third INTA pulse. Otherwise, the lSR bit remains set until an appropriate EOI command is issued at the end of the interrupt sequence. The events occurring in an 80C86/88/286 system are the same until step 4. 4. The 82C59A does not drive the data bus during the first INTA pulse. 5. The 80C86/88/286 CPU will initiate a second INTA pulse. During this INTA pulse, the appropriate ISR bit is set and the corresponding bit in the IRR is reset. The 82C59A outputs the 8-bit pointer onto the data bus to be read by the CPU.. 4-5.

<span class='text_page_counter'>(387)</span> 82C59A. ADDRESS BUS (16). CONTROL BUS I/OR. I/OW. INT. INTA. DATA BUS (8). CS. A0. CAS 0 CAS 1 CAS 2. CASCADE LINES. D 7 - D0. RD. WR. INT. INTA. IRQ 2. IRQ. IRQ. 1. 0. 82C59A IRQ 7. SP/EN. IRQ 6. IRQ. IRQ. IRQ. 5. 4. 3. INTERRUPT REQUESTS. SLAVE PROGRAM/ ENABLE BUFFER. FIGURE 5. 82C59A STANDARD SYSTEM BUS INTERFACE. 6. This completes the interrupt cycle. In the AEOI mode, the ISR bit is reset at the end of the second INTA pulse. Otherwise, the ISR bit remains set until an appropriate EOI command is issued at the end of the interrupt subroutine.. CONTENT OF SECOND INTERRUPT VECTOR BYTE IR. If no interrupt request is present at step 4 of either sequence (i.e., the request was too short in duration), the 82C59A will issue an interrupt level 7. If a slave is programmed on IR bit 7, the CAS lines remain inactive and vector addresses are output from the master 82C59A.. Interrupt Sequence Outputs 8080, 8085 Interrupt Response Mode This sequence is timed by three INTA pulses. During the first lNTA pulse, the CALL opcode is enabled onto the data bus.. D6. D5. D4. D3. D2. D1. D0. 7. A7. A6. A5. 1. 1. 1. 0. 0. 6. A7. A6. A5. 1. 1. 0. 0. 0. 5. A7. A6. A5. 1. 0. 1. 0. 0. 4. A7. A6. A5. 1. 0. 0. 0. 0. 3. A7. A6. A5. 0. 1. 1. 0. 0. 2. A7. A6. A5. 0. 1. 0. 0. 0. 1. A7. A6. A5. 0. 0. 1. 0. 0. 0. A7. A6. A5. 0. 0. 0. 0. 0. IR. Call Code. D6. D5. D4. D3. D2. D1. D0. 1. 1. 0. 0. 1. 1. 0. 1. During the second INTA pulse, the lower address of the appropriate service routine is enabled onto the data bus. When interval = 4 bits, A5 - A7 are programmed, while A0 - A4 are automatically inserted by the 82C59A. When interval = 8, only A6 and A7 are programmed, while A0 - A5 are automatically inserted.. INTERVAL = 8 D7. D6. DS. D4. D3. D2. D1. D0. 7. A7. A6. 1. 1. 1. 0. 0. 0. 6. A7. A6. 1. 1. 0. 0. 0. 0. 5. A7. A6. 1. 0. 1. 0. 0. 0. 4. A7. A6. 1. 0. 0. 0. 0. 0. 3. A7. A6. 0. 1. 1. 0. 0. 0. 2. A7. A6. 0. 1. 0. 0. 0. 0. 1. A7. A6. 0. 0. 1. 0. 0. 0. 0. A7. A6. 0. 0. 0. 0. 0. 0. First Interrupt Vector Byte Data: Hex CD D7. INTERVAL = 4 D7. During the third INTA pulse, the higher address of the appropriate service routine, which was programmed as byte 2 of the initialization sequence (A8 - A15), is enabled onto the bus.. 4-6.

<span class='text_page_counter'>(388)</span> 82C59A Initialization Command Words (lCWs). CONTENT OF THIRD INTERRUPT VECTOR BYTE D7. D6. D5. D4. D3. D2. D1. D0. A15. A14. A13. A12. A11. A10. A9. A8. General. 80C86, 8OC88, 80C286 Interrupt Response Mode 80C86/88/286 mode is similar to 8080/85 mode except that only two Interrupt Acknowledge cycles are issued by the processor and no CALL opcode is sent to the processor. The first interrupt acknowledge cycle is similar to that of 8080/85 systems in that the 82C59A uses it to internally freeze the state of the interrupts for priority resolution and, as a master, it issues the interrupt code on the cascade lines. On this first cycle, it does not issue any data to the processor and leaves its data bus buffers disabled. On the second interrupt acknowledge cycle in the 86/88/286 mode, the master (or slave if so programmed) will send a byte of data to the processor with the acknowledged interrupt code composed as follows (note the state of the ADI mode control is ignored and A5 - A11 are unused in the 86/88/286 mode).. Whenever a command is issued with A0 = 0 and D4 = 1, this is interpreted as Initialization Command Word 1 (lCW1). lCW1 starts the initialization sequence during which the following automatically occur: a. The edge sense circuit is reset, which means that following initialization, an interrupt request (IR) input must make a low-to-high transition to generate an interrupt. b. The Interrupt Mask Register is cleared. c. lR7 input is assigned priority 7. d. Special Mask Mode is cleared and Status Read is set to lRR. e. If lC4 = 0, then all functions selected in lCW4 are set to zero. (Non-Buffered mode (see note), no Auto-EOI, 8080/85 system). NOTE: Master/Slave in ICW4 is only used in the buffered mode.. CONTENT OF INTERRUPT VECTOR BYTE FOR 80C86/88/286 SYSTEM MODE D7. D6. D5. D4. D3. D2. D1. D0. lR7. T7. T6. T5. T4. T3. 1. 1. 1. lR6. T7. T6. T5. T4. T3. 1. 1. 0. IR5. T7. T6. T5. T4. T3. 1. 0. 1. IR4. T7. T6. T5. T4. T3. 1. 0. 0. IR3. T7. T6. T5. T4. T3. 0. 1. 1. IR2. T7. T6. T5. T4. T3. 0. 1. 0. IR1. T7. T6. T5. T4. T3. 0. 0. 1. IR0. T7. T6. T5. T4. T3. 0. 0. 0. ICW1. ICW2. NO (SNGL = 1). IN CASCADE MODE YES (SNGL = 0)). Programming the 82C59A. ICW3. The 82C59A accepts two types of command words generated by the CPU: NO (IC4 = 0). 1. Initialization Command Words (ICWs): Before normal operation can begin, each 82C59A in the system must be brought to a starting point - by a sequence of 2 to 4 bytes timed by WR pulses.. IS ICW4 NEEDED. YES (IC4 = 1). 2. Operation Command Words (OCWs): These are the command words which command the 82C59A to operate in various interrupt modes. Among these modes are:. ICW4. a. Fully nested mode.. READY TO ACCEPT INTERRUPT REQUESTS. b. Rotating priority mode. c. Special mask mode.. FIGURE 6. 82C59A INITIALIZATION SEQUENCE. d. Polled mode.. Initialization Command Words 1 and 2 (ICW1, lCW2). The OCWs can be written into the 82C59A anytime after initialization.. A5 - A15: Page starting address of service routines. In an 8080/85 system the 8 request levels will generate CALLS to 8 locations equally spaced in memory. These can be programmed to be spaced at intervals of 4 or 8 memory locations, thus, the 8 routines will occupy a page of 32 or 64 bytes, respectively.. 4-7.

<span class='text_page_counter'>(389)</span> 82C59A ICW1 A0. D7. D6. D5. D4. D3. D2. D1. D0. 0. A7. A6. A5. 1. LTIM. ADI. SNGL. IC4 1 = ICW4 needed 0 = No ICW4 needed 1 = Single 0 = Cascade Mode CALL address interval 1 = Interval of 4 0 = Interval of 8 1 = Level triggered mode 0 = Edge triggered mode A7 - A5 of Interrupt vector address (MCS-80/85 mode only). ICW2 A0 1. D7. D6 A14. A15 T7. D5. D4. A13 T6. A12 T5. D3. D2. A11. A10. T4. D1 A9. D0 A8. T3 A15 - A8 of interrupt vector address (MCS80/85 mode) T7 - T3 of interrupt vector address (8086/8088 mode). ICW3 (MASTER DEVICE) A0. D7. D6. D5. D4. D3. D2. D1. D0. 1. S7. S6. S5. S4. S3. S2. S1. S0 1 = IR input has a slave 0 = IR input does not have a slave. ICW3 (SLAVE DEVICE) A0. D7. D6. D5. D4. D3. D2. D1. D0. 1. 0. 0. 0. 0. 0. ID2. ID1. ID0 SLAVE ID (NOTE) 0. 1. 2. 3. 4. 5. 6. 7. 0. 1. 0. 1. 0. 1. 0. 1. 0. 0. 1. 1. 0. 0. 1. 1. 0. 0. 0. 0. 1. 1. 1. 1. ICW4 A0. D7. D6. D5. D4. D3. D2. D1. D0. 1. 0. 0. 0. SFNM. BUF. M/S. AEOI. µPM 1 = 8086/8088 mode 0 = MCS-80/85 mode 1 = Auto EOI 0 = Normal EOI. 0. X. - Non buffered mode. 1. 0. - Buffered mode slave. 1. 1. - Buffered mode master. 1 = Special fully nested moded 0 = Not special fully nested mode NOTE: Slave ID is equal to the corresponding master IR input. FIGURE 7. 82C59A INITIALIZATION COMMAND WORD FORMAT. 4-8.

<span class='text_page_counter'>(390)</span> 82C59A The address format is 2 bytes long (A0 - A15). When the routine interval is 4, A0 - A4 are automatically inserted by the 82C59A, while A5 - A15 are programmed externally. When the routine interval is 8, A0 - A5 are automatically inserted by the 82C59A while A6 - A15 are programmed externally.. AEOI: If AEOI = 1, the automatic end of interrupt mode is programmed.. The 8-byte interval will maintain compatibility with current software, while the 4-byte interval is best for a compact jump table.. Operation Command Words (OCWs). In an 80C86/88/286 system, A15 - A11 are inserted in the five most significant bits of the vectoring byte and the 82C59A sets the three least significant bits according to the interrupt level. A10 - A5 are ignored and ADI (Address interval) has no effect. LTlM:. µPM:. After the Initialization Command Words (lCWs) are programmed into the 82C59A, the device is ready to accept interrupt requests at its input lines. However, during the 82C59A operation, a selection of algorithms can command the 82C59A to operate in various modes through the Operation Command Words (OCWs). OPERATION COMMAND WORDS (OCWs). If LTlM = 1, then the 82C59A will operate in the level interrupt mode. Edge detect logic on the interrupt inputs will be disabled.. A0. ALL address interval. ADI = 1 then interval = 4; ADI = 0 then interval = 8.. 1. SNGL: Single. Means that this is the only 82C59A in the system. If SNGL = 1, no ICW3 will be issued.. 0. ADI:. IC4:. Microprocessor mode: µPM = 0 sets the 82C59A for 8080/85 system operation, µPM = 1 sets the 82C59A for 80C86/88/286 system operation.. D7. D6. D5. D4. D3. D2. D1. D0. M3. M2. M1. M0. 0. L2. L1. L0. 1. P. RR. RIS. OCW1 M7. M6. M5. M4 OCW2. R. SL. EOI. 0 OCW3. If this bit is set - lCW4 has to be issued. If lCW4 is not needed, set lC4 = 0.. 0. 0. ESMM SMM. 0. Initialization Command Word 3 (ICW3). Operation Command Word 1 (OCW1). This word is read only when there is more than one 82C59A in the system and cascading is used, in which case SNGL = 0. It will load the 8-bit slave register. The functions of this register are:. OCW1 sets and clears the mask bits in the Interrupt Mask Register (lMR) M7 - M0 represent the eight mask bits. M = 1 indicates the channel is masked (inhibited), M = 0 indicates the channel is enabled.. a. In the master mode (either when SP = 1, or in buffered mode when M/S = 1 in lCW4) a “1” is set for each slave in the bit corresponding to the appropriate IR line for the slave. The master then will release byte 1 of the call sequence (for 8080/85 system) and will enable the corresponding slave to release bytes 2 and 3 (for 80C86/88/ 286, only byte 2) through the cascade lines.. Operation Command Word 2 (OCW2). b. In the slave mode (either when SP = 0, or if BUF = 1 and M/S = 0 in lCW4), bits 2 - 0 identify the slave. The slave compares its cascade input with these bits and if they are equal, bytes 2 and 3 of the call sequence (or just byte 2 for 80C86/88/286) are released by it on the Data Bus. NOTE: (The slave address must correspond to the IR line it is connected to in the master ID).. Initialization Command Word 4 (ICW4) SFNM: If SFNM = 1, the special fully nested mode is programmed. BUF:. M/S:. If BUF = 1, the buffered mode is programmed. In buffered mode, SP/EN becomes an enable output and the master/slave determination is by M/S. If buffered mode is selected: M/S = 1 means the 82C59A is programmed to be a master, M/S = 0 means the 82C59A is programmed to be a slave. If BUF = 0, M/S has no function.. R, SL, EOI - These three bits control the Rotate and End of Interrupt modes and combinations of the two. A chart of these combinations can be found on the Operation Command Word Format. L2, L1, L0 - These bits determine the interrupt level acted upon when the SL bit is active. Operation Command Word 3 (OCW3) ESMM - Enable Special Mask Mode. When this bit is set to 1 it enables the SMM bit to set or reset the Special Mask Mode. When ESMM = 0, the SMM bit becomes a “don’t care”. SMM - Special Mask Mode. If ESMM = 1 and SMM = 1, the 82C59A will enter Special Mask Mode. If ESMM = 1 and SMM = 0, the 82C59A will revert to normal mask mode. When ESMM = 0, SMM has no effect. Fully Nested Mode This mode is entered after initialization unless another mode is programmed. The interrupt requests are ordered in priority from 0 through 7 (0 highest). When an interrupt is acknowledged the highest priority request is determined and its vector placed on the bus. Additionally, a bit of the Interrupt Service register (IS0 - 7) is set. This bit remains set until the microprocessor issues an End of Interrupt (EOI) command. 4-9.

<span class='text_page_counter'>(391)</span> 82C59A After the initialization sequence, IR0 has the highest priority and IR7 the lowest. Priorities can be changed, as will be explained in the rotating priority mode or via the set priority command.. immediately before returning from the service routine, or if the AEOI (Automatic End of Interrupt) bit is set, until the trailing edge of the last INTA. While the IS bit is set, all further interrupts of the same or lower priority are inhibited, while higher levels will generate an interrupt (which will be acknowledged only if the microprocessor internal interrupt enable flip-flop has been re-enabled through software). OCW1 A0. D7. D6. D5. D4. D3. D2. D1. D0. 1. M7. M6. M5. M4. M3. M2. M1. M0 Interrupt Mask 1 = Mask set 0 = Mask reset. OCW2 A0. D7. D6. D5. D4. D3. D2. D1. D0. 0. R. SL. EOI. 0. 0. L2. L1. L0. 0. 0. Non-specific EOI command. 1. IR LEVEL TO BE ACTED UPON 0. 1. 2. 3. 4. 5. 6. 7. 0. 1. 0. 1. 0. 1. 0. 1. 0. 0. 1. 1. 0. 0. 1. 1. 0. 0. 0. 0. 1. 1. 1. 1. End of interrupt. 0. 1. 1. 1. 0. 1. Rotate on non-specific EOI command. 1. 0. 0. Rotate in automatic EOI mode (set). 0. 0. 0. Rotate in automatic EOI mode (clear). 1. 1. 1. † Rotate on specific EOI command. 1. 1. 0. † Set priority command. 0. 1. 0. † Specific EOI command. Automatic rotation. Specific rotation. No operation. † L0 - L2 are used OCW3 A0. D7. D6. D5. D4. D3. D2. D1. D0. 0. 0. ESMM. SMM. 0. 1. P. RR. RIS READ REGISTER COMMAND 0. 1. 0. 1. 0. 0. 1. 1. Read IR reg on Read IS reg on No Action next RD pulse next RD pulse 1 = Poll command 0 = No poll command SPECIAL MASK MODE 0. 1. 0. 1. 0. 0. 1. 1. Reset special No Action mask FIGURE 8. 82C59A OPERATION COMMAND WORD FORMAT. 4-10. Set special mask.

<span class='text_page_counter'>(392)</span> 82C59A End of Interrupt (EOI) The In-Service (IS) bit can be reset either automatically following the trailing edge of the last in sequence INTA pulse (when AEOI bit in lCW1 is set) or by a command word that must be issued to the 82C59A before returning from a service routine (EOI Command). An EOI command must be issued twice if servicing a slave in the Cascade mode, once for the master and once for the corresponding slave. There are two forms of EOl command: Specific and NonSpecific. When the 82C59A is operated in modes which preserve the fully nested structure, it can determine which IS bit to reset on EOI. When a Non-Specific command is issued the 82C59A will automatically reset the highest IS bit of those that are set, since in the fully nested mode the highest IS level was necessarily the last level acknowledged and serviced. A non-specific EOI can be issued with OCW2 (EOl = 1, SL = 0, R = 0). When a mode is used which may disturb the fully nested structure, the 82C59A may no longer be able to determine the last level acknowledged. In this case a Specific End of Interrupt must be issued which includes as part of the command the IS level to be reset. A specific EOl can be issued with OCW2 (EOI = 1, SL = 1, R = 0, and L0 - L2 is the binary level of the IS bit to be reset). An lRR bit that is masked by an lMR bit will not be cleared by a non-specific EOI if the 82C59A is in the Special Mask Mode. Automatic End of Interrupt (AEOI) Mode If AEOI = 1 in lCW4, then the 82C59A will operate in AEOl mode continuously until reprogrammed by lCW4. In this mode the 82C59A will automatically perform a non-specific EOI operation at the trailing edge of the last interrupt acknowledge pulse (third pulse in 8080/85, second in 80C86/88/286). Note that from a system standpoint, this mode should be used only when a nested multilevel interrupt structure is not required within a single 82C59A. Automatic Rotation (Equal Priority Devices). IS5. IS4. IS3. IS2. IS1. IS0. “IS” Status. 0. 1. 0. 1. 0. 0. 0. 0. Priority Status. 7. 6. 5. 4. 3. 2. 1. 0. lowest. IS6. IS5. IS4. IS3. IS2. IS1. IS0. “IS” Status. 0. 1. 0. 0. 0. 0. 0. 0. Priority Status. 2. 1. 0. 7. 6. 5. 4. 3. highest. lowest. There are two ways to accomplish Automatic Rotation using OCW2, the Rotation on Non-Specific EOI Command (R = 1, SL = 0, EOI = 1) and the Rotate in Automatic EOI Mode which is set by (R = 1, SL = 0, EOI = 0) and cleared by (R = 0, SL = 0, EOl = 0). Specific Rotation (Specific Priority) The programmer can change priorities by programming the lowest priority and thus, fixing all other priorities; i.e., if IR5 is programmed as the lowest priority device, then IR6 will have the highest one. The Set Priority command is issued in OCW2 where: R = 1, SL = 1, L0 - L2 is the binary priority level code of the lowest priority device. Observe that in this mode internal status is updated by software control during OCW2. However, it is independent of the End of Interrupt (EOI) command (also executed by OCW2). Priority changes can be executed during an EOI command by using the Rotate on Specific EOl command in OCW2 (R = 1, SL = 1, EOI = 1, and L0 - L2 = IR level to receive lowest priority). Interrupt Masks Each Interrupt Request input can be masked individually by the Interrupt Mask Register (IMR) programmed through OCW1. Each bit in the lMR masks one interrupt channel if it is set (1). Bit 0 masks IR0, Bit 1 masks IR1 and so forth. Masking an IR channel does not affect the operation of other channels.. Some applications may require an interrupt service routine to dynamically alter the system priority structure during its execution under software control. For example, the routine may wish to inhibit lower priority requests for a portion of its execution but enable some of them for another portion. The difficulty here is that if an Interrupt Request is acknowledged and an End of Interrupt command did not reset its IS bit (i.e., while executing a service routine), the 82C59A would have inhibited all lower priority requests with no easy way for the routine to enable them.. Before Rotate (lR4 the highest priority requiring service). IS6. IS7. Special Mask Mode. In some applications there are a number of interrupting devices of equal priority. In this mode a device, after being serviced, receives the lowest priority, so a device requesting an interrupt will have to wait, in the worst case until each of 7 other devices are serviced at most once. For example, if the priority and “in service” status is:. IS7. After Rotate (lR4 was serviced, all other priorities rotated correspondingly). highest. That is where the Special Mask Mode comes in. In the Special Mask Mode, when a mask bit is set in OCW1, it inhibits further interrupts at that level and enables interrupts from all other levels (lower as well as higher) that are not masked. Thus, any interrupts may be selectively enabled by loading the mask register.. 4-11.

<span class='text_page_counter'>(393)</span> 82C59A The Special Mask Mode is set by OCW3 where: ESMM = 1, SMM = 1, and cleared where ESMM = 1, SMM = 0.. The word enabled onto the data bus during RD is:. Poll Command In this mode, the INT output is not used or the microprocessor internal Interrupt Enable flip flop is reset, disabling its interrupt input. Service to devices is achieved by software using a Poll command. The Poll command is issued by setting P = 1 in OCW3. The 82C59A treats the next RD pulse to the 82C59A (i.e., RD = 0, CS = 0) as an interrupt acknowledge, sets the appropriate IS bit if there is a request, and reads the priority level. Interrupt is frozen from WR to RD. LTIM BIT 0 = EDGE 1 = LEVEL. D7. D6. D5. D4. D3. D2. D1. D0. I. -. -. -. -. W2. W1. W0. W0 - W2: Binary code of the highest priority level requesting service. I:. This mode is useful if there is a routine command common to several levels so that the INTA sequence is not needed (saves ROM space). Another application is to use the poll mode to expand the number of priority levels to more than 64.. TO OTHER PRIORITY CELLS CLR ISR. EDGE SENSE LATCH. CLR Q. SET ISR REQUEST LATCH D Q. IR. D Q. INTA. CONTROL LOGIC NONMASKED REQ. MASK LATCH. C Q. 80C86/ 88/286 MODE. PRIORITY RESOLVER. IN - SERVICE LATCH. SET. 8080/85 MODE. ISR BIT. SET. CLR Q. VCC. Equal to a “1” if there is an interrupt.. C CLR. FREEZE READ IMR READ ISR MASTER CLEAR. INTA FREEZE FREEZE. READ WRITE IRR MASK. NOTES: 1. Master clear active only during ICW1. 2. FREEZE is active during INTA and poll sequence only. 3. Truth Table for D-latch. C. D. Q. Operation. 1. D1. D1. Follow. 0. X. Qn-1. Hold FIGURE 9. PRIORITY CELL - SIMPLIFIED LOGIC DIAGRAM. Reading the 82C59A Status The input status of several internal registers can be read to update the user information on the system. The following registers can be read via OCW3 (lRR and ISR) or OCW1 (lMR). Interrupt Request Register (IRR): 8-bit register which contains the levels requesting an interrupt to be acknowledged. The highest request level is reset from the lRR when an interrupt is acknowledged. lRR is not affected by lMR. In-Service Register (ISR): 8-bit register which contains the priority levels that are being serviced. The ISR is updated when an End of Interrupt Command is issued.. Interrupt Mask Register: 8-bit register which contains the interrupt request lines which are masked. The lRR can be read when, prior to the RD pulse, a Read Register Command is issued with OCW3 (RR = 1, RIS = 0). The ISR can be read when, prior to the RD pulse, a Read Register Command is issued with OCW3 (RR = 1, RIS = 1). There is no need to write an OCW3 before every status read operation, as long as the status read corresponds with the previous one: i.e., the 82C59A “remembers” whether the lRR or ISR has been previously selected by the OCW3. This is not true when poll is used. In the poll mode, the 82C59A. 4-12.

<span class='text_page_counter'>(394)</span> 82C59A treats the RD following a “poll write” operation as an INTA. After initialization, the 82C59A is set to lRR. For reading the lMR, no OCW3 is needed. The output data bus will contain the lMR whenever RD is active and A0 = 1 (OCW1). Polling overrides status read when P = 1, RR = 1 in OCW3. Edge and Level Triggered Modes This mode is programmed using bit 3 in lCW1. If LTlM = “0”, an interrupt request will be recognized by a low to high transition on an IR input. The IR input can remain high without generating another interrupt. If LTIM = “1”, an interrupt request will be recognized by a “high” level on an IR input, and there is no need for an edge detection. The interrupt request must be removed before the EOI command is issued or the CPU interrupt is enabled to prevent a second interrupt from occurring. The priority cell diagram shows a conceptual circuit of the level sensitive and edge sensitive input circuitry of the 82C59A. Be sure to note that the request latch is a transparent D type latch.. In both the edge and level triggered modes the IR inputs must remain high until after the falling edge of the first INTA. If the IR input goes low before this time a DEFAULT lR7 will occur when the CPU acknowledges the interrupt. This can be a useful safeguard for detecting interrupts caused by spurious noise glitches on the IR inputs. To implement this feature the lR7 routine is used for “clean up” simply executing a return instruction, thus, ignoring the interrupt. If lR7 is needed for other purposes a default lR7 can still be detected by reading the ISR. A normal lR7 interrupt will set the corresponding ISR bit, a default IR7 won’t. If a default IR7 routine occurs during a normal lR7 routine, however, the ISR will remain set. In this case it is necessary to keep track of whether or not the IR7 routine was previously entered. If another lR7 occurs it is a default. In power sensitive applications, it is advisable to place the 82C59A in the edge-triggered mode with the IR lines normally high. This will minimize the current through the internal pull-up resistors on the IR pins.. 80C86/88/286 8080/85 IR. INT. 80C86/88/286. INTA LATCH ARM (NOTE 1). 8080/85. LATCH ARM (NOTE 1) EARLIEST IR CAN BE REMOVED. LATCH ARM (NOTE 1). NOTE: 1. Edge triggered mode only. FIGURE 10. IR TRIGGERING TIMING REQUIREMENTS. The Special Fully Nested Mode one from that slave. This is done by sending a non-specific End of Interrupt (EOI) command to the slave and then reading its In-Service register and checking for zero. If it is empty, a non-specified EOI can be sent to the master, too. If not, no EOI should be sent.. This mode will be used in the case of a big system where cascading is used, and the priority has to be conserved within each slave. In this case the special fully nested mode will be programmed to the master (using lCW4). This mode is similar to the normal nested mode with the following exceptions: a. When an interrupt request from a certain slave is in service, this slave is not locked out from the master’s priority logic and further interrupt requests from higher priority IRs within the slave will be recognized by the master and will initiate interrupts to the processor. (In the normal nested mode a slave is masked out when its request is in service and no higher requests from the same slave can be serviced.. Buffered Mode When the 82C59A is used in a large system where bus driving buffers are required on the data bus and the cascading mode is used, there exists the problem of enabling buffers The buffered mode will structure the 82C59A to send an enable signal on SP/EN to enable the buffers. In this mode, whenever the 82C59A’s data bus outputs are enabled, the SP/EN output becomes active.. b. When exiting the Interrupt Service routine the software has to check whether the interrupt serviced was the only. 4-13.

<span class='text_page_counter'>(395)</span> 82C59A release the device routine address during bytes 2 and 3 of INTA. (Byte 2 only for 80C86/88/286).. This modification forces the use of software programming to determine whether the 82C59A is a master or a slave. Bit 3 in ICW4 programs the buffered mode, and bit 2 in lCW4 determines whether it is a master or a slave.. The cascade bus lines are normally low and will contain the slave address code from the leading edge of the first INTA pulse to the trailing edge of the last INTA pulse. Each 82C59A in the system must follow a separate initialization sequence and can be programmed to work in a different mode. An EOI command must be issued twice: once for the master and once for the corresponding slave. Chip select decoding is required to activate each 82C59A.. Cascade Mode The 82C59A can be easily interconnected in a system of one master with up to eight slaves to handle up to 64 priority levels. The master controls the slaves through the 3 line cascade bus (CAS2 - 0). The cascade bus acts like chip selects to the slaves during the INTA sequence.. NOTE: Auto EOI is supported in the slave mode for the 82C59A.. The cascade lines of the Master 82C59A are activated only for slave inputs, non-slave inputs leave the cascade line inactive (low). Therefore, it is necessary to use a slave address of 0 (zero) only after all other addresses are used.. In a cascade configuration, the slave interrupt outputs (INT) are connected to the master interrupt request inputs. When a slave request line is activated and afterwards acknowledged, the master will enable the corresponding slave to. ADDRESS BUS (16) CONTROL BUS INT REQ DATA BUS (8). CS. A0 D7 - D0 INTA. SP/EN 7. 6. 5. 4. 3. INT CAS 0 CAS 1 CAS 2 2 1 0. 7. 6. 5. 4. 3. 2. SLAVE A. 82C59A. GND. 1. 0. CS. A0 D7 - D0 INTA. SP/EN 7. 6. 5. 4. 3. INT CAS 0 CAS 1 CAS 2 2 1 0. 7. 6. 5. 4. 3. 2. 82C59A. GND. SLAVE B. 1. 0. INTERRUPT REQUESTS. FIGURE 11. CASCADING THE 82C59A. 4-14. CS A0 D7 - D0 INTA CAS 0 CAS 1 MASTER 82C59A CAS 2 SP/EN 7 6 5 4 3 2. VCC. 7. 6. 5. 4. 3. 2. INT. 1. 0. 1. 0.

<span class='text_page_counter'>(396)</span> 82C59A Absolute Maximum Ratings. Thermal Information. Supply Voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . +8.0V Input, Output or I/O Voltage . . . . . . . . . . . . GND-0.5V to VCC+0.5V ESD Classification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Class I. Thermal Resistance (Typical) θJA (oC/W) θJC (oC/W) CERDIP Package . . . . . . . . . . . . . . . . 55 12 CLCC Package . . . . . . . . . . . . . . . . . . 65 14 PDIP Package . . . . . . . . . . . . . . . . . . . 55 N/A PLCC Package . . . . . . . . . . . . . . . . . . 65 N/A SOIC Package . . . . . . . . . . . . . . . . . . . 75 N/A Storage Temperature Range . . . . . . . . . . . . . . . . . .-65oC to +150oC Maximum Junction Temperature Ceramic Package . . . . . . . +175oC Maximum Junction Temperature Plastic Package. . . . . . . . . +150oC Maximum Lead Temperature Package (Soldering 10s) . . . . +300oC (PLCC and SOIC - Lead Tips Only). Operating Conditions Operating Voltage Range . . . . . . . . . . . . . . . . . . . . . +4.5V to +5.5V Operating Temperature Range . . . . . . . . . . . . . . . . -55oC to +125oC Input Low Voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 0V to +0.8V. Die Characteristics Gate Count . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1250 Gates CAUTION: Stresses above those listed in “Absolute Maximum Ratings” may cause permanent damage to the device. This is a stress only rating and operation of the device at these or any other conditions above those indicated in the operational sections of this specification is not implied.. DC Electrical Specifications SYMBOL. VCC = +5.0V ±10%, TA = 0oC to +70oC (C82C59A), TA = -40oC to +85oC (I82C59A), TA = -55oC to +125oC (M82C59A). PARAMETER. MIN. MAX. UNITS. TEST CONDITIONS. VlH. Logical One Input Voltage. 2.0 2.2. -. V V. VIL. Logical Zero Input Voltage. -. 0.8. V. VOH. Output HIGH Voltage. 3.0 VCC -0.4. -. V V. IOH = -2.5mA lOH = -100µA. VOL. Output LOW Voltage. -. 0.4. V. lOL = +2.5mA. Input Leakage Current. -1.0. +1.0. µA. VIN = GND or VCC, Pins 1-3, 26-27. Output Leakage Current. -10.0. +10.0. µA. VOUT = GND or VCC, Pins 4-13, 15-16. IR Input Load Current. -. -200 10. µA µA. VIN = 0V VIN = VCC. lCCSB. Standby Power Supply Current. -. 10. µA. VCC = 5.5V, VIN = VCC or GND Outputs Open, (Note 1). ICCOP. Operating Power Supply Current. -. 1. mA/MHz. II IO ILIR. C82C59A, I82C59A M82C59A. VCC = 5.0V, VIN = VCC or GND, Outputs Open, TA = 25oC, (Note 2). NOTES: 1. Except for IR0 - lR7 where VIN = VCC or open. 2. ICCOP = 1mA/MHz of peripheral read/write cycle time. (ex: 1.0µs I/O read/write cycle time = 1mA).. Capacitance TA = +25oC SYMBOL CIN COUT CI/O. PARAMETER. TYP. UNITS. Input Capacitance. 15. pF. Output Capacitance. 15. pF. I/O Capacitance. 15. pF. 4-15. TEST CONDITIONS FREQ = 1MHz, all measurements reference to device GND..

<span class='text_page_counter'>(397)</span> 82C59A AC Electrical Specifications. VCC = +5.0V ±10%, GND = 0V, TA = 0oC to +70oC (C82C59A), TA -40oC to +85oC (l82C59A), TA = -55oC to +125oC (M82C59A) 82C59A-5. SYMBOL. PARAMETER. 82C59A. 82C59A-12. MIN. MAX. MIN. MAX. MIN. MAX. UNITS. TEST CONDITIONS. TIMING REQUIREMENTS (1) TAHRL. A0/CS Setup to RD/INTA. 10. -. 10. -. 5. -. ns. (2) TRHAX. A0/CS Hold after RD/INTA. 5. -. 5. -. 0. -. ns. (3) TRLRH. RD/lNTA Pulse Width. 235. -. 160. -. 60. -. ns. (4) TAHWL. A0/CS Setup to WR. 0. -. 0. -. 0. -. ns. (5) TWHAX. A0/CS Hold after WR. 5. -. 5. -. 0. -. ns. (6) TWLWH. WR Pulse Width. 165. -. 95. -. 60. -. ns. (7) TDVWH. Data Setup to WR. 240. -. 160. -. 70. -. ns. (8) TWHDX. Data Hold after WR. 5. -. 5. -. 0. -. ns. Interrupt Request Width Low. 100. -. 100. -. 40. -. ns. (10) TCVlAL. Cascade Setup to Second or Third INTA (Slave Only). 55. -. 40. -. 30. -. ns. (11) TRHRL. End of RD to next RD, End of INTA (within an INTA sequence only). 160. -. 160. -. 90. -. ns. (12) TWHWL. End of WR to next WR. 190. -. 190. -. 60. -. ns. (13) TCHCL (Note 1). End of Command to next command (not same command type), End of INTA sequence to next INTA sequence. 500. -. 400. -. 90. -. ns. (9) TJLJH. TIMING RESPONSES (14) TRLDV. Data Valid from RD/INTA. -. 160. -. 120. -. 40. ns. 1. (15) TRHDZ. Data Float after RD/INTA. 5. 100. 5. 85. 5. 22. ns. 2. Interrupt Output Delay. -. 350. -. 300. -. 90. ns. 1. (17) TlALCV. Cascade Valid from First INTA (Master Only). -. 565. -. 360. -. 50. ns. 1. (18) TRLEL. Enable Active from RD or INTA. -. 125. -. 100. -. 40. ns. 1. (19) TRHEH. Enable Inactive from RD or INTA. -. 60. -. 50. -. 22. ns. 1. (20) TAHDV. Data Valid from Stable Address. -. 210. -. 200. -. 60. ns. 1. (21) TCVDV. Cascade Valid to Valid Data. -. 300. -. 200. -. 70. ns. 1. (16) TJHlH. NOTE: 1. Worst case timing for TCHCL in an actual microprocessor system is typically greater than the values specified for the 82C59A, (i.e. 8085A = 1.6µs, 8085A -2 = 1µs, 80C86 = 1µs, 80C286 -10 = 131ns, 80C286 -12 = 98ns).. 4-16.

<span class='text_page_counter'>(398)</span> 82C59A AC Test Circuit V1 R1 OUTPUT FROM DEVICE UNDER TEST. TEST POINT C1 (NOTE). R2. NOTE: Includes stray and jig capacitance. TEST CONDITION DEFINITION TABLE TEST CONDITION. V1. R1. R2. C1. 1. 1.7V. 523Ω. Open. 100pF. 2. VCC. 1.8kΩ. 1.8kΩ. 50pF. AC Testing Input, Output Waveform INPUT VIH +0.4V. OUTPUT VOH 1.5V. 1.5V VIL - 0.4V. VOL. NOTE: AC Testing: All input signals must switch between VIL - 0.4V and VIH + 0.4V. Input rise and fall times are driven at 1ns/V.. Timing Waveforms (6) TWLWH. WR. (5) TWHAX. (4) TAHWL CS ADDRESS BUS A0 (7) TDVWH DATA BUS. FIGURE 12. WRITE. 4-17. (8) TWHDX.

<span class='text_page_counter'>(399)</span> 82C59A Timing Waveforms. (Continued) (3) TRLRH. RD/INTA. (18) TRLEL. (19) TRHEH. EN (2) TRHAX. (1) TAHRL CS ADDRESS BUS A0. (14) TRLDV. (15) TRHDZ. DATA BUS (20) TAHDV. FIGURE 13. READ/INTA RD INTA. (11) TRHRL. WR (12) TWHWL. RD INTA WR. (13) TCHCL. RD INTA WR. FIGURE 14. OTHER TIMING. (16) TJHIH. IR. SEE NOTE 3. (9) TJLJH. SEE NOTE 4. INT INTA SEE NOTE 1. DB. SEE NOTE 2 TCVIAL. (10). CAS 0 - 2 (17) TIALCV. (21) TCVDV. NOTES: 1. Interrupt Request (IR) must remain HIGH until leading edge of first INTA. 2. During first INTA the Data Bus is not active in 80C86/88/286 mode. 3. 80C86/88/286 mode. 4. 8080/8085 mode. FIGURE 15. INTA SEQUENCE. 4-18. (10). TCVIAL.

<span class='text_page_counter'>(400)</span> 82C59A Burn-In Circuits MD82C59A CERDIP. R1. GND. R1. WR. R1. RD. D5. 7. R1. D3 D2. R1. D1. R1. D0. R3. CAS 0. R3. CAS 1. 9. VCC. IR6 IR5 IR4. R3. IR3 IR2. 11. 19 R2 18 R2. 12. 17. A. 13. 16 R3 15 R3. CAS 2. 10. 14. GND. IR7. 21 R2 20 R2. 8. R1. C1. INTA. 23 R2 22 R2. 6. R1. VCC A0. 25 R2 24 R2. 5. R1. D4. 27 R1 26 R1. 4. R1. D6. 28. 2 3. R1. D7. 1. A R3. IR1 IR0. SP/EN. MR82C59A CLCC. VCC D7. RD WR GND R1. 4. R1 D6. R1. 3. R1. 2. C1. A0 INTA. R1. 1. R1. 28. 27. R1. 26 25. 5 R1. D0. R1 R1. 22. 8. 21. 9 10. 20. 11. 19 12. 13. 15. R1. CAS1. CAS0. R1. 14. 16 R1. NOTES: 1. VCC = 5.5V ±0.5V. 2. VIH = 4.5V ±10%.. 7. R3 = 10kΩ ±5%.. 3. VIL = -0.2V to 0.4V.. 9. C1 = 0.01µF min.. 8. R4 = 1.2kΩ ±5%.. 4. GND = 0V.. 10. F0 = 100kHz ±10%.. 5. R1 = 47kΩ ±5%.. 11. F1 = F0/2, F2 = F1/2, ...F8 = F7/2.. 6. R2 = 510Ω ±5%.. 4-19. 17 R1. 18 R4. IR0. D1. R1. VCC/2. D3. 23. 7. SP/EN. R1. CAS2. D4. GND. R1. D2. 24. 6. D5. R2. R2 IR7 R2 IR6 R2 IR5 R2 IR4 R2 R2 R2. IR3 IR2 IR1.

<span class='text_page_counter'>(401)</span> 82C59A Die Characteristics DIE DIMENSIONS: 143 x 130 x 19 ±1mils (3630 x 3310 x 525µm) METALLIZATION: Type: Si-Al-Cu Thickness: Metal 1: 8kÅ ± 0.75kÅ Metal 2: 12kÅ ± 1.0kÅ GLASSIVATION: Type: Nitrox Thickness: 10kÅ ± 3.0kÅ. Metallization Mask Layout 82C59A D0. D1. D2. D3. D4. D5. D6. CAS0. D7. CAS1. RD. GND. WR. CS. CAS2. VCC. SP/EN. INT. A0. IR0. INTA. IR1. IR2. IR3. IR4. IR5. IR6. IR7. All Intersil semiconductor products are manufactured, assembled and tested under ISO9000 quality systems certification. Intersil products are sold by description only. Intersil Corporation reserves the right to make changes in circuit design and/or specifications at any time without notice. Accordingly, the reader is cautioned to verify that data sheets are current before placing orders. Information furnished by Intersil is believed to be accurate and reliable. However, no responsibility is assumed by Intersil or its subsidiaries for its use; nor for any infringements of patents or other rights of third parties which may result from its use. No license is granted by implication or otherwise under any patent or patent rights of Intersil or its subsidiaries. For information regarding Intersil Corporation and its products, see web site . 4-20.

<span class='text_page_counter'>(402)</span> 82C55A CMOS Programmable Peripheral Interface. June 1998. Features. Description. • Pin Compatible with NMOS 8255A. The Intersil 82C55A is a high performance CMOS version of the industry standard 8255A and is manufactured using a self-aligned silicon gate CMOS process (Scaled SAJI IV). It is a general purpose programmable I/O device which may be used with many different microprocessors. There are 24 I/O pins which may be individually programmed in 2 groups of 12 and used in 3 major modes of operation. The high performance and industry standard configuration of the 82C55A make it compatible with the 80C86, 80C88 and other microprocessors.. • 24 Programmable I/O Pins • Fully TTL Compatible • High Speed, No “Wait State” Operation with 5MHz and 8MHz 80C86 and 80C88 • Direct Bit Set/Reset Capability • Enhanced Control Word Read Capability • L7 Process. Static CMOS circuit design insures low operating power. TTL compatibility over the full military temperature range and bus hold circuitry eliminate the need for pull-up resistors. The Intersil advanced SAJI process results in performance equal to or greater than existing functionally equivalent products at a fraction of the power.. • 2.5mA Drive Capability on All I/O Ports • Low Standby Power (ICCSB) . . . . . . . . . . . . . . . . .10µA. Ordering Information PART NUMBERS 5MHz 8MHz CP82C55A-5. CP82C55A. IP82C55A-5. IP82C55A. CS82C55A-5. CS82C55A. IS82C55A-5. IS82C55A. CD82C55A-5. CD82C55A. ID82C55A-5. ID82C55A. PACKAGE 40 Ld PDIP 44 Ld PLCC. MD82C55A-5/B MD82C55A/B 8406601QA. 8406602QA. 40 Ld CERDIP. 8406602XA. PKG. NO.. 0oC to 70oC. E40.6. -40oC to 85oC. E40.6. 0oC to 70oC. N44.65. -40oC to 85oC. N44.65. 0oC to 70oC. F40.6. -40oC to 85oC. F40.6. -55oC to 125oC. F40.6. SMD#. 44 Pad MR82C55A-5/B MR82C55A/B CLCC 8406601XA. TEMPERATURE RANGE. F40.6 -55oC to 125oC. J44.A. SMD#. J44.A. Pinouts RD PA0 PA1 PA2 PA3 NC PA4 PA5 PA6 PA7 WR 34 D3 33 D4 32 D5 31 D6 30 D7 29 NC. CAUTION: These devices are sensitive to electrostatic discharge; follow proper IC Handling Procedures. or 407-727-9207 | Copyright © Intersil Corporation 1999. 1. 7 8 9 10 11 12 13 14 15 16 17. 39 38 37 36 35 34 33 32 31 30 29. RESET D0 D1 D2 D3 NC D4 D5 D6 D7 VCC. 18 1920 21 22 23 24 25 26 27 28 PB2 NC PB3 PB4 PB5 PB6 PB7. 37 D0 36 D1 35 D2. 6 5 4 3 2 1 44 43 42 41 40 CS GND A1 A0 PC7 NC PC6 PC5 PC4 PC0 PC1. PC2 PC3 PB0 PB1. PA7. PA6. PA5. PA4. PA3. PA2. PA1. PA0. CS. WR. 39 NC 38 RESET. NC. VCC. PB7. PB6. PB5. PB4. PB3. PB2. 13 14 15 16 17 18 19 20. 31 30 29 28 27 26 25 24 23 22 21. 82C55A (PLCC) TOP VIEW. PA4 6 5 4 3 2 1 44 43 42 41 40 PA5 PA6 7 GND PA7 NC 8 WR A1 9 RESET A0 10 D0 PC7 11 D1 PC6 12 D2 PC5 13 D3 PC4 14 D4 PC0 15 D5 PC1 16 D6 PC2 17 D7 18 19 20 21 22 23 24 25 26 27 28 VCC PB7 PB6 PB5 PB4 PB3 PB1. 5 6 7 8 9 10 11 12. 40 39 38 37 36 35 34 33 32. PB0. 1 2 3 4. PC3. PA3 PA2 PA1 PA0 RD CS GND A1 A0 PC7 PC6 PC5 PC4 PC0 PC1 PC2 PC3 PB0 PB1 PB2. 82C55A (CLCC) TOP VIEW RD. 82C55A (DIP) TOP VIEW. File Number. 2969.2.

<span class='text_page_counter'>(403)</span> 82C55A Pin Description SYMBOL. PIN NUMBER. VCC. 26. VCC: The +5V power supply pin. A 0.1µF capacitor between pins 26 and 7 is recommended for decoupling.. GND. 7. GROUND. D0-D7. 27-34. I/O. RESET. 35. I. RESET: A high on this input clears the control register and all ports (A, B, C) are set to the input mode with the “Bus Hold” circuitry turned on.. CS. 6. I. CHIP SELECT: Chip select is an active low input used to enable the 82C55A onto the Data Bus for CPU communications.. RD. 5. I. READ: Read is an active low input control signal used by the CPU to read status information or data via the data bus.. WR. 36. I. WRITE: Write is an active low input control signal used by the CPU to load control words and data into the 82C55A.. A0-A1. 8, 9. I. ADDRESS: These input signals, in conjunction with the RD and WR inputs, control the selection of one of the three ports or the control word register. A0 and A1 are normally connected to the least significant bits of the Address Bus A0, A1.. PA0-PA7. 1-4, 37-40. I/O. PORT A: 8-bit input and output port. Both bus hold high and bus hold low circuitry are present on this port.. PB0-PB7. 18-25. I/O. PORT B: 8-bit input and output port. Bus hold high circuitry is present on this port.. PC0-PC7. 10-17. I/O. PORT C: 8-bit input and output port. Bus hold circuitry is present on this port.. TYPE. DESCRIPTION. DATA BUS: The Data Bus lines are bidirectional three-state pins connected to the system data bus.. Functional Diagram. POWER SUPPLIES. +5V GND. GROUP A PORT A (8). GROUP A CONTROL. GROUP A PORT C UPPER (4). BI-DIRECTIONAL DATA BUS D7-D0. DATA BUS BUFFER 8-BIT INTERNAL DATA BUS. RD WR A1. READ WRITE CONTROL LOGIC. GROUP B CONTROL. GROUP B PORT C LOWER (4). GROUP B PORT B (8). A0 RESET. CS. 2. I/O PA7-PA0. I/O PC7-PC4. I/O PC3-PC0. I/O PB7-PB0.

<span class='text_page_counter'>(404)</span> 82C55A Functional Description POWER SUPPLIES. Data Bus Buffer This three-state bi-directional 8-bit buffer is used to interface the 82C55A to the system data bus. Data is transmitted or received by the buffer upon execution of input or output instructions by the CPU. Control words and status information are also transferred through the data bus buffer.. +5V GND. BI-DIRECTIONAL DATA BUS DATA BUS D7-D0 BUFFER. Read/Write and Control Logic The function of this block is to manage all of the internal and external transfers of both Data and Control or Status words. It accepts inputs from the CPU Address and Control busses and in turn, issues commands to both of the Control Groups.. RD WR A1 A0 RESET. READ WRITE CONTROL LOGIC. GROUP A CONTROL. GROUP A PORT A (8). GROUP A PORT C UPPER (4) 8-BIT INTERNAL DATA BUS. GROUP B CONTROL. GROUP B PORT C LOWER (4). GROUP B PORT B (8). I/O PA7PA0. I/O PC7PC4 I/O PC3PC0. I/O PB7PB0. (CS) Chip Select. A “low” on this input pin enables the communcation between the 82C55A and the CPU. CS. (RD) Read. A “low” on this input pin enables 82C55A to send the data or status information to the CPU on the data bus. In essence, it allows the CPU to “read from” the 82C55A.. FIGURE 1. 82C55A BLOCK DIAGRAM. DATA BUS BUFFER, READ/WRITE, GROUP A & B CONTROL LOGIC FUNCTIONS. (WR) Write. A “low” on this input pin enables the CPU to write data or control words into the 82C55A.. (RESET) Reset. A “high” on this input initializes the control register to 9Bh and all ports (A, B, C) are set to the input mode. “Bus hold” devices internal to the 82C55A will hold the I/O port inputs to a logic “1” state with a maximum hold current of 400µA.. (A0 and A1) Port Select 0 and Port Select 1. These input signals, in conjunction with the RD and WR inputs, control the selection of one of the three ports or the control word register. They are normally connected to the least significant bits of the address bus (A0 and A1).. Group A and Group B Controls. 82C55A BASIC OPERATION. A1. A0. RD. WR. CS. 0. 0. 0. 1. 0. The functional configuration of each port is programmed by the systems software. In essence, the CPU “outputs” a control word to the 82C55A. The control word contains information such as “mode”, “bit set”, “bit reset”, etc., that initializes the functional configuration of the 82C55A.. INPUT OPERATION (READ) Port A → Data Bus. 0. 1. 0. 1. 0. Port B → Data Bus. 1. 0. 0. 1. 0. Port C → Data Bus. 1. 1. 0. 1. 0. Control Word → Data Bus. Each of the Control blocks (Group A and Group B) accepts “commands” from the Read/Write Control logic, receives “control words” from the internal data bus and issues the proper commands to its associated ports. Control Group A - Port A and Port C upper (C7 - C4) Control Group B - Port B and Port C lower (C3 - C0). OUTPUT OPERATION (WRITE) 0. 0. 1. 0. 0. Data Bus → Port A. 0. 1. 1. 0. 0. Data Bus → Port B. 1. 0. 1. 0. 0. Data Bus → Port C. 1. 1. 1. 0. 0. Data Bus → Control. The control word register can be both written and read as shown in the “Basic Operation” table. Figure 4 shows the control word format for both Read and Write operations. When the control word is read, bit D7 will always be a logic “1”, as this implies control word mode information.. DISABLE FUNCTION X. X. X. X. 1. Data Bus → Three-State. X. X. 1. 1. 0. Data Bus → Three-State. 3.

<span class='text_page_counter'>(405)</span> 82C55A register will contain 9Bh. During the execution of the system program, any of the other modes may be selected using a single output instruction. This allows a single 82C55A to service a variety of peripheral devices with a simple software maintenance routine. Any port programmed as an output port is initialized to all zeros when the control word is written.. Ports A, B, and C The 82C55A contains three 8-bit ports (A, B, and C). All can be configured to a wide variety of functional characteristics by the system software but each has its own special features or “personality” to further enhance the power and flexibility of the 82C55A.. ADDRESS BUS. Port A One 8-bit data output latch/buffer and one 8-bit data input latch. Both “pull-up” and “pull-down” bus-hold devices are present on Port A. See Figure 2A.. CONTROL BUS DATA BUS. Port B One 8-bit data input/output latch/buffer and one 8-bit data input buffer. See Figure 2B. Port C One 8-bit data output latch/buffer and one 8-bit data input buffer (no latch for input). This port can be divided into two 4-bit ports under the mode control. Each 4-bit port contains a 4-bit latch and it can be used for the control signal output and status signal inputs in conjunction with ports A and B. See Figure 2B.. C B 8. A I/O. PB7-PB0. INPUT MODE MODE 1. MODE 2 OUTPUT MODE. VCC. I/O. 8. I/O. PA7-PA0. A I/O. 8 CONTROL CONTROL OR I/O OR I/O C. I/O. PA7-PA0. A BIDIRECTIONAL. I/O. PB7-PB0. P. 4. PC7-PC4. PC3-PC0. B 8. FIGURE 2A. PORT A BUS-HOLD CONFIGURATION. I/O. C. PB7-PB0. INTERNAL DATA OUT (LATCHED). 4. B 8. EXTERNAL PORT A PIN. RESET OR MODE CHANGE. A0-A1 CS. 82C55A MODE 0. MASTER RESET OR MODE CHANGE INTERNAL DATA IN. D7-D0. RD, WR. CONTROL. PA7-PA0. FIGURE 3. BASIC MODE DEFINITIONS AND BUS INTERFACE CONTROL WORD. INTERNAL DATA IN. D7 D6 D5 D4 D3 D2 D1 D0. EXTERNAL PORT B, C PIN. INTERNAL DATA OUT (LATCHED). GROUP B PORT C (LOWER) 1 = INPUT 0 = OUTPUT. OUTPUT MODE. PORT B 1 = INPUT 0 = OUTPUT. FIGURE 2B. PORT B AND C BUS-HOLD CONFIGURATION. MODE SELECTION 0 = MODE 0 1 = MODE 1. FIGURE 2. BUS-HOLD CONFIGURATION. Operational Description GROUP A. Mode Selection. PORT C (UPPER) 1 = INPUT 0 = OUTPUT. There are three basic modes of operation than can be selected by the system software: Mode 0 - Basic Input/Output Mode 1 - Strobed Input/Output Mode 2 - Bi-directional Bus. PORT A 1 = INPUT 0 = OUTPUT MODE SELECTION 00 = MODE 0 01 = MODE 1 1X = MODE 2. When the reset input goes “high”, all ports will be set to the input mode with all 24 port lines held at a logic “one” level by internal bus hold devices. After the reset is removed, the 82C55A can remain in the input mode with no additional initialization required. This eliminates the need to pullup or pulldown resistors in all-CMOS designs. The control word. MODE SET FLAG 1 = ACTIVE. FIGURE 4. MODE DEFINITION FORMAT. 4.

<span class='text_page_counter'>(406)</span> 82C55A The modes for Port A and Port B can be separately defined, while Port C is divided into two portions as required by the Port A and Port B definitions. All of the output registers, including the status flip-flops, will be reset whenever the mode is changed. Modes may be combined so that their functional definition can be “tailored” to almost any I/O structure. For instance: Group B can be programmed in Mode 0 to monitor simple switch closings or display computational results, Group A could be programmed in Mode 1 to monitor a keyboard or tape reader on an interrupt-driven basis.. This function allows the programmer to enable or disable a CPU interrupt by a specific I/O device without affecting any other device in the interrupt structure.. The mode definitions and possible mode combinations may seem confusing at first, but after a cursory review of the complete device operation a simple, logical I/O approach will surface. The design of the 82C55A has taken into account things such as efficient PC board layout, control signal definition vs. PC layout and complete functional flexibility to support almost any peripheral device with no external logic. Such design represents the maximum use of the available pins.. Operating Modes. INTE Flip-Flop Definition (BIT-SET)-INTE is SET - Interrupt Enable (BIT-RESET)-INTE is Reset - Interrupt Disable NOTE: All Mask flip-flops are automatically reset during mode selection and device Reset.. Mode 0 (Basic Input/Output). This functional configuration provides simple input and output operations for each of the three ports. No handshaking is required, data is simply written to or read from a specific port. Mode 0 Basic Functional Definitions: • Two 8-bit ports and two 4-bit ports • Any Port can be input or output. Single Bit Set/Reset Feature (Figure 5). • Outputs are latched. Any of the eight bits of Port C can be Set or Reset using a single Output instruction. This feature reduces software requirements in control-based applications.. • Input are not latched • 16 different Input/Output configurations possible. When Port C is being used as status/control for Port A or B, these bits can be set or reset by using the Bit Set/Reset operation just as if they were output ports.. MODE 0 PORT DEFINITION A. CONTROL WORD D7 D6 D5 D4 D3 D2 D1 D0 X. X. X. DON’T CARE. BIT SET/RESET 1 = SET 0 = RESET BIT SELECT 0 1 2 3 4 0 1 0 1 0 0 0 1 1 0 0 0 0 0 1. 5 1 0 1. 6 0 1 1. 7 1 B0 1 B1 1 B2. BIT SET/RESET FLAG 0 = ACTIVE. FIGURE 5. BIT SET/RESET FORMAT. Interrupt Control Functions When the 82C55A is programmed to operate in mode 1 or mode 2, control signals are provided that can be used as interrupt request inputs to the CPU. The interrupt request signals, generated from port C, can be inhibited or enabled by setting or resetting the associated INTE flip-flop, using the bit set/reset function of port C.. 5. B. GROUP A PORTC PORT A (Upper). GROUP B #. PORTC PORT B (Lower). D4. D3. D1. D0. 0. 0. 0. 0. Output. Output. 0. Output. Output. 0. 0. 0. 1. Output. Output. 1. Output. Input. 0. 0. 1. 0. Output. Output. 2. Input. Output. 0. 0. 1. 1. Output. Output. 3. Input. Input. 0. 1. 0. 0. Output. Input. 4. Output. Output. 0. 1. 0. 1. Output. Input. 5. Output. Input. 0. 1. 1. 0. Output. Input. 6. Input. Output. 0. 1. 1. 1. Output. Input. 7. Input. Input. 1. 0. 0. 0. Input. Output. 8. Output. Output. 1. 0. 0. 1. Input. Output. 9. Output. Input. 1. 0. 1. 0. Input. Output. 10. Input. Output. 1. 0. 1. 1. Input. Output. 11. Input. Input. 1. 1. 0. 0. Input. Input. 12. Output. Output. 1. 1. 0. 1. Input. Input. 13. Output. Input. 1. 1. 1. 0. Input. Input. 14. Input. Output. 1. 1. 1. 1. Input. Input. 15. Input. Input.

<span class='text_page_counter'>(407)</span> 82C55A Mode 0 (Basic Input) tRR. RD tIR. tHR. INPUT tAR. tRA. CS, A1, A0. D7-D0 tRD. tDF. Mode 0 (Basic Output) tWW WR tWD. tDW D7-D0 tAW. tWA. CS, A1, A0. OUTPUT tWB. Mode 0 Configurations CONTROL WORD #0. CONTROL WORD #2. D7 D6 D5 D4 D3 D2 D1 D0 1. 0. 0. 0. 0. 0. 0. D7 D6 D5 D4 D3 D2 D1 D0. 0. 1 8. A 82C55A. 4. 4. 8 B. 0. 0. 0. 0. 1. 0. 82C55A. 4. PC7 - PC4. PA7 - PA0 PC7 - PC4. C. D7 - D0. 4. PC3 - PC0. 8. PB7 - PB0. B. PC3 - PC0. PB7 - PB0. CONTROL WORD #3. 0. 0. D7 D6 D5 D4 D3 D2 D1 D0. 1. 1 8. A 82C55A. D7 - D0. 0. 8. D7 D6 D5 D4 D3 D2 D1 D0 0. 0. A. CONTROL WORD #1. 1. 0. PA7 - PA0. C. D7 - D0. 0. 4. 8 B. 0. 0. 0. 0. 1. 1 8. PA7 - PA0. A 82C55A. 4. PC7 - PC4. C 4. 0. D7 - D0. 4. 8 B. 6. PC7 - PC4. C. PC3 - PC0. PB7 - PB0. PA7 - PA0. PC3 - PC0. PB7 - PB0.

<span class='text_page_counter'>(408)</span> 82C55A Mode 0 Configurations. (Continued). CONTROL WORD #4. CONTROL WORD #8. D7 D6 D5 D4 D3 D2 D1 D0 1. 0. 0. 0. 1. 0. 0. D7 D6 D5 D4 D3 D2 D1 D0. 0. 1 8. A 82C55A. 4. 4. 8 B. 0. 0. 1. 0. 0. 82C55A. 4. 8. 8 B. 0. 1. 82C55A. PB7 - PB0. 0. 0. 0. 1. 82C55A. 4. PC7 - PC4. PA7 - PA0 PC7 - PC4. C. D7 - D0. 4. PC3 - PC0. 8. PB7 - PB0. B. PC3 - PC0. PB7 - PB0. D7 D6 D5 D4 D3 D2 D1 D0 1. 4. 4. 8 B. 0. 0. 1. 0. 0. 1. 0 8. PA7 - PA0. A 82C55A. 4. PC7 - PC4. PA7 - PA0 PC7 - PC4. C. D7 - D0. 4. PC3 - PC0. 8. PB7 - PB0. B. CONTROL WORD #7. PC3 - PC0. PB7 - PB0. CONTROL WORD #11. D7 D6 D5 D4 D3 D2 D1 D0 0. 1. D7 D6 D5 D4 D3 D2 D1 D0. 1. 1 8. A 82C55A. D7 - D0. 1. 8. C. D7 - D0. 1. 0. A. 0 8. 0. PC3 - PC0. CONTROL WORD #10. A. 0. 0. PA7 - PA0. D7 D6 D5 D4 D3 D2 D1 D0. 0. 4. PB7 - PB0. CONTROL WORD #6. 1. PC7 - PC4. C. D7 - D0 PC3 - PC0. 1. B. 1. 4. PA7 - PA0. D7 D6 D5 D4 D3 D2 D1 D0. 4. 0. 0. PC7 - PC4. C. D7 - D0. 0. 0. 82C55A. 1 8. 0. 0. CONTROL WORD #9. A. 1. 0. 8. D7 D6 D5 D4 D3 D2 D1 D0 0. 1. A. CONTROL WORD #5. 1. 0. PA7 - PA0. C. D7 - D0. 0. 4. 8 B. 0. 1. 0. 0. 1. 1 8. PA7 - PA0. A 82C55A. 4. PC7 - PC4. C 4. 0. D7 - D0. 4. 8 B. 7. PC7 - PC4. C. PC3 - PC0. PB7 - PB0. PA7 - PA0. PC3 - PC0. PB7 - PB0.

<span class='text_page_counter'>(409)</span> 82C55A Mode 0 Configurations. (Continued). CONTROL WORD #12. CONTROL WORD #14. D7 D6 D5 D4 D3 D2 D1 D0 1. 0. 0. 1. 1. 0. 0. D7 D6 D5 D4 D3 D2 D1 D0. 0. 1 8. A 82C55A. 4. 4. 8 B. 0. 1. 1. 1. 0. 1. 0 8. 82C55A. PA7 - PA0. 4. PC7 - PC4. PC7 - PC4. C. D7 - D0. 4. PC3 - PC0. PC3 - PC0. 8. PB7 - PB0. PB7 - PB0. B. CONTROL WORD #15. D7 D6 D5 D4 D3 D2 D1 D0 0. 1. A. CONTROL WORD #13. 1. 0. PA7 - PA0. C. D7 - D0. 0. 0. 0. D7 D6 D5 D4 D3 D2 D1 D0. 1. 1 8. A 82C55A. D7 - D0. 4. 8 B. 0. 1. 1. 0. 1. 1 8. PA7 - PA0. PA7 - PA0. A 82C55A. 4. PC7 - PC4. C 4. 0. PC7 - PC4. C. D7 - D0. 4. PC3 - PC0. PC3 - PC0. 8. PB7 - PB0. PB7 - PB0. B. Operating Modes. MODE 1 (PORT A). Mode 1 - (Strobed Input/Output). This functional configuration provides a means for transferring I/O data to or from a specified port in conjunction with strobes or “hand shaking” signals. In mode 1, port A and port B use the lines on port C to generate or accept these “hand shaking” signals.. CONTROL WORD D7 D6 D5 D4 D3 D2 D1 D0 1. 0. 1. 1. 1/0. INTE A. PC6, PC7 1 = INPUT 0 = OUTPUT. Mode 1 Basic Function Definitions: • Two Groups (Group A and Group B) • Each group contains one 8-bit port and one 4-bit control/data port • The 8-bit data port can be either input or output. Both inputs and outputs are latched. • The 4-bit port is used for control and status of the 8-bit port.. 8. PA7-PA0 PC4. STBA. PC5. IBFA. INTRA. PC3 RD. PC6, PC7. 2. I/O. MODE 1 (PORT B) CONTROL WORD D7 D6 D5 D4 D3 D2 D1 D0. Input Control Signal Definition. 1. 1. 1. PB7-PB0 INTE B. (Figures 6 and 7). PC2. 8. STBB. PC1. IBFB. PC0. INTRB. STB (Strobe Input) A “low” on this input loads data into the input latch. RD. IBF (Input Buffer Full F/F) FIGURE 6. MODE 1 INPUT. A “high” on this output indicates that the data has been loaded into the input latch: in essence, and acknowledgment. IBF is set by STB input being low and is reset by the rising edge of the RD input.. 8.

<span class='text_page_counter'>(410)</span> 82C55A tST STB tSIB IBF tSIT. tRIB. INTR. tRIT. RD tPH INPUT FROM PERIPHERAL tPS. FIGURE 7. MODE 1 (STROBED INPUT). INTR (Interrupt Request). INTE A. A “high” on this output can be used to interrupt the CPU when and input device is requesting service. INTR is set by the condition: STB is a “one”, IBF is a “one” and INTE is a “one”. It is reset by the falling edge of RD. This procedure allows an input device to request service from the CPU by simply strobing its data into the port.. Controlled by Bit Set/Reset of PC6. INTE B Controlled by Bit Set/Reset of PC2. NOTE: 1. To strobe data into the peripheral device, the user must operate the strobe line in a hand shaking mode. The user needs to send OBF to the peripheral device, generates an ACK from the peripheral device and then latch data into the peripheral device on the rising edge of OBF.. INTE A Controlled by bit set/reset of PC4. INTE B. MODE 1 (PORT A). Controlled by bit set/reset of PC2.. PA7-PA0. CONTROL WORD D7 D6 D5 D4 D3 D2 D1 D0. Output Control Signal Definition (Figure 8 and 9). 1. 0. 1. 1. 1/0. OBF - Output Buffer Full F/F). The OBF output will go “low” to indicate that the CPU has written data out to be specified port. This does not mean valid data is sent out of the part at this time since OBF can go true before data is available. Data is guaranteed valid at the rising edge of OBF, (See Note 1). The OBF F/F will be set by the rising edge of the WR input and reset by ACK input being low.. PC4, PC5 1 = INPUT 0 = OUTPUT. INTE A. 8. PC7. OBFA. PC6. ACKA. INTRA. PC3 WR. ACK - Acknowledge Input). A “low” on this input informs the 82C55A that the data from Port A or Port B is ready to be accepted. In essence, a response from the peripheral device indicating that it is ready to accept data, (See Note 1).. PC4, PC5. 2. MODE 1 (PORT B) PB7-PB0. CONTROL WORD D7 D6 D5 D4 D3 D2 D1 D0. INTR - (Interrupt Request). A “high” on this output can be used to interrupt the CPU when an output device has accepted data transmitted by the CPU. INTR is set when ACK is a “one”, OBF is a “one” and INTE is a “one”. It is reset by the falling edge of WR.. 1. 1. PC1. OBFB. PC2. ACKB. PC0. INTRB. 0 INTE B. WR. FIGURE 8. MODE 1 OUTPUT. 9. 8.

<span class='text_page_counter'>(411)</span> 82C55A tWOB WR. tAOB OBF. INTR. tWIT. ACK tAK. tAIT. OUTPUT tWB. FIGURE 9. MODE 1 (STROBED OUTPUT). PA7-PA0 RD CONTROL WORD D7 D6 D5 D4 D3 D2 D1 D0 1. 0. 1. 1. 1/0. 1. 8. PC4. STBA. PC5. IIBFA. PC6, PC7 1 = INPUT 0 = OUTPUT. PC6, PC7 PB7, PB0. WR. WR CONTROL WORD D7 D6 D5 D4 D3 D2 D1 D0. INTRA. PC3. 0. PA7-PA0. 2. 1. 0. 1. 0. 1/0. I/O. OBFB. PC2 PC0. PC7. OBFA. PC6. ACKA INTRA. PC3. 1 PC4, PC5 1 = INPUT 0 = OUTPUT. 8. PC1. 1. 8. PC4, PC5 PB7, PB0. 2. I/O. 8. PC2. STBB. ACKB. PC1. IBFB. INTRB. PC0. INTRB. RD. PORT A - (STROBED INPUT) PORT B - (STROBED OUTPUT). PORT A - (STROBED OUTPUT) PORT B - (STROBED INPUT). Combinations of Mode 1: Port A and Port B can be individually defined as input or output in Mode 1 to support a wide variety of strobed I/O applications. FIGURE 10. COMBINATIONS OF MODE 1. Operating Modes Mode 2 (Strobed Bi-Directional Bus I/O). Output Operations. The functional configuration provides a means for communicating with a peripheral device or structure on a single 8-bit bus for both transmitting and receiving data (bi-directional bus I/O). “Hand shaking” signals are provided to maintain proper bus flow discipline similar to Mode 1. Interrupt generation and enable/disable functions are also available.. OBF - (Output Buffer Full). The OBF output will go “low” to indicate that the CPU has written data out to port A.. Mode 2 Basic Functional Definitions: • Used in Group A only • One 8-bit, bi-directional bus Port (Port A) and a 5-bit control Port (Port C) • Both inputs and outputs are latched • The 5-bit control port (Port C) is used for control and status for the 8-bit, bi-directional bus port (Port A). INTE 1 - (The INTE flip-flop associated with OBF). Controlled by bit set/reset of PC4.. ACK - (Acknowledge). A “low” on this input enables the three-state output buffer of port A to send out the data. Otherwise, the output buffer will be in the high impedance state.. Input Operations STB - (Strobe Input). A “low” on this input loads data into the input latch. IBF - (Input Buffer Full F/F). A “high” on this output indicates that data has been loaded into the input latch.. Bi-Directional Bus I/O Control Signal Definition. INTE 2 - (The INTE flip-flop associated with IBF). Controlled by bit set/reset of PC4.. (Figures 11, 12, 13, 14). INTR - (Interrupt Request). A high on this output can be used to interrupt the CPU for both input or output operations.. 10.

<span class='text_page_counter'>(412)</span> 82C55A CONTROL WORD D7 D6 D5 D4 D3 D2 D1 D0 1. 1. INTRA. PC3. 1/0 1/0 1/0. PA7-PA0. PC2-PC0 1 = INPUT 0 = OUTPUT PORT B 1 = INPUT 0 = OUTPUT. 8. PC7. OBFA. INTE 1. PC6. ACKA. INTE 2. PC4. STBA. PC5. IBFA. WR GROUP B MODE 0 = MODE 0 1 = MODE 1. PC2-PC0. RD. FIGURE 11. MODE CONTROL WORD. 3. I/O. FIGURE 12. MODE 2. DATA FROM CPU TO 82C55A. WR tAOB OBF tWOB INTR tAK ACK tST STB. tSIB IBF tAD tPS. tKD. PERIPHERAL BUS tRIB. tPH RD. DATA FROM PERIPHERAL TO 82C55A. DATA FROM 82C55A TO PERIPHERAL DATA FROM 82C55A TO CPU. NOTE: Any sequence where WR occurs before ACK and STB occurs before RD is permissible. (INTR = IBF • MASK • STB • RD ÷ OBF • MASK • ACK • WR) FIGURE 13. MODE 2 (BI-DIRECTIONAL). 11.

<span class='text_page_counter'>(413)</span> 82C55A MODE 2 AND MODE 0 (INPUT). MODE 2 AND MODE 0 (OUTPUT) PC3 PA7-PA0. 1. 1. 0. 1. 1/0. PC2-PC0 1 = INPUT 0 = OUTPUT. PA7-PA0. 8 OBFA. PC7 CONTROL WORD D7 D6 D5 D4 D3 D2 D1 D0. PC6. ACKA. PC4. STBA. PC5. IBFA. PC2-PC0. PC3. INTRA. 3. CONTROL WORD D7 D6 D5 D4 D3 D2 D1 D0 1. 1. 0. ACKA. PC4. STBA IBFA. PC5 3. I/O. 8. WR. MODE 2 AND MODE 1 (INPUT) PC3 PA7-PA0. CONTROL WORD D7 D6 D5 D4 D3 D2 D1 D0 0. PA7-PA0. 8 OBFA. PC6. ACKA. PC4. STBA. PC5. IBFA. PC1. PC3. INTRA. PC7. PB7-PB0. WR. PC6. PB7, PB0. 8. MODE 2 AND MODE 1 (OUTPUT). RD. OBFA. RD PB7-PB0. 1. 8. PC7. PC2-PC0. I/O. WR. 1. 1/0. PC2-PC0 1 = INPUT 0 = OUTPUT. RD. 1. 0. INTRA. CONTROL WORD D7 D6 D5 D4 D3 D2 D1 D0 1. 1. 1. 1. OBFB. PC2. ACKB. PC0. INTRB. RD. WR. FIGURE 14. MODE 2 COMBINATIONS. 12. 8. PC7. OBFA. PC6. ACKA. PC4. STBA. PC5. IBFA. PB7-PB0. 8. INTRA. 8. PC2. STBB. PC1. IBFB. PC0. INTRB.

<span class='text_page_counter'>(414)</span> 82C55A MODE DEFINITION SUMMARY MODE 1. MODE 0. MODE 2. IN. OUT. IN. OUT. PA0 PA1 PA2 PA3 PA4 PA5 PA6 PA7. In In In In In In In In. Out Out Out Out Out Out Out Out. In In In In In In In In. Out Out Out Out Out Out Out Out. PB0 PB1 PB2 PB3 PB4 PB5 PB6 PB7. In In In In In In In In. Out Out Out Out Out Out Out Out. In In In In In In In In. Out Out Out Out Out Out Out Out. PC0 PC1 PC2 PC3 PC4 PC5 PC6 PC7. In In In In In In In In. Out Out Out Out Out Out Out Out. INTRB IBFB STBB INTRA STBA IBFA I/O I/O. INTRB OBFB ACKB INTRA I/O I/O ACKA OBFA. Special Mode Combination Considerations. GROUP A ONLY. Mode 0 or Mode 1 Only. I/O I/O I/O INTRA STBA IBFA ACKA OBFA. INPUT CONFIGURATION. There are several combinations of modes possible. For any combination, some or all of Port C lines are used for control or status. The remaining bits are either inputs or outputs as defined by a “Set Mode” command.. D7. D6. D5. I/O. I/O. IBFA. D4. D3. D2. INTEA INTRA INTEB. GROUP A. During a read of Port C, the state of all the Port C lines, except the ACK and STB lines, will be placed on the data bus. In place of the ACK and STB line states, flag status will appear on the data bus in the PC2, PC4, and PC6 bit positions as illustrated by Figure 17.. D1. D0. IBFB. INTRB. GROUP B. OUTPUT CONFIGURATION D7. D6. OBFA INTEA. Through a “Write Port C” command, only the Port C pins programmed as outputs in a Mode 0 group can be written. No other pins can be affected by a “Write Port C” command, nor can the interrupt enable flags be accessed. To write to any Port C output programmed as an output in Mode 1 group or to change an interrupt enable flag, the “Set/Reset Port C Bit” command must be used.. D5. D4. I/O. I/O. D3. D2. D1. D0. INTRA INTEB OBFB INTRB. GROUP A. GROUP B. FIGURE 15. MODE 1 STATUS WORD FORMAT D7. D6. OBFA INTE1. D5 IBFA. D4. INTE2 INTRA. GROUP A. With a “Set/Reset Port Cea Bit” command, any Port C line programmed as an output (including IBF and OBF) can be written, or an interrupt enable flag can be either set or reset. Port C lines programmed as inputs, including ACK and STB lines, associated with Port C fare not affected by a “Set/Reset Port C Bit” command. Writing to the corresponding Port C bit positions of the ACK and STB lines with the “Set Reset Port C Bit” command will affect the Group A and Group B interrupt enable flags, as illustrated in Figure 17.. D3. D2. D1. D0. X. X. X. GROUP B. (Defined by Mode 0 or Mode 1 Selection) FIGURE 16. MODE 2 STATUS WORD FORMAT. Current Drive Capability Any output on Port A, B or C can sink or source 2.5mA. This feature allows the 82C55A to directly drive Darlington type drivers and high-voltage displays that require such sink or source current.. 13.

<span class='text_page_counter'>(415)</span> 82C55A Reading Port C Status (Figures 15 and 16). Applications of the 82C55A. In Mode 0, Port C transfers data to or from the peripheral device. When the 82C55A is programmed to function in Modes 1 or 2, Port C generates or accepts “hand shaking” signals with the peripheral device. Reading the contents of Port C allows the programmer to test or verify the “status” of each peripheral device and change the program flow accordingly.. The 82C55A is a very powerful tool for interfacing peripheral equipment to the microcomputer system. It represents the optimum use of available pins and flexible enough to interface almost any I/O device without the need for additional external logic. Each peripheral device in a microcomputer system usually has a “service routine” associated with it. The routine manages the software interface between the device and the CPU. The functional definition of the 82C55A is programmed by the I/O service routine and becomes an extension of the system software. By examining the I/O devices interface characteristics for both data transfer and timing, and matching this information to the examples and tables in the detailed operational description, a control word can easily be developed to initialize the 82C55A to exactly “fit” the application. Figures 18 through 24 present a few examples of typical applications of the 82C55A.. There is not special instruction to read the status information from Port C. A normal read operation of Port C is executed to perform this function. INTERRUPT ENABLE FLAG. POSITION. ALTERNATE PORT C PIN SIGNAL (MODE). INTE B. PC2. ACKB (Output Mode 1) or STBB (Input Mode 1). INTE A2. PC4. STBA (Input Mode 1 or Mode 2). INTE A1. PC6. ACKA (Output Mode 1 or Mode 2). FIGURE 17. INTERRUPT ENABLE FLAGS IN MODES 1 AND 2. INTERRUPT REQUEST PC3. PA0 PA1 PA2 PA3 PA4 PA5 MODE 1 PA6 (OUTPUT) PA7 PC7 PC6 PC5 PC4. HIGH SPEED PRINTER. HAMMER RELAYS DATA READY ACK PAPER FEED FORWARD/REV.. 82C55A PB0 PB1 PB2 PB3 PB4 MODE 1 PB5 (OUTPUT) PB6 PB7 PC1 PC2. PAPER FEED FORWARD/REV. RIBBON CARRIAGE SEN. DATA READY ACK. PC0 INTERRUPT REQUEST. CONTROL LOGIC AND DRIVERS. FIGURE 18. PRINTER INTERFACE. 14.

<span class='text_page_counter'>(416)</span> 82C55A INTERRUPT REQUEST PC3. MODE 1 (INPUT). PA0 PA1 PA2 PA3 PA4 PA5 PA6 PA7. R0 R1 R2 FULLY R3 DECODED R4 KEYBOARD R5 SHIFT CONTROL. PC4 PC5. STROBE ACK. INTERRUPT REQUEST PC3. MODE 1 (INPUT) 82C55A PB0 PB1 PB2 PB3 PB4 MODE 1 PB5 (OUTPUT) PB6 PB7. B0 B1 B2 BURROUGHS SELF-SCAN B3 DISPLAY B4 B5 BACKSPACE CLEAR. 82C55A. MODE 0 (INPUT). DATA READY ACK BLANKING CANCEL WORD. PC1 PC2 PC6 PC7. PA0 PA1 PA2 PA3 PA4 PA5 PA6 PA7. R0 R1 R2 FULLY R3 DECODED R4 KEYBOARD R5 SHIFT CONTROL. PC4 PC5 PC6 PC7. STROBE ACK BUST LT TEST LT TERMINAL ADDRESS. PB0 PB1 PB2 PB3 PB4 PB5 PB6 PB7. INTERRUPT REQUEST. FIGURE 20. KEYBOARD AND TERMINAL ADDRESS INTERFACE. FIGURE 19. KEYBOARD AND DISPLAY INTERFACE. INTERRUPT REQUEST PA0 PA1 PA2 PA3 PA4 MODE 0 PA5 (OUTPUT) PA6 PA7 PC4 PC5 PC6 PC7 82C55A PC0 PC1 BIT SET/RESET PC2 PC3 PB0 PB1 PB2 MODE 0 (INPUT). PB3 PC4 PC5 PC6 PC7. LSB. PC3. 12-BIT A/D CONVERTER (DAC). PA0 PA1 PA2 PA3 PA4 PA5 MODE 1 PA6 (OUTPUT) PA7. ANALOG OUTPUT. PC7 PC6 PC5 PC4. DATA READY ACK BLANKED BLACK/WHITE. PC2 PC1 PC0. ROW STB COLUMN STB CURSOR H/V STB. 82C55A. STB DATA. SAMPLE EN STB LSB 8-BIT D/A CONVERTER (ADC). R0 R1 R2 CRT CONTROLLER R3 • CHARACTER GEN. • REFRESH BUFFER R4 • CURSOR CONTROL R5 SHIFT CONTROL. PB0 MODE 0 PB1 (OUTPUT) PB2 PB3 PB4 PB5 PB6 PB7. ANALOG INPUT. MAB. FIGURE 21. DIGITAL TO ANALOG, ANALOG TO DIGITAL. CURSOR/ROW/COLUMN ADDRESS H&V. FIGURE 22. BASIC CRT CONTROLLER INTERFACE. 15.

<span class='text_page_counter'>(417)</span> 82C55A. INTERRUPT REQUEST. INTERRUPT REQUEST PC3. MODE 2. PC3. PA0 PA1 PA2 PA3 PA4 PA5 PA6 PA7. D0 D1 D2 D3 D4 D5 D6 D7. PC4 PC5 PC7 PC6. DATA STB ACK (IN) DATA READY ACK (OUT). PC2 PC1 PC0. TRACK “0” SENSOR SYNC READY INDEX. FLOPPY DISK CONTROLLER AND DRIVE MODE 1 (INPUT). 82C55A. PA0 PA1 PA2 PA3 PA4 PA5 PA6 PA7. R0 R1 R2 R3 R4 R5 R6 R7. PC4 PC5 PC6. STB ACK STOP/GO. PC0 PC1 PC2. START/STOP LIMIT SENSOR (H/V) OUT OF FLUID. MACHINE TOOL. 82C55A. PB0 PB1 PB2 MODE 0 PB3 (OUTPUT) PB4 PB5 PB6 PB7. MODE 0 (INPUT). ENGAGE HEAD FORWARD/REV. READ ENABLE WRITE ENABLE DISC SELECT ENABLE CRC TEST BUSY LT. PB0 PB1 PB2 MODE 0 PB3 (OUTPUT) PB4 PB5 PB6 PB7. FIGURE 23. BASIC FLOPPY DISC INTERFACE. B LEVEL PAPER TAPE READER. CHANGE TOOL LEFT/RIGHT UP/DOWN HOR. STEP STROBE VERT. STEP STROBE SLEW/STEP FLUID ENABLE EMERGENCY STOP. FIGURE 24. MACHINE TOOL CONTROLLER INTERFACE. 16.

<span class='text_page_counter'>(418)</span> 82C55A TA = 25oC. Absolute Maximum Ratings. Thermal Information Thermal Resistance (Typical, Note 1) θJA θJC CERDIP Package . . . . . . . . . . . . . . . . 50oC/W 10oC/W CLCC Package . . . . . . . . . . . . . . . . . . 65oC/W 14oC/W PDIP Package . . . . . . . . . . . . . . . . . . . 50oC/W N/A PLCC Package . . . . . . . . . . . . . . . . . . 46oC/W N/A Maximum Storage Temperature Range . . . . . . . . . .-65oC to 150oC Maximum Junction Temperature CDIP Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175oC PDIP Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150oC Maximum Lead Temperature (Soldering 10s) . . . . . . . . . . . . . 300oC (PLCC Lead Tips Only). Supply Voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . +8.0V Input, Output or I/O Voltage . . . . . . . . . . . . GND-0.5V to VCC+0.5V ESD Classification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Class 1. Operating Conditions Voltage Range . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . +4.5V to 5.5V Operating Temperature Range C82C55A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .0oC to 70oC I82C55A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . -40oC to 85oC M82C55A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . -55oC to 125oC. Die Characteristics Gate Count . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1000 Gates CAUTION: Stresses above those listed in “Absolute Maximum Ratings” may cause permanent damage to the device. This is a stress only rating and operation of the device at these or any other conditions above those indicated in the operational sections of this specification is not implied.. NOTE: 1. θJA is measured with the component mounted on an evaluation PC board in free air.. Electrical Specifications. VCC = 5.0V ±10%; TA = 0oC to +70oC (C82C55A); TA = -40oC to +85oC (I82C55A); TA = -55oC to +125oC (M82C55A) LIMITS. SYMBOL. PARAMETER. MIN. MAX. UNITS. TEST CONDITIONS. VIH. Logical One Input Voltage. 2.0 2.2. -. V. I82C55A, C82C55A, M82C55A. VIL. Logical Zero Input Voltage. -. 0.8. V. VOH. Logical One Output Voltage. 3.0 VCC -0.4. -. V. IOH = -2.5mA, IOH = -100µA. VOL. Logical Zero Output Voltage. -. 0.4. V. IOL +2.5mA. II. Input Leakage Current. -1.0. +1.0. µA. VIN = VCC or GND, DIP Pins: 5, 6, 8, 9, 35, 36. IO. I/O Pin Leakage Current. -10. +10. µA. VO = VCC or GND DIP Pins: 27 - 34. IBHH. Bus Hold High Current. -50. -400. µA. VO = 3.0V. Ports A, B, C. IBHL. Bus Hold Low Current. 50. 400. µA. VO = 1.0V. Port A ONLY. IDAR. Darlington Drive Current. -2.5. Note 2, 4. mA. Ports A, B, C. Test Condition 3. ICCSB. Standby Power Supply Current. -. 10. µA. VCC = 5.5V, VIN = VCC or GND. Output Open. ICCOP. Operating Power Supply Current. -. 1. mA/MHz. TA = +25oC, VCC = 5.0V, Typical (See Note 3). NOTES: 2. No internal current limiting exists on Port Outputs. A resistor must be added externally to limit the current. 3. ICCOP = 1mA/MHz of Peripheral Read/Write cycle time. (Example: 1.0µs I/O Read/Write cycle time = 1mA). 4. Tested as VOH at -2.5mA.. Capacitance SYMBOL. TA = 25oC PARAMETER. TYPICAL. UNITS. CIN. Input Capacitance. 10. pF. CI/O. I/O Capacitance. 20. pF. 17. TEST CONDITIONS FREQ = 1MHz, All Measurements are referenced to device GND.

<span class='text_page_counter'>(419)</span> 82C55A AC Electrical Specifications. VCC = +5V± 10%, GND = 0V; TA = -55oC to +125oC (M82C55A) (M82C55A-5); TA = -40oC to +85oC (I82C55A) (I82C55A-5); TA = 0oC to +70oC (C82C55A) (C82C55A-5) 82C55A-5. SYMBOL. PARAMETER. 82C55A. MIN. MAX. MIN. MAX. UNITS. TEST CONDITIONS. READ TIMING (1) tAR. Address Stable Before RD. 0. -. 0. -. ns. (2) tRA. Address Stable After RD. 0. -. 0. -. ns. (3) tRR. RD Pulse Width. 250. -. 150. -. ns. (4) tRD. Data Valid From RD. -. 200. -. 120. ns. 1. (5) tDF. Data Float After RD. 10. 75. 10. 75. ns. 2. (6) tRV. Time Between RDs and/or WRs. 300. -. 300. -. ns. WRITE TIMING (7) tAW. Address Stable Before WR. 0. -. 0. -. ns. (8) tWA. Address Stable After WR. 20. -. 20. -. ns. (9) tWW. WR Pulse Width. 100. -. 100. -. ns. (10) tDW. Data Valid to WR High. 100. -. 100. -. ns. (11) tWD. Data Valid After WR High. 30. -. 30. -. ns. OTHER TIMING (12) tWB. WR = 1 to Output. -. 350. -. 350. ns. 1. (13) tIR. Peripheral Data Before RD. 0. -. 0. -. ns. (14) tHR. Peripheral Data After RD. 0. -. 0. -. ns. (15) tAK. ACK Pulse Width. 200. -. 200. -. ns. (16) tST. STB Pulse Width. 100. -. 100. -. ns. (17) tPS. Peripheral Data Before STB High. 20. -. 20. -. ns. (18) tPH. Peripheral Data After STB High. 50. -. 50. -. ns. (19) tAD. ACK = 0 to Output. -. 175. -. 175. ns. 1. (20) tKD. ACK = 1 to Output Float. 20. 250. 20. 250. ns. 2. (21) tWOB. WR = 1 to OBF = 0. -. 150. -. 150. ns. 1. (22) tAOB. ACK = 0 to OBF = 1. -. 150. -. 150. ns. 1. (23) tSIB. STB = 0 to IBF = 1. -. 150. -. 150. ns. 1. (24) tRIB. RD = 1 to IBF = 0. -. 150. -. 150. ns. 1. (25) tRIT. RD = 0 to INTR = 0. -. 200. -. 200. ns. 1. (26) tSIT. STB = 1 to INTR = 1. -. 150. -. 150. ns. 1. (27) tAIT. ACK = 1 to INTR = 1. -. 150. -. 150. ns. 1. (28) tWIT. WR = 0 to INTR = 0. -. 200. -. 200. ns. 1. (29) tRES. Reset Pulse Width. 500. -. 500. -. ns. 1, (Note). NOTE: Period of initial Reset pulse after power-on must be at least 50µsec. Subsequent Reset pulses may be 500ns minimum.. 18.

<span class='text_page_counter'>(420)</span> 82C55A Timing Waveforms tRR (3). RD tIR (13). tHR (14). INPUT tAR (1). tRA (2). CS, A1, A0. D7-D0 tRD (4). tDF (5). FIGURE 25. MODE 0 (BASIC INPUT). tWW (9) WR tDW (10). tWD (11). D7-D0 tAW (7). tWA (8). CS, A1, A0. OUTPUT tWS (12). FIGURE 26. MODE 0 (BASIC OUTPUT). tST (16) STB. IBF. tSIB (23). tSIT (26). tRIB (24) tRIT (25). INTR. RD. tPH (18). INPUT FROM PERIPHERAL tPS (17). FIGURE 27. MODE 1 (STROBED INPUT). 19.

<span class='text_page_counter'>(421)</span> 82C55A Timing Waveforms. (Continued) tWOB (21). WR. tAOB (22) OBF. tWIT (28). INTR. ACK tAK (15). tAIT (27). OUTPUT tWB (12). FIGURE 28. MODE 1 (STROBED OUTPUT). DATA FROM CPU TO 82C55A WR (NOTE) tAOB (22). OBF tWOB (21) INTR. tAK (15) ACK tST (16) STB (NOTE) IBF. tSIB (23) tAD (19) tPS (17). tKD (20). PERIPHERAL BUS tRIB (24). tPH (18) RD. DATA FROM PERIPHERAL TO 82C55A. DATA FROM 82C55A TO PERIPHERAL DATA FROM 82C55A TO CPU. FIGURE 29. MODE 2 (BI-DIRECTIONAL) NOTE: Any sequence where WR occurs before ACK and STB occurs before RD is permissible. (INTR = IBF • MASK • STB • RD • OBF • MASK • ACK • WR). 20.

<span class='text_page_counter'>(422)</span> 82C55A Timing Waveforms. (Continued). A0-A1, CS. A0-A1, CS tWA (8). tAW (7). tRA (2). tAR (1) tRR (3). DATA BUS. RD tDW (10). tWD (11). (4) tRD. tDF (5). DATA BUS. WR. VALID HIGH IMPEDANCE. tWW (9). FIGURE 30. WRITE TIMING. FIGURE 31. READ TIMING. AC Test Circuit. AC Testing Input, Output Waveforms V1. INPUT. OUTPUT. VIH + 0.4V. VOH 1.5V. R1 OUTPUT FROM DEVICE UNDER TEST. TEST POINT R2. 1.5V VOL. VIL - 0.4V. AC Testing: All AC Parameters tested as per test circuits. Input RISE and FALL times are driven at 1ns/V.. C1 (SEE NOTE). TEST CONDITION DEFINITION TABLE NOTE: Includes STRAY and JIG Capacitance. TEST CONDITION. V1. R1. R2. C1. 1. 1.7V. 523Ω. Open. 150pF. 2. VCC. 2kΩ. 1.7kΩ. 50pF. 3. 1.5V. 750Ω. Open. 50pF. Burn-In Circuits. 37. F14. F4. 5. 36. F2. F3. 6. 35. F5. GND F0. 7 8. 34 33. GND. 6. 5. 4. 3. 2. 1 44 43 42 41 40. 7. 39. 8. 38. F5. F0. 9. 37. F15. F1 F10. 10. 36. 11. 35. F11 F12. F6. 12. 34. F13. F7. 13. 33. F14. F8. 14. 32. F15. F15 F11. F2. 4. F14. F13. F9. F13. 38. F12. 3. F6. F12. F8. F7. F11. 39. F8. 40. 2. F9. 1. F7. F4. F6. F11. MR82C55A CLCC F3. MD82C55A CERDIP. F1. 9. 32. F10. 10. 31. F13. F6. 11. 30. F14. F7. 12. 29. F15. F8. 13. 28. F11. F9. 15. 31. F11. F9. 14. 27. F12. F10. 16. 30. F12. F10. 15. 26. F6. 17. 29. F6. 16. 25. F13. F7. 17. 24. F14. F8. 18. 23. F15. F9. 19. 22. F11. F10. 20. 21. F12. NOTES: 1. VCC = 5.5V ± 0.5V 2. VIH = 4.5V ± 10% 3. VIL = -0.2V to 0.4V 4. GND = 0V. 18 19 20 21 22 23 24 25 26 27 28. C1. NOTES: 1. C1 = 0.01µF minimum 2. All resistors are 47kΩ ± 5% 3. f0 = 100kHz ± 10% 4. f1 = f0 ÷ 2; f2 = f1 ÷ 2; . . . ; f15 = f14 ÷ 2. 21. VCC. F13. F14. F15. F11. F12. F10. F7. C1 F9. VCC. F8. F12.

<span class='text_page_counter'>(423)</span> 82C55A Die Characteristics DIE DIMENSIONS: 95 x 100 x 19 ±1mils. GLASSIVATION: Type: SiO2 Thickness: 8kÅ ±1kÅ. METALLIZATION: Type: Silicon - Aluminum Thickness: 11kÅ ±1kÅ. WORST CASE CURRENT DENSITY: 0.78 x 105 A/cm2. Metallization Mask Layout 82C55A. RD. PA0. PA1. PA2. PA3 PA4. PA5. PA6. PA7. WR. RESET. CS GND. D0. A1. D1. A0. D2. PC7. D3. PC6. D4. PC5. D5. PC4. D6. PC0. D7. PC1. VCC. PC2. PD3. PB0. PB1. PB2. 22. PB3 PB4. PB5 PB6. PB7.

<span class='text_page_counter'>(424)</span> 82C55A Dual-In-Line Plastic Packages (PDIP) E40.6 (JEDEC MS-011-AC ISSUE B). N. 40 LEAD DUAL-IN-LINE PLASTIC PACKAGE E1. INDEX AREA. 1 2 3. INCHES. N/2. SYMBOL -B-. -C-. A2. SEATING PLANE. e. B1. D1. B 0.010 (0.25) M. A1. eC C A B S. MAX. NOTES. -. 0.250. -. 6.35. 4. 0.015. -. 0.39. -. 4. A2. 0.125. 0.195. 3.18. 4.95. -. B. 0.014. 0.022. 0.356. 0.558. -. C L. B1. 0.030. 0.070. 0.77. 1.77. 8. eA. C. 0.008. 0.015. 0.204. 0.381. -. D. 1.980. 2.095. D1. 0.005. -. A L. D1. MIN. A E. BASE PLANE. MAX. A1. -AD. MILLIMETERS. MIN. C. eB. NOTES: 1. Controlling Dimensions: INCH. In case of conflict between English and Metric dimensions, the inch dimensions control. 2. Dimensioning and tolerancing per ANSI Y14.5M-1982. 3. Symbols are defined in the “MO Series Symbol List” in Section 2.2 of Publication No. 95. 4. Dimensions A, A1 and L are measured with the package seated in JEDEC seating plane gauge GS-3. 5. D, D1, and E1 dimensions do not include mold flash or protrusions. Mold flash or protrusions shall not exceed 0.010 inch (0.25mm). 6. E and eA are measured with the leads constrained to be perpendicular to datum -C- . 7. eB and eC are measured at the lead tips with the leads unconstrained. eC must be zero or greater. 8. B1 maximum dimensions do not include dambar protrusions. Dambar protrusions shall not exceed 0.010 inch (0.25mm). 9. N is the maximum number of terminal positions. 10. Corner leads (1, N, N/2 and N/2 + 1) for E8.3, E16.3, E18.3, E28.3, E42.6 will have a B1 dimension of 0.030 - 0.045 inch (0.76 - 1.14mm).. 50.3. 53.2. 5. -. 5. 0.13. E. 0.600. 0.625. 15.24. 15.87. 6. E1. 0.485. 0.580. 12.32. 14.73. 5. e. 0.100 BSC. 2.54 BSC. -. eA. 0.600 BSC. 15.24 BSC. 6. eB. -. 0.700. -. 17.78. 7. L. 0.115. 0.200. 2.93. 5.08. 4. N. 40. 40. 9 Rev. 0 12/93. 23.

<span class='text_page_counter'>(425)</span> 82C55A Plastic Leaded Chip Carrier Packages (PLCC) 0.042 (1.07) 0.048 (1.22) PIN (1) IDENTIFIER. N44.65 (JEDEC MS-018AC ISSUE A). 0.042 (1.07) 0.056 (1.42). 0.004 (0.10). C. 0.025 (0.64) R 0.045 (1.14). 0.050 (1.27) TP. C L. D2/E2 C L E1 E D2/E2 VIEW “A”. A1 A. D1 D 0.020 (0.51) MAX 3 PLCS. 0.020 (0.51) MIN. 0.045 (1.14) MIN. INCHES. MILLIMETERS. SYMBOL. MIN. MAX. MIN. MAX. NOTES. A. 0.165. 0.180. 4.20. 4.57. -. A1. 0.090. 0.120. 2.29. 3.04. -. D. 0.685. 0.695. 17.40. 17.65. -. D1. 0.650. 0.656. 16.51. 16.66. 3. D2. 0.291. 0.319. 7.40. 8.10. 4, 5. E. 0.685. 0.695. 17.40. 17.65. -. E1. 0.650. 0.656. 16.51. 16.66. 3. E2. 0.291. 0.319. 7.40. 8.10. 4, 5. N. 44. 44. 6 Rev. 2 11/97. SEATING -C- PLANE 0.026 (0.66) 0.032 (0.81). 44 LEAD PLASTIC LEADED CHIP CARRIER PACKAGE. 0.013 (0.33) 0.021 (0.53). 0.025 (0.64) MIN VIEW “A” TYP.. NOTES: 1. Controlling dimension: INCH. Converted millimeter dimensions are not necessarily exact. 2. Dimensions and tolerancing per ANSI Y14.5M-1982. 3. Dimensions D1 and E1 do not include mold protrusions. Allowable mold protrusion is 0.010 inch (0.25mm) per side. Dimensions D1 and E1 include mold mismatch and are measured at the extreme material condition at the body parting line. 4. To be measured at seating plane -C- contact point. 5. Centerline to be determined where center leads exit plastic body. 6. “N” is the number of terminal positions.. 24.

<span class='text_page_counter'>(426)</span> 82C55A Ceramic Dual-In-Line Frit Seal Packages (CERDIP) F40.6 MIL-STD-1835 GDIP1-T40 (D-5, CONFIGURATION A). LEAD FINISH. c1. 40 LEAD CERAMIC DUAL-IN-LINE FRIT SEAL PACKAGE. -D-. -A-. BASE METAL. SYMBOL. E M -Bbbb S. C A-B S. -C-. S1. -. 0.225. -. 5.72. -. 0.026. 0.36. 0.66. 2. b1. 0.014. 0.023. 0.36. 0.58. 3. b2. 0.045. 0.065. 1.14. 1.65. -. b3. 0.023. 0.045. 0.58. 1.14. 4. c. 0.008. 0.018. 0.20. 0.46. 2. c1. 0.008. 0.015. 0.20. 0.38. 3. D. -. 2.096. -. 53.24. 5. E. 0.510. 0.620. 15.75. 5. eA. b2 b ccc M C A - B S. e. eA/2. c. e. aaa M C A - B S D S. D S. NOTES. 0.014. α. A A. MAX. b. A L. MIN. A. Q. SEATING PLANE. MAX. M (b). D. BASE PLANE. MILLIMETERS. MIN. b1. SECTION A-A. D S. INCHES. (c). NOTES: 1. Index area: A notch or a pin one identification mark shall be located adjacent to pin one and shall be located within the shaded area shown. The manufacturer’s identification shall not be used as a pin one identification mark. 2. The maximum limits of lead dimensions b and c or M shall be measured at the centroid of the finished lead surfaces, when solder dip or tin plate lead finish is applied. 3. Dimensions b1 and c1 apply to lead base metal only. Dimension M applies to lead plating and finish thickness. 4. Corner leads (1, N, N/2, and N/2+1) may be configured with a partial lead paddle. For this configuration dimension b3 replaces dimension b2. 5. This dimension allows for off-center lid, meniscus, and glass overrun. 6. Dimension Q shall be measured from the seating plane to the base plane. 7. Measure dimension S1 at all four corners. 8. N is the maximum number of terminal positions. 9. Dimensioning and tolerancing per ANSI Y14.5M - 1982. 10. Controlling dimension: INCH.. 12.95. 0.100 BSC. 2.54 BSC. -. eA. 0.600 BSC. 15.24 BSC. -. eA/2. 0.300 BSC. 7.62 BSC. -. L. 0.125. 0.200. 3.18. 5.08. -. Q. 0.015. 0.070. 0.38. 1.78. 6. S1. 0.005. -. 0.13. -. 7. α. 90o. 105o. 90o. 105o. -. aaa. -. 0.015. -. 0.38. -. bbb. -. 0.030. -. 0.76. -. ccc. -. 0.010. -. 0.25. -. M. -. 0.0015. -. 0.038. 2, 3. N. 40. 40. 8 Rev. 0 4/94. All Intersil semiconductor products are manufactured, assembled and tested under ISO9000 quality systems certification. Intersil products are sold by description only. Intersil Corporation reserves the right to make changes in circuit design and/or specifications at any time without notice. Accordingly, the reader is cautioned to verify that data sheets are current before placing orders. Information furnished by Intersil is believed to be accurate and reliable. However, no responsibility is assumed by Intersil or its subsidiaries for its use; nor for any infringements of patents or other rights of third parties which may result from its use. No license is granted by implication or otherwise under any patent or patent rights of Intersil or its subsidiaries. For information regarding Intersil Corporation and its products, see web site . Sales Office Headquarters NORTH AMERICA Intersil Corporation P. O. Box 883, Mail Stop 53-204 Melbourne, FL 32902 TEL: (407) 724-7000 FAX: (407) 724-7240. EUROPE Intersil SA Mercure Center 100, Rue de la Fusee 1130 Brussels, Belgium TEL: (32) 2.724.2111 FAX: (32) 2.724.22.05. 25. ASIA Intersil (Taiwan) Ltd. Taiwan Limited 7F-6, No. 101 Fu Hsing North Road Taipei, Taiwan Republic of China TEL: (886) 2 2716 9310 FAX: (886) 2 2715 3029.

<span class='text_page_counter'>(427)</span> 82C55A Ceramic Leadless Chip Carrier Packages (CLCC) J44.A. MIL-STD-1835 CQCC1-N44 (C-5) 44 PAD CERAMIC LEADLESS CHIP CARRIER PACKAGE. 0.010 S E H S D. INCHES. D3. j x 45o. E3. B. h x 45o 0.010 S E F S A. A1 PLANE 2. MAX. MIN. MAX. NOTES. A. 0.064. 0.120. 1.63. 3.05. 6, 7. A1. 0.054. 0.088. 1.37. 2.24. -. B. 0.033. 0.039. 0.84. 0.99. 4. B1. 0.022. 0.028. 0.56. 0.71. 2, 4. B1. e L. -H-. L3. -. 0.022. 0.15. 0.56. D. 0.640. 0.662. 16.26. 16.81. -. D1. 0.500 BSC. 12.70 BSC. -. D2. 0.250 BSC. 6.35 BSC. -. D3. -. 0.662. E. 0.640. 0.662. 16.26. 16.81. 2. 16.81. -. E1. 0.500 BSC. 12.70 BSC. -. E2. 0.250 BSC. 6.35 BSC. -. E3. -. 0.662. 0.050 BSC 0.015. -. -. 16.81 1.27 BSC. 0.38. 2 -. -. 2. h. 0.040 REF. 1.02 REF. 5. j. 0.020 REF. 0.51 REF. 5. L. 0.045. 0.055. 1.14. 1.40. -. L1. 0.045. 0.055. 1.14. 1.40. -. L2. 0.075. 0.095. 1.90. 2.41. -. L3. 0.003. 0.015. 0.08. 0.38. -. ND. 11. 11. 3. NE. 11. 11. 3. N. 44. 44. -F-. 3 Rev. 0 5/18/94. NOTES:. B3. E1. E2. 1.83 REF. 0.006. e1. 0.007 M E F S H S. 0.072 REF. B3. e. PLANE 1. -E-. MIN. B2. E. MILLIMETERS. SYMBOL. 1. Metallized castellations shall be connected to plane 1 terminals and extend toward plane 2 across at least two layers of ceramic or completely across all of the ceramic layers to make electrical connection with the optional plane 2 terminals.. L2 B2. 2. Unless otherwise specified, a minimum clearance of 0.015 inch (0.38mm) shall be maintained between all metallized features (e.g., lid, castellations, terminals, thermal pads, etc.). L1. 3. Symbol “N” is the maximum number of terminals. Symbols “ND” and “NE” are the number of terminals along the sides of length “D” and “E”, respectively.. D2. e1 D1. 4. The required plane 1 terminals and optional plane 2 terminals (if used) shall be electrically connected. 5. The corner shape (square, notch, radius, etc.) may vary at the manufacturer’s option, from that shown on the drawing. 6. Chip carriers shall be constructed of a minimum of two ceramic layers. 7. Dimension “A” controls the overall package thickness. The maximum “A” dimension is package height before being solder dipped. 8. Dimensioning and tolerancing per ANSI Y14.5M-1982. 9. Controlling dimension: INCH.. 26.

<span class='text_page_counter'>(428)</span>

Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Tải bản đầy đủ ngay
×