EE 352

Homework Assignment 2
Due Feb. 4, 2000

  1. Connect two PCs together through their parallel ports in such a manner that one computer can send data to the other computer four bits at a time. The figure below a possible way to do this.
  2. Decide on a handshaking protocol for transferring data between the two computers. Use one bit of the control register, and the ACK bit of the status register, on each computer. The sending computer should signal the receiving computer that it has data to send, and the receiving computer should acknowledge when it has read the data. Draw a timing diagram showing a transfer from one computer to the other.
  3. Write a (non-interrupt driven) program to transmit data using this scheme. Characters typed at the keyboard of the sending computer should appear on the screen of the receiving computer. The main part of the sending program could be:
    while(1)
    {
        while (!kbhit()) ;   /* Wait for key to be pressed; */
        c = getchar();       /* Get key */
        send_data(c);        /* Send to receiving computer -- you need to 
                                write this routine */
    }
    
    The main part of the receiving program could be:
    while(1)
    {
        c = get_data(c);     /* Get data from sending computer -- you need to 
                                write this routine */
        putchar(c);          /* Write to standard output (screen) */
    }
    
    Show that you can type on the keyboard of one computer, and have the keystrokes appear on the screen of the second computer.


Bill Rison, <rison@ee.nmt.edu >