Serial IO.

Slides:



Advertisements
Similar presentations
Serial Interface Dr. Esam Al_Qaralleh CE Department
Advertisements

INPUT-OUTPUT ORGANIZATION
Chapter 2 (cont.) An Introduction to the 80x86 Microprocessor Family Objectives: The different addressing modes and instruction types available The usefulness.
8086 [2] Ahad. Internal! External? 8086 vs _bit Data Bus 20_bit Address 8_bit Data Bus 20_bit Address Only external bus of 8088 is.
Dr A Sahu Dept of Comp Sc & Engg. IIT Guwahati. Very Easy – Question 1 Easy – Question 2 OK, If u have read the book/slide – Question 4 – Question 5 A.
Parul Polytechnic Institute
11-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL I/O System Design.
Khaled A. Al-Utaibi 8086 Bus Design Khaled A. Al-Utaibi
MICROPROCESSORS TWO TYPES OF MODELS ARE USED :  PROGRAMMER’S MODEL :- THIS MODEL SHOWS FEATURES, SUCH AS INTERNAL REGISTERS, ADDRESS,DATA & CONTROL BUSES.
8086.  The 8086 is Intel’s first 16-bit microprocessor  The 8086 can run at different clock speeds  Standard 8086 – 5 MHz  –10 MHz 
Chapter 2 Number conversion (BCD) 8086 microprocessor Internal registers Making of Memory address.
The 8085 Microprocessor Architecture
Microprocessor and Microcontroller
Processor System Architecture
Serial I/O - Programmable Communication Interface
Hierarchy of I/O Control Devices
4-1 ECE 424 Design of Microprocessor-Based Systems Haibo Wang ECE Department Southern Illinois University Carbondale, IL Hardware Detail of Intel.
Gursharan Singh Tatla Block Diagram of Intel 8086 Gursharan Singh Tatla 19-Apr-17.
INPUT-OUTPUT ORGANIZATION
Microcomputer & Interfacing Lecture 2
Khaled A. Al-Utaibi  8086 Pinout & Pin Functions  Minimum & Maximum Mode Operations  Microcomputer System Design  Minimum Mode.
MODES OF Details of Pins Pin 1 –Connected Ground Pins 2-16 –acts as both input/output. Outputs address at the first part of the cycle and outputs.
به نام یکتای هستی بخش درس ریزپردازنده یک گروه دکتر ثنایی جلسه اول.
MICROPROCESSORS AND APPLICATIONS
Universal Synchronous/Asynchronous Receiver/Transmitter (USART)
Serial Communications
8086/8088 Hardware Specifications Power supply:  +5V with tolerance of ±10%;  360mA. Input characteristics:  Logic 0 – 0.8V maximum, ±10μA maximum;
 8251A is a USART (Universal Synchronous Asynchronous Receiver Transmitter) for serial data communication.  Programmable peripheral designed for synchronous.
MODES OF Details of Pins Pin 1GND –Connected Ground Pins 2-16 AD14-AD0–acts as both input/output. Outputs address at the first part of the cycle.
Introduction First 32 bit Processor in Intel Architecture. Full 32 bit processor family Sixth member of 8086 Family SX.
Microprocessor. Interrupts The processor has 5 interrupts. CALL instruction (3 byte instruction). The processor calls the subroutine, address of which.
8085. Microcomputer Major components of the computer - the processor, the control unit, one or more memory ICs, one or more I/O ICs, and the clock Major.
Microprocessor Microprocessor (cont..) It is a 16 bit μp has a 20 bit address bus can access upto 220 memory locations ( 1 MB). It can support.
80386DX functional Block Diagram PIN Description Register set Flags Physical address space Data types.
EFLAG Register of The The only new flag bit is the AC alignment check, used to indicate that the microprocessor has accessed a word at an odd.
Introduction to Microprocessors - chapter3 1 Chapter 3 The 8085 Microprocessor Architecture.
Block diagram of 8086.
Interfacing Data Converters. D/A converters Design an O/P port with the address FFh to interface the 1408 D/A converter that is calibrated for 0 to 10V.
بسم الله الرحمن الرحيم MEMORY AND I/O.
The 8085 Microprocessor Architecture. What 8085 meant for? 80 - year of invention bit processor 5 - uses +5V for power.
MODULE 5 INTEL TODAY WE ARE GOING TO DISCUSS ABOUT, FEATURES OF 8086 LOGICAL PIN DIAGRAM INTERNAL ARCHITECTURE REGISTERS AND FLAGS OPERATING MODES.
8085 Microprocessor: Architecture & Support Components.
Multiplex of Data and Address Lines in 8088 Address lines A0-A7 and Data lines D0-D7 are multiplexed in These lines are labelled as AD0-AD7. –By.
8251 USART.
DEPARTMENT OF ELECTRONICS ENGINEERING
8 085Microprocessor Temp Reg (8) Accumulator (A reg) Flag flip flops(8) Instruction Register (8) Arithmetic Logic Unit ALU Instruction Decoder and Machine.
Architecture of 8085 Nitin Mishra. Registers Microprocessor Instruction Cache Arithmetic & Logic Unit Control Unit Bus Interface Unit Data Cache Instruction.
EEE /INSTR/CS F241 ES C263 Microprocessor Programming and Interfacing
Serial mode of data transfer
Diagram of microprocessor interface with IO devices
Introduction to the processor and its pin configuration
I/O Memory Interface Topics:
COURSE OUTCOMES OF Microprocessor and programming
8254 – SOFTWARE PROGRAMMABLE TIMER
8086 MICROPROCESSOR ARCHITECTURE & SEGMENTATION
8086 Microprocessor.
Serial I/O and Data Communication.
SERIAL PORT PROGRAMMING
1 Input-Output Organization Computer Organization Computer Architectures Lab Peripheral Devices Input-Output Interface Asynchronous Data Transfer Modes.
Basic Microprocessor Architecture
8086/8088 Hardware Specifications
8085 microprocessor.
An Introduction to Microprocessor Architecture using intel 8085 as a classic processor
Serial Communication Interface: Using 8251
Architecture & Support Components
X1 & X2 These are also called Crystal Input Pins.
Serial Communications
The 8085 Microprocessor Architecture
CHAPTER SERIAL PORT PROGRAMMING. Basics of Serial Communication Computers transfer data in two ways: ◦ Parallel  Often 8 or more lines (wire.
Serial Communications
Presentation transcript:

Serial IO

Basic concepts in serial IO Interface requirements Address decoding, control signal generation Alphanumeric codes ASCII, EBCDIC or any other coding Transmission format Synch or asynch, simplex/duplex, rate of transmission Error checks Parity, checksum, CRC Data comm over telephone Voice:300Hz-3300Hz,Modem,fsk/psk/qpsk etc Serial Peripheral MPU Tr Rcv IOW IOR Checksum: used in block data transfer, adds all the bytes in the blk without carry, then 2’s complement of the sum and transmitted with the data as the last byte. Receiver adds all the bytes, including the last byte; thus result sud be zero if no error in the block. CRC: used when data transfer from/to a disk. A stream of data can b represented as a polynomial that is divided by a constant polynomial, the reminder is unique to the set of bits, is generated. This reminder is sent with the data blocks.

Syn and asycn transmission a) Synch format b) asynch format

Serial bit format Baud: number of signal changes per second; bits/second. At 1200 baud; ASCII character I (49H) is presented 11 bits includes 1 start, 8 data and 2 stop bits D7 can be used as parity.

Data comm over telephone

Serial I/O standards Commonly used to interface terminal, printer or modem. Standard is a common specification that all the manufacturer have agreed upon. Assigment of pin position for signal, voltage levels, speed, length of cables and mechanical specs. Current loop 20mA or 60mA, signals relatively noise free and suitable over a long distance. voltage level RS 232C, most commonly used method DTE, DCE

RS 232C Speed 20Kbaud. Distance 50 ft. Logic zero: +3v to +15V Logic one: -3v to -15V Other signals are TTL. 25 pins

Minimum interface with RS232C Usually printer is a DTE Modem is a DCE

Other standard Specs RS232C RS422A RS423A Speed 20kbd 10Mbd 100kbd Distance 50ft 4000ft Logic 0 3 to 15 B>A 4 to 6V Logic 1 -3 to -15 B<A -4 to -6 Rcvr input volt ±15V ±7 ±12

Software controlled Asycn serial I/O Output start bit Convert chara into serial stream with appr delay. Add parity Output stop bits.

rcv transmit o/p bit using D0 N return return Rd o/p port Init bit cntr Snd strt bit N Strt bit? Y Wait ½ bit time Wait bit time N Bit still low? Get chr into A Y Set bit cntr Clr data rgstr o/p bit using D0 Wait bit time Wait bit time Rd i/p Save bit Rotate nxt bit to D0. Dcr bit cntr Redy to rcv nxt bit Dcr bit cntr N Last bit? N Last bit? Y Add parity Snd stop bits Chk parity Wait for stop bits return return

RIM ; reads a bit and put into D7 8085 serial I/O lines SOD (serial output data) SID (serial input data) SOD SDE X D7 D6 D5 D4 D3 D2 D1 D0 1=enable 0=disable For interrupts MVI A, 80H ; Set D7 =1 RAR ; set D6 = 1, bring carry into D7 SIM ; output D7 D7 D6 D5 D4 D3 D2 D1 D0 SID RIM ; reads a bit and put into D7 Serial i/p data For interrupts

Data trans using SOD Send ascii char stored in B register. SODATA: MVI C, OBH ;setup counter C to 11 bits XRA A ; reset carry to 0 NXTBIT: MVI A, 80H ; set D7 to 1 of accumltr RAR ; Bring D7 into D6 SIM ; output D7; start bit CALL BITTIM ; wait for 1 bit time STC ; set carry =1 MOV A,B ; place ASCII chr into ACC RAR ; place ascii D0 in the carry, and 1 in D7 MOV B,A ;save ACC to B DCR C ;one bit transmitted JNZ NXTBIT ; if not all bits transmitted, go back RET

(B) = 47H 0 1 0 0 0 1 1 1 CY D7 D6 D5 D4 D3 D2 D1 D0 XRA A 0 0 0 0 0 0 0 0 0 MVI A, 80H 0 1 0 0 0 0 0 0 0 RAR 0 0 1 0 0 0 0 0 0 SIM outputs 0 as stop bit STC 1 0 1 0 0 0 0 0 0 MOV A,B 1 0 1 0 0 0 1 1 1 RAR 1 1 0 1 0 0 0 1 1 MOV B,A B= 1 0 1 0 0 0 1 1 DCR C C= 0 0 0 0 1 0 1 1 JNZ NXTBIT 1 1 0 0 0 0 0 0 0 RAR 0 1 1 0 0 0 0 0 0 . When ascii D7 is sent out, register B will have all 1s from D0 to D7. In the last two iterations logic 1s are sent out as stop bits.

Data reception using SID SIDATA: RIM ; read input bit RAL ; plc D7 into CY JC SIDATA ; if D7 = 1, not a start bit, go bck and read again CALL HALFBIT ; if D7=0. strt bit. wait hafl bit time MVI C, 09 ; bit cont = 9 NXTBIT: CALL BITTIME ; wait for one bit time RIM ; read input bit RAL ; save the bit D7 to CY DCR C ; one bit read JZ RETURN ; if all bits are read return to main prog MOV A,B ; plc the bits saved so far into acc from B RAR ;plc bit saved in CY to D7 and sft all bits by 1 position MOV B,A ; save bits in B JMP NXTBIT ; get nxt bit

HW controlled serial I/O SW control has following requirements: An input port and an output port are req for interfacing. In transmission, MPU converts parallel data into serial bits. In reception, MPU converts bits from serial to parallel. Trans and rec must match the time delay. In HW control has serial IO, all these features are incorporated in one chip, like 8251A (USART).

8251A Chip select Control/Data Write Read Reset Clock Control register 16 bit, mode instr, command instr Status register It has the same add as the control register Data buffer bidirectional When CS is low the USART is selected. At high control/status register is addressed. At low data buffer is addressed Connected to system clk. This does not contrl tr/rcv rate. Nedd to communication with microprocessor.

Control logic and registers Control regstr 16 bit: 2 independent bytes 1st byte: mode instr 2nd byte command inst Status rgstr Chks the rdy ststs of peripheral Accessed when C/D’ is high Same port add as control regstr Data buffer Bi directional At C/D’ is low CS’ C/D’ RD’ WR’ Function 1 MPU writes in the control register MPU reads status register MPU outputs data to data buffer MPU reads data from data buffer X USART is not selected

Blk diagram of Trn and Rcv section Transmitter section TxD: serial bits are tran on this line. TxC: controls bit trans rate. Clk freq can be 1,16,64 times the baud. TxRDY: o/p signal,high indicates the trans buffer is empty and USRT ready to accept a byte. Signal is reset when data is loaded in the buffer. TxE: o/p signal High indicates that the O/P register is empty. Reset when a byte is trnasferd frm buffer to o/p rgstr.

Receiver section RxD: bits are rcvd serially on this line RxC: controls the rate at which bits are rcvd by USART. In asych mode, it can be 1, 16 or 64 times the baud. RxRDY: it goes high when USART has a char on the input buffer register and ready to transfer it to MPU. Can be used either to indicate the status or to interrupt MPU.

Initializing 8251A Mode, baud, stop bits, parity, etc. Control word: a) mode word b) command word After a reset operation, a mode word must be written in the control register followed by a command word. Command word can be changed at any time during operation, but mode can only be changed only after a reset operation. It can be reset using internal reset bit (D6) in the command word.

Interfacing RS232 terminal using 8251A TxC is 153.6 kHz. Asycn mode with 9600 baud Character length = 7 bits, two stop bits No parity check. Port add Data register: FEh Control/status register: FFh

Command word (asynch mode): Mode word: D7 D6 D5 D4 D3 D2 D1 D0 1 =CAh Baud= TxC/16=153.6k/16 = 9600 No parity Stop bits 7 bits chr Command word (asynch mode): D7 D6 D5 D4 D3 D2 D1 D0 X X 1 X =11h X 1 Prvnts Intrnal reset Err Rst Rcv Disbl Tr Enbl Status word: D7 D6 D5 D4 D3 D2 D1 D0 X X X X X X X 1 =01h Tr rdy

Initialization intruction: SETUP: MVI A, CAh ; load mode word OUT FFh ; write mode word to control rgstr MVI A, 11h ; load command word OUT FFh ; enable trnsmitter STATUS: IN FFh ; read stats word ANI 01h ; mask all bits except D0 JZ STATUS ; if D0 = 0, Tr buffer is full, go back and wait

8086/8088 Architecture Seven categories of signals. Max/min mode: min mode is used for single procss. Max mode is used for multiprocss Test: synchronize multiple processors Data Enable: generally connected to biriectional buffer to isolate MPU from system bus. Data tran/rcvr: controls data flow. IO or memory: indicates whether the proc cycle is memory operation or IO operation. Bus High Enable: enble the higher order byte of 16 bit data Power & clock VCC CLK BHE/S7 A19/S6 A16/S3 AD15 AD0 ALE M/IO RD WR DEN DT/R MuX add & status signals GND INTR NMI HOLD READY RESET External rqst Mux add and data buses Response to External rqst INTA HOLDA Control & status signals Multipro envrnmnt TEST MN/MX

Max/min mode control signals Pin Min mode Max mode 24 INTA QS1: queue status signal 25 ALE QS0: queue stat signal 26 DEN S0: input sig to bus control 27 DT/R S1: “ 28 M/IO S2: “ 29 WR Lock: to prvnt another proc from gaining control 30 HLDA RQ/GT1: enable another processor to gain control 31 HOLD RQ/GT0: “

Programming model AX BX CX DX SP BP SI DI CS DS SS ES IP

80286 16 bit Eliminates the multiplexing of buses. Has 24 bit linear address bus support 16M bytes address directly. Supports memory management through which it can support 1Gbytes of virtual memory. Protects system software from user programs, protects users’ program, and restricts access to some memory regions. Supports multiuser systems.

80386/486 32 bit processor. Support following multiuser system requirement High speed of execution Ability to handle different types of tasks efficiently Large memory space that can be shared by multiuser Appropriate memory allocations and the management of memory access Data security and data access Limited and selected access to part of the system Resource sharing and management

32bit non-multiplexed address bus Can address 4G physical memory and through a memory management unit 64 (246) terabytes of virtual memory. Two modes:real mode, and protected mode. Execution is highly pipelined.

Functional signal groups

Programming model 8-general purpose registers can be accessed as 8, 16 or 32 bit 6-segment selector registers. IP can used as 16/32 bits Flag is 31 bits but 14 are used at present. 6 for data, 3 operation,2 io previl, 1 nested task, 2 for VM 31 15 7 AX BX CX DX SP BP SI DI CS SS DS ES FS GS IP FLAGS