In MODE 1 PORT C (upper) works as the handshaking signals.
Not exactly. When Port A is set to input in Mode 1, PC3, PC4 and PC5 are dedicated to the Interrupt, Strobe and Input Buffer Full signals. PC6 and PC7 are available for general purpose I/O.
My confusion is what do I need to write into the control word for it?? Will it be set to output or INPUT? Or is it left alone??
When you write to the control register setting Port A to Mode 1, PC3, PC4 and PC5 are automatically set to input or output as required by their function. The direction of PC6 and PC7 is set via bit 3 of the control word.
Also does the entire PORT C works a handshaking pins in Mode 1 for both Port A and Port B ? Or only Port C (upper) works as handshaking for Port A and Port C(lower) works as the handshaking for Port B??
Port A and Port B can be individually set to either Mode 0 or Mode 1. When Port A is set to Mode 1 input it uses PC3, PC4, and PC5. When Port B is set to Mode 1 input it uses PC0, PC1 and PC2. Port C pins that are not used for handshaking become general purpose I/O.
So to say that "Port C (upper) works as handshaking for Port A and Port C(lower) works as the handshaking for Port B" is not quite right, because when Port A is set to input PC6 and PC7 are general purpose I/O. Even more confusing, when Port A is set to output it uses PC3, PC6 and PC7, and PC4 and PC5 become general purpose I/O. I guess the reason for doing it this way is so you can switch Port A from input to output while having the control signals for both directions permanently connected to dedicated pins on the 8255.