1st Seminar 12 09 12 BIOS Serial Xmission

download 1st Seminar 12 09 12 BIOS Serial Xmission

of 15

Transcript of 1st Seminar 12 09 12 BIOS Serial Xmission

  • 7/30/2019 1st Seminar 12 09 12 BIOS Serial Xmission

    1/15

    27 November 2012 1

    PRESENTED BY

    MITUL MODI(ME MSA 199)

    M S UNIVERSITY, BARODA

    2012-13

    BIOS Serial Data Transmission INT Services

    and

    Serial Modem Port Control

  • 7/30/2019 1st Seminar 12 09 12 BIOS Serial Xmission

    2/15

    Data Transmission Technology

    Data transmission technologies are used to connect two devices directly.

    These technologies used to provide a physical connection that can be used to

    carry many higher level programming

    Beside a network card, PARALLEL AND SERIAL PORT provide a way to get

    data IN and OUT of microprocessor.

    Parallel Port:

    1. Transfer 8 bit data at a time.

    2. Most common use is to drive printer.

    3. LPT1, LPT2,LPT3 : Logical Designators

    4. 25 pin D Connector.

    Serial Port:

    1. Transfer one bit at a time.2. Most common is to connect Modem.

    3. COM1, COM2, COM3, COM4 : Logical Designator.

    4. 9 pin D Connector.

    27 November 2012 2

  • 7/30/2019 1st Seminar 12 09 12 BIOS Serial Xmission

    3/15

    Steps for Data Transmission:

    When program wants to send something (data) out through port it

    1. First load data in data segment register of microprocessor.

    2. Initialized serial port.

    3. Load necessary parameter in al register for serial data transmission.

    4. Use serial data transmission interrupt (INT 14h) to transmit data to port.

    Basic Interrupt Processing

    Mechanism which causes the processor to stop execution of current program and

    transfer control to ISR handler and resume current execution on completion ofISR.

    27 November 2012 3

  • 7/30/2019 1st Seminar 12 09 12 BIOS Serial Xmission

    4/15

    Step: 2 Initialization of Serial Port:

    Execution of any interrupts using BIOS INT 14h. We have to perform

    following assembly instructions.

    mov ah,CODE ; code is loaded in AH

    mov al, PARAMETER ;

    int 14h

    Code Description

    00h Serial Port Initialization

    01h Transmit Character

    02h Receiving Character

    03h Status

    Serial Port for Communication:

    27 November 2012 4

  • 7/30/2019 1st Seminar 12 09 12 BIOS Serial Xmission

    5/15

    Step:3 Necessary Parameter for Communication:

    Parameter

    Bit Description

    0 Word Size 00= 5 01 = 610 =7 11 =81

    2 Stop Bit 0 = 1 stop bit

    1 = 2 stop bit

    3 Parity 00 = None

    01 = Odd11 = Even

    4

    5 Baud Rate : 000 = 110 baud

    001 = 150 baud

    010 = 300 baud

    011 = 600 baud

    100 =1200 baud

    101 = 2400 baud

    110 = 4800 baud

    111 = 9600 baud

    6

    7

    Baud rate: a data transmission rate (bits/second) for modems.27 November 2012 5

  • 7/30/2019 1st Seminar 12 09 12 BIOS Serial Xmission

    6/15

    Port Initialization Code : (00h)

    Setting parameters for necessary communication like word size, stop bit, parity

    and baud rate etc. & load accordingly parameter to AL.

    Code (i.e. 00h) is loaded in AH register.

    INPUT OUTPUT

    AX 00h Parameter AX RS232 Status Modem Status

    DX Port No. ( 0-3) DX

    Port Transmission Code : (01h)

    Code (i.e. 01h) is loaded in AH register.

    Character is to be transmitted and loaded in AL register.

    INPUT OUTPUT

    AX 01h Character AX RS232 Status Modem Status

    DX Port No. ( 0-3) DX

    27 November 2012 6

  • 7/30/2019 1st Seminar 12 09 12 BIOS Serial Xmission

    7/15

    There are several many serial transmission standards available for use in

    microprocessor including RS232, USB.

    Advantages of Serial Bus:

    1. Signal Integrity , Less cross talk, lesser noise2. Low cost

    Disadvantages of Serial Bus:

    1. Higher clock rates require for given bandwidth.

    RS232 Interface:

    Used for asynchronous serial data transmission.

    Nominal Logic Levels : Logic 0 : +12 V Logic 1 : -12 V

    allows signals are to be transmitter over greater distance.

    specifies maximum cable length 75 feet at 9600 bps.

    Common Signals : Pin Desciption

    1. Data Carrier Detect : DCD 6. Data Set Ready : DSR2. Receive Data : RD 7. Request To Send : RTS

    3. Transmitted Data :TD 8. Clear To Set : CTS

    4. Data Terminal Ready : DTR 9. Ring Indicator : RI

    5. Signal Ground : GND

    27 November 2012 7

  • 7/30/2019 1st Seminar 12 09 12 BIOS Serial Xmission

    8/15

    DB 25 Pin Description:

    27 November 2012 8

  • 7/30/2019 1st Seminar 12 09 12 BIOS Serial Xmission

    9/15

    Modem:

    Contraction of modulation and demodulation.

    Used to send and receive serial data over telephonic line.

    Consists of three basic hardware and software components i.e. data pump, controllerand UART .

    Audio signal are also known as carrier signal.

    Basics of modems:

    RS 232 data terminal equipment (DTE) Modem, data communication

    equipment (DCE) telephonic line

    27 November 2012 9

  • 7/30/2019 1st Seminar 12 09 12 BIOS Serial Xmission

    10/15

    Steps for Data Receiving:

    When a character arrives

    1. Port places an interrupt message in interrupt request queue.

    2. Processor stops what it is doing, save the state of flags and address on stack.

    3. Transferring control to interrupt handling program.

    4. Interrupt handling program changes processor to I/O addressing mode.

    27 November 2012 10

  • 7/30/2019 1st Seminar 12 09 12 BIOS Serial Xmission

    11/1527 November 2012 11

    BIOS Serial Port Status: (AH Reg.)

    Bit - 7 Bit - 6 Bit - 5 Bit - 4 Bit - 3 Bit -2 Bit - 1 Bit

    0

    Time

    Out

    TSRE THRE Break

    Detected

    Frame

    Error

    Parity

    Error

    Overrun

    Error

    RDA

    Received DataAvailable

    Transmit Holding Reg. Empty

    Transmit Shift Reg. Empty

    Occurs if received char. w/ovalid stop bit

  • 7/30/2019 1st Seminar 12 09 12 BIOS Serial Xmission

    12/15

    BIOS Modem Port Status: (AL Reg.)

    Bit - 7 Bit - 6 Bit - 5 Bit - 4 Bit - 3 Bit -2 Bit - 1 Bit 0

    RLSD RI DSR CTS Change

    inRLSD

    Trailing

    EdgeRI

    Change

    in DSR

    Change

    in CTS

    27 November 2012 12

    Ring Indicator

    Data Set Ready

    Clear to Send

    Received Line

    Signal Detect

  • 7/30/2019 1st Seminar 12 09 12 BIOS Serial Xmission

    13/15

    Program Code for transmission of data:

    .data

    strg1 dw R, E, S, I, S, T, E, R

    .code.startup

    mov ax, @ data ;

    mov ds, ax ;

    mov ds, [0000h] ; Select Port 1

    mov cx, 08h ; Set count equal to String Length

    mov ah, 00h ; Serial port initializemov al, 0e7h ; Parameter set up

    int 14h ; BIOS Interrupt

    LOOP1: lea si, strg1 ; Load effective add. of string

    mov ah, 01h ; Code for Transmission

    mov al, [si] ;

    int 14h ;inc si ;

    loop LOOP1 ;

    .end

    Segment Initialization

    27 November 2012 13

  • 7/30/2019 1st Seminar 12 09 12 BIOS Serial Xmission

    14/15

    Program Code for receiving of data:

    .data

    strg2 dw 10 dup(?)

    .code.startup

    mov ax, @ data ;

    mov ds, ax ;

    mov ds, [0000h] ; Select Port 1

    mov ah, 00h ; Serial port initialize

    mov al, 0e7h ; Parameter set upint 14h ; BIOS Interrupt

    mov cx, 08h ; Set count equal to String Length

    LOOP1: mov ah, 02h ; Code for Receiver

    lea di, strg2 ; Load effective add. of string

    int 14h ;

    mov [di], al ;inc di ;

    loop LOOP2 ;

    .end

    Segment Initialization

    Received character copied to destinationAdd.

    27 November 2012 14

  • 7/30/2019 1st Seminar 12 09 12 BIOS Serial Xmission

    15/15

    27 November 2012 15