Presentation is loading. Please wait.

Presentation is loading. Please wait.

8254 – SOFTWARE PROGRAMMABLE TIMER

Similar presentations


Presentation on theme: "8254 – SOFTWARE PROGRAMMABLE TIMER"— Presentation transcript:

1 8254 – SOFTWARE PROGRAMMABLE TIMER

2 Control Word Format

3 8253/54 Operation Modes Mode 0: Interrupt on terminal count
The output is initially low, and remain low for the duration of the count if GATE=1. When the terminal count is reached, the output will go high and remain high until a new control word or new count number is loaded If GATE becomes low at the middle of the count, the count will stop and the output will be low. The count resumes when the GATE becomes high again 􀃎 This in effect adds to the total time the output is low.

4 MODE 0: INTERRUPT ON TERMINAL COUNT

5 Modes of Operation six modes (0–5) of available to each of the 8254 counters each mode functions with the CLK input, the gate (G) control signal, and OUT signal Figure 11–35  The six modes of operation for the programmable interval timer. The G input stops the count when 0 in modes 2, 3, and 4.

6 8253/54 Operation Modes • Mode 1: HW triggered / programmable one shot
The triggering must be done through the GATE input by sending a 0-to-1 pulse to it. Steps: Load the count register A 0-to-1 pulse must be sent to the GATE input to trigger the count. After sending the 0-to-1 pulse to GATE, OUT becomes low and stays low for a duration of N*T, then becomes high and stays high until the GATE is triggered again If during the activation, a retriggered happened, then restart the down counting

7 MODE 1: HARDWARE RETRIGGERABLE ONE-SHOT

8 8253/54 Operation Modes Mode 2: Rate Generator (Divide-by-N counter)
In Mode2, if GATE=1, OUT will be high for N*T,goes low only for one clock pulse, then counter isreloaded automatically, and the process continues indefinitely. 􀃎 Whole period: (N+1) * T

9 MODE 2: RATE GENERATOR

10 8253/54 Operation Modes Mode 3: Square wave rate generator
Most commonly used

11 MODE 3: SQUARE WAVE MODe

12 8253/54 Operation Modes Mode 4: Software triggered strobe
Similar to Mode2, except that the counter is not reloaded automatically In Mode4, if GATE=1, the output will go high when loading the count, it will stay high for duration N*T. After the count reaches zero, it becomes low for one clock pulse, then goes high again and stays high until a new command word or new count is loaded To repeat the strobe, the count must be reloaded

13 MODE 4: SOFTWARE TRIGGERED STROBE

14 8253/54 Operation Modes Mode 5: Hardware triggered strobe
Similar to Mode4, except that the triggering must be done with the GATE input The count starts only when a 0-to-1 pulse is sent to the GATE input If GATE retriggered during the counting, it will restart the down counting

15 MODE 5: HARDWARE TRIGGERED STROBE (RETRIGGERABLE)

16 Single handshake I/O Double handshake I/O SENDER DATA LINES
PORT DEVICE RECEIVER STB ACK Double handshake I/O SENDER RECEIVER DATA LINES STB ACK PORT DEVICE STB# ACK#

17 8255 PPI - Programmable Peripheral Interface

18

19 Port Hardware

20

21

22

23

24

25

26 8251 UNIVERSAL SYNCHRONOUS SYNCHRONOUS RECEIVER TRANSMITTER (USART)

27 There are two types of control word.
Table 1 Operation between a CPU and 8251 Control Words There are two types of control word. 1. Mode instruction (setting of function) 2. Command (setting of operation)

28 CONTROL WORD(ASYNC. MODE)

29 CONTROL WORD(SYNC. MODE)

30 COMMAND WORD

31 STATUS WORD

32 DTE DCE INTERFACE USING 8251
MODEM MODEM TXD TERMINAL 2 TERMINAL 1 TXD DTR DTR DSR DSR TELEPHONE LINE RTS RTS CD CD CTS CTS RXD RXD

33 Typical Printer Cable Centronics male DB25P (male) 36 pins
Connects to PC Centronics male 36 pins Connects to printer

34

35

36 Port Addresses

37 Printer Interfacing

38

39 Timing waveform for printer interfacing

40 POP DS CODE SEGMENT ASSUME CS:CODE POP DI START:PUSH CS POP SI POP DS
CLI MOV AH,25H ;TO MODIFY THE CONTENT OF IVT MOV AL,00H LEA DX,TSR INT 21H STI ;SET INTURRUPT FLAG MOV AH,31H ;TO TERMINATE TSR PROGRAM TSR PROC FAR MOV AX,CODE ;BCOZ WE DECLARE MSG IN CODE SEGMENT MOV DS,AX PUSH AX PUSH BX PUSH CX PUSH DX PUSH BP PUSH SP PUSH SI PUSH DI PUSH DS LEA DX,MSG MOV AH,09H POP DS POP DI POP SI POP SP POP BP POP DX POP CX POP BX POP AX MOV AH,4CH ;TERMINATION OF ISR ONLY NOT TSR INT 21H IRET TSR ENDP MSG DB 10,13,"DIVISION ERROR$" CODE ENDS END START

41 CODE SEGMENT ASSUME CS:CODE START:MOV AL,12H MOV DL,00H DIV DL MOV AH,4CH INT 21H CODE ENDS END START


Download ppt "8254 – SOFTWARE PROGRAMMABLE TIMER"

Similar presentations


Ads by Google