Presentation is loading. Please wait.

Presentation is loading. Please wait.

Serial Communication Lab 12 Module M21.1. Asynchronous Serial I/O ASCII code 54H = 1010100 (“T”) sent with odd parity.

Similar presentations


Presentation on theme: "Serial Communication Lab 12 Module M21.1. Asynchronous Serial I/O ASCII code 54H = 1010100 (“T”) sent with odd parity."— Presentation transcript:

1 Serial Communication Lab 12 Module M21.1

2 Asynchronous Serial I/O ASCII code 54H = 1010100 (“T”) sent with odd parity

3 Baud rate Bit time (ms) No. of stop bits Char. time (ms) Chars./sec.

4 Functional Diagram of a UART

5 Serial Port Connector

6 EXPERIMENT 39 – Communicating Between Two Computers Pin 2 Pin 3 Null Modem 1. Connect two PCs together using a null modem between the two COM1 serial ports. A null modem is a serial cable in which pins 2 and 3 are crossed. That is, the transmit pin 2 of one computer is connected to the receive pin 3 of the other computer.

7 EXPERIMENT 39 – Communicating Between Two Computers 2. You will execute the same program on both computers. Modify the program given in Listing 17.2 so that when you press function key F1 it switches to a double screen mode. In this mode whatever you type on the first computer should be displayed on the lower half of the second computer and on the upper half of the first computer (after making a round trip to the second computer). Similarly, anything typed on the second computer should be displayed on the lower half of the first computer and on the upper half of the second computer (after making a round trip to the first computer). Both halves of the screen should scroll independently when they are full.

8 EXPERIMENT 39 – Communicating Between Two Computers You need to be able to tell when a received character is one that originated at the other computer or is one that has made a round trip from your computer. To do this use the following algorithm: Send your own character with bit 7 = 0 If you receive a character with bit 7 = 0 Then display it on the bottom of the screen, make bit 7 = 1 and send it back Else display it on the top of the screen and do not send it back

9 Write this algorithm using Visual Basic

10 Follow 171Lab12_Tutorial.doc (available on the web site)

11

12

13

14 You type in here Your message gets displayed here after making a round trip to the other compter. Messages from the other computer will get displayed here.

15 CSE 171 Lab 12. Week of November 26, 2001. EXPERIMENT: Serial Communication – The CSE 171 Chat Room PRE-LAB 1. Read text Sec. 17.1, Serial I/O, pages 490-491. Read Experiment 39: Communicating between Two Computers on page 510. 2. Download the file, 171Lab12_Tutorial.doc, from the web site.

16 LAB In this lab, two groups, working on adjacent computers, will run the same Visual Basic program that will allow them to chat with each other over the serial I/O line. The Visual Basic program will run the algorithm given in Experiment 39 on page 510 in the textbook. 1. Write the Visual Basic program by going through the Tutorial given in the file 171Lab12_Tutorial.doc. 2. Run this same program on both computers at the same time. Make sure that the null modem cable is connected between the serial ports of both computers. 3. Each student in each group should type their name on a separate line in the box on the form. Copy the form (using Alt Print Screen) and paste it in a Word.doc file. 4. Chat back and forth telling the other group which of the 12 labs in this class you liked the best and which you liked the least. Copy the form (using Alt Print Screen) and paste it to the same Word.doc file used in Part 3. 5. Print out the.doc file containing your two chat screens and hand them in to your lab instructor.

17 Note: No lab report is required for this lab.


Download ppt "Serial Communication Lab 12 Module M21.1. Asynchronous Serial I/O ASCII code 54H = 1010100 (“T”) sent with odd parity."

Similar presentations


Ads by Google