Lecture 17.

Slides:



Advertisements
Similar presentations
1 Homework Reading (linked from my web page) –S and S Extracts –National Semiconductor UART Data Sheet Machine Projects –mp2 due at start of class 12 Labs.
Advertisements

Flow Diagram: Push flags, CS, IP Pop IP,CS,flags Push AX,BX,CX,DX,ES,DS,SI,DI,BP POP BP,DI,SI,DS,ES,DX,CX,BX,AX.
BY Kamran Yousaf Application of Computer Graphics and Animation Using C++ Language.
ECE 371- Unit 11 Introduction to Serial I/O. TWO MAJOR CLASSES OF SERIAL DATA INTERFACES ASYNCHRONOUS SERIAL I/O - USES “FRAMING BITS” (START BIT AND.
Lecture 13: TI MSP430 Watchdog Timer and Real-Time Clock
Lecture 9. - Synchronous Devices require a timing signal. Clock generated Interval Timer Microprocessor Interval Timer Clk PCLK = MHz PCLK (for.
Software Interrupt Instruction ‘int’ A ‘int’ instruction is like a special kind of subroutine call. Will discuss details later ‘int’ stands for INTERRUPT.
10H Interrupt. Option 0H – Sets video mode. Registers used: – AH = 0H – AL = Video Mode. 3H - CGA Color text of 80X25 7H - Monochrome text of 80X25 Ex:
Real Time Interrupts Section Real-Time Interrupt (RTI) Most operating systems (OS) require an interrupt every T seconds by the RTI RTI interrupts.
ΜComputer Structure μProcessor Memory Bus System I/O Ports.
Lecture 15. Modem Controller Register 4310 DTR 0 = Polling Operator 1 = Interrupts Enabled RTS 1 =Self Test 0 =Normal.
Lecture # 14. RS – 232C Standard Standard for physical dimensions of the connectors. PC (DTE) Modem RS – 232C Cable Connected via serial port (DCE)
I2C Protocol and RTC Interfacing
CS-401 Computer Architecture & Assembly Language Programming
Programming the I/O Hardware
Lecture # 13.
Homework Reading (linked from my web page) Machine Projects Labs
8254 – SOFTWARE PROGRAMMABLE TIMER
8086 Microprocessor.
Days of the week NEXT.
I2C Protocol and RTC Interfacing
Days of the Week Les docs d’Estelle –
Symbolic Instruction and Addressing
UART Serial Port Programming
Programming the I/O Hardware
DAYS OF THE WEEK.
Time management School of Rock.
COMS 161 Introduction to Computing
Sunday Monday Tuesday Wednesday Sunday Monday Tuesday Wednesday
8086 Registers Module M14.2 Sections 9.2, 10.1.
Lecture 10.
Morgan Kaufmann Publishers Computer Organization and Assembly Language
Symbolic Instruction and Addressing
Lecture 16.
NS Training Hardware.
Timer Source: under
Symbolic Instruction and Addressing
Lecture 19.
MY FUNDAY.
Lecture # 11.
Interrupt Source: under
Unit:08 Software Interrupts
FIZZ FREE FEBRUARY 2019 Your name: Your school:
Days of the Week Monday Tuesday Wednesday Friday Thursday Saturday
CHAPTER SERIAL PORT PROGRAMMING. Basics of Serial Communication Computers transfer data in two ways: ◦ Parallel  Often 8 or more lines (wire.
______________________________________
Created by: Ramona Lewis-Dailey
Henry Lomb Parent Calendar
Extended Christmas Hours Thursday December 8th 9am -6:30pm Friday December 9th 9am -6:30pm Saturday December 10th 9am-6pm Thursday December.
WHEN IS YOUR BIRTHDAY? IT’S ON THE 5TH (FIFTH) OF MAY.
Chapter 6 –Symbolic Instruction and Addressing
Henry Lomb School 20 Parent Calendar Open House/ Town Meeting
School 20 Parent Calendar
WELCOME.
Time 1.
Jump & Loop instructions
Contact
October B Day Fall Break Fall Break SUNDAY MONDAY TUESDAY
#teacher5aday Stress Awareness Month
Created by: Ramona Lewis-Dailey
NOVEMBER READING LOG Student: When you have read, record your minutes and have your parent initial the proper box (each day). At the end of the month,
Source: Serial Port Source:
Do you have the time to review?
DECEMBER READING LOG Student: When you have read, record your minutes and have your parent initial the proper box (each day). At the end of the month,
2011年 5月 2011年 6月 2011年 7月 2011年 8月 Sunday Monday Tuesday Wednesday
WHEN IS YOUR BIRTHDAY? IT’S ON THE 5TH (FIFTH) OF MAY.
Lecture 24.

Open Bowling Times 9:30 pm – 12 Midnight Moonrock
Part VI Looping Structures
Presentation transcript:

Lecture 17

#include <dos. h> #include <bios #include <dos.h> #include <bios.h> char ch1,ch2; void initialize (unsigned int com) { outportb ( com+3, inport (com+3) | 0x80); outportb ( com,0x80); outportb( com +1, 0x01); outportb ( com+3, 0x1b); }

void main ( ) {. initialize(0x3f8);. while (1). { void main ( ) { initialize(0x3f8); while (1) { if ( ((inport(0x3fd)&0x20)==0x20) && (kbhit())) { ch1=getche(); outport(0x3f8,ch1); } if (( (inport(0x3fd)&0x01)==1)) { ch2= inport(0x3f8); putch(ch2); } if (( ch1==27) || (ch2==27)) break; } }

NULL Modem (Revisited) CD 1 RxD 2 TxD 3 DTR 4 GND 5 DSR 6 RTS 7 CTS 8 RI 9 CD 1 RxD 2 TxD 3 DTR 4 GND 5 DSR 6 RTS 7 CTS 8 RI 9

NULL Modem (Revisited) CD 1 RxD 2 TxD 3 DTR 4 GND 5 DSR 6 RTS 7 CTS 8 RI 9 CD 1 RxD 2 TxD 3 DTR 4 GND 5 DSR 6 RTS 7 CTS 8 RI 9

Software Oriented Flow Control Makes use of Two Control characters. XON (^S) XOFF (^T)

while (1) {. receivedchar = readchar (com);. if (receivedchar == XON) while (1) { receivedchar = readchar (com); if (receivedchar == XON) { ReadStatus = TRUE; continue; } if (receivedchar == XOFF) { ReadStatus = FALSE; continue; } if (ReadStatus == TRUE) Buf [i++] = receivedchar; }

Time Updation Through INT8 Real Time Clock Device Battery powered device Updates time even if PC is shutdown RTC has 64 byte battery powered RAM INT 1AH used to get/set time.

Clock Counter 1AH/00 (hours*60*60 + min*60 + sec) * 18.2065 ON ENTRY AH = 00 ON EXIT AL = Midnight flag CX = Clock count (Hi word) DX = Clock count (Low word) 1573040 Times Increment 1573040/18.2065 = 86399.9121 sec Whereas 86400 sec represent 24 hrs.

AL = 1 if Midnight passed AL = 0 if Midnight not passed Set Clock Counter 1AH/01 ON ENTRY AH = 01 CX = Clock count (Hi word) DX = Clock count (Low word)

Read Time 1AH/02 ON ENTRY AH = 02 ON EXIT CH = Hours (BCD) CL = Minutes (BCD) DH = Seconds (BCD)

Set Time 1AH/03 ON ENTRY AH = 03 CH = Hours (BCD) CL = Minutes (BCD) DH = Seconds (BCD) DL = Day Light saving = 1 Standard Time = 0

Read Date 1AH/04 ON ENTRY AH = 04 ON EXIT CH = Century (BCD) CL = Year (BCD) DH = Month (BCD) DL = Day (BCD)

Set Date 1AH/05 ON ENTRY AH = 05 CH = Century (BCD) CL = Year (BCD) DH = Month (BCD) DL = Day (BCD)

Set Alarm 1AH/06 ON ENTRY AH = 06 CH = Hours (BCD) CL = Minutes (BCD) DH = Seconds (BCD)

Disable Alarm 1AH/07 ON ENTRY AH = 07

Read Alarm 1AH/09 ON ENTRY AH = 09 ON EXIT CH = Hours (BCD) CL = Minutes (BCD) DH = Seconds (BCD) DL = Alarm Status (00 = Not Enable 01 = Enable)

Real Time Clock Control Circuitry Clock and Logic circuitry 64 Bytes Battery Powered Low power CMOS RAM 70H Control Circuitry 71H :::::::::::::::::::::::::::::::::::: INT 7FH

Internal Ports 70 – 7FH (16 ports) Only 70 & 71H are important from programming point of view

64 Byte Battery Powered RAM 00H = Current Second 01H = Alarm Second 02H = Current Minute 03H = Alarm Minute 04H = Current Hour 05H = Alarm Hour 06H = Day Of the Week 07H = Number Of Day

64 Byte Battery Powered RAM 08H = Month 09H = Year 0AH = Clock Status Register A 0BH = Clock Status Register B 0CH = Clock Status Register C 0DH = Clock Status Register D 32H = Century

Week Day 01H = Sunday 02H = Monday 03H = Tuesday 04H = Wednesday 05H = Thursday 06H = Friday 07H = Saturday

Year No of Century and Year are in BCD.

Accessing the Battery Powered RAM Battery Powered RAM is accessed in two steps Specify the Byte no. in 70H port. Read/write port 71H to get/set the value of specified byte.

Accessing the Battery Powered RAM outport (0x70, 0); outport (0x70, 4); sec = inport (0x71); outport (0x71,hrs);

Status Register A 7 6 5 4 3 2 1 0 Interrupt frequency Time frequency 7 6 5 4 3 2 1 0 Interrupt frequency Time frequency 0 = Time is not updated 1 = Time is updated