Write the software for the transmitting computer 1 the


The objective of this exercise is to develop a message-passing facility that spans across two computers (Figure 14.24). A fully interlocked synchronization method will be implemented. The message is a simple 8-bit byte that is passed from the output port of Computer 1 to the input port of Computer 2. The following hardware connections are fixed. You may assume both computers initialize together, where Computer 1 initializes its PT7 to 0 and Computer 2 initializes its PT6 to 0.
Figure 14.24

When Computer 1 wishes to transmit to Computer 2, it puts the data first on its Port H outputs. Next, Computer 1 makes a rising edge on PT7, signifying that new data are available. Computer 1 will then wait for a rising edge on PT6, signifying that the data have been accepted. Next, Computer 1 makes its PT7 low. Last, it waits for a low signal on its PT6 input line.

a) Write the software for the transmitting Computer 1. The transmission will occur in the background using input capture interrupts. You may use a FIFO queue without writing the three routines: InitFifo, PutFifo,and GetFifo.You may ignore FIFO full errors. There are three routines you will write.

1. void Ritual(void) that clears the FIFO, makes the PT7 output low, and arms/enables the input capture interrupts as appropriate;

2. void PutMsg(unsigned char data) function that is called by the main program (that you do not write); if a current message is in progress, then these data are entered in the FIFO; if there is no current message in progress, then one is started with the new data;

3. void IC6Handler(void) interrupt handler called by the input capture on PT6.

When Computer 2 wishes to receive from Computer 1, it first waits for a rising edge on its PT7 input. Then it gets the data from its Port H inputs. Next, Computer 2 makes a rising edge on its PT6 output, signifying that the data has been accepted. Computer 2 will then wait for a falling edge on its PT7 input. Last, it makes a low signal on its PT6 line
b) Write the software for the receiving Computer 2. The reception will occur in the background using input capture interrupts. You may use a FIFO queue without writing the three routines: InitFifo, PutFifo, and GetFifo. You may ignore FIFO-full errors. There are three routines you will write.

1. void Ritual(void) that clears the FIFO, makes the PT6 output low, and arms/enables the input capture interrupts as appropriate;

2. unsigned char data GetMsg(void) function that is called by the main program (that you do not write); if the FIFO is empty, then this routine will call the get() routine over and over until data are available;

3. void IC7Handler(void) interrupt handler called by the input capture on PT7.

Request for Solution File

Ask an Expert for Answer!!
Mechanical Engineering: Write the software for the transmitting computer 1 the
Reference No:- TGS01467978

Expected delivery within 24 Hours