You are on page 1of 5

Hardware protocol and Timing Diagram

TASK
1). Draw the timing diagram for a bus protocol that is handshaked,
nonaddressed, and transfers 8 bits of data over a 4-bit data bus.

2). List the three main transmission mediums described in the module. Give
two common applications for each.

3). Show how to extend the number of ports on a 4-port 8051 to 8 by using
extended parallel I/O. (a) Using block diagrams for the 8051 and the
extended parallel I/O device, draw and label all interconnections and I/O
ports. Clearly indicate the names and widths of all connections. (b) Give C
code for a function that could be used to write to the extended ports.

SOLUTIONS

1).

2).

Parallel communication involves the simultaneous transfer of data words


between two devices. It is usually only used between devices on the same
IC or circuit board. Common parallel protocol applications are the PCI bus
and the ARM bus.

Serial communication uses a single wire capable of sending only one bit of
data at a time. I2C actually has two wires with one wire used for control
purposes. Another common serial protocol is the Universal Serial Bus, or
USB.

Wireless communication typically uses infrared or radio frequencies to


transfer data between two devices without a physical connection. A
protocol that uses infrared is the IrDA protocol. Bluetooth is a new protocol
based on radio frequencies.

3).

(a) Using block diagrams for the 8051 and the extended parallel I/O device, draw
and label all interconnections and I/O ports. Clearly indicate the names and
widths of all connections
(b) Give C code for a function that could be used to write to the extended ports.

Ext_Port( unsigned char data, int EP, int rd_wr ) {

unsigned char mask;

P3 = data;

if( rd_wr == 0 ) // sets enable to 1 and rd/wr to 0 or 1

mask = 0x80; // write (sets P2^6 = 0)

else

mask = 0xC0; // read (sets P2^6 = 1)

switch( EP ) { // sets coreect Ext_Port to be enabled


case 0:

P2 = mask | 0x01;

break;

case 1:

P2 = mask | 0x02;

break;

case 2:

P2 = mask | 0x04;

break;

case 3:

P2 = mask | 0x08;

break;

case 4:

P2 = mask | 0x10;

break;

case 5:

P2 = mask | 0x20;

break;

case 6:

P2 = mask | 0x40;
break;

default:

// disable if incorrect EP given

P2 = mask & 0x00;

break;

You might also like