Chapter 7I/O PortVII - 34 Ports7.3.3 Description (Port 3)■ General Port SetupEach bit can be set individually as either an input or output by the port 3 I/O control register (P3DIR). The controlflag of the P3DIR register is set to “1” for output mode, and to “0” for input mode.To read input data of a pin, set the control flag of the P3DIR register to “0” and read the value of the port 3 inputregister (P3IN).To output data to a pin, set the control flag of the P3DIR register to “1” and write data to the port 3 output register(P3OUT).Each bit can be set individually if pull-up resistor is added or not, by the port 3 pull-up control register (P3PLU).Set the control flag of the P3PLU to “1” to add pull-up resistor.■ Special Function Pin SetupP30 to P35 are used as I/O pins of timer 0 to 5 as well. Each bit can be selected individually as output mode byport 3 output mode register (P3MD). P30 to P35 output special function data when the control flag of the P3MDis “1”and are used as general ports when it is “0”.P36 to P37 are used as I/O pins of timer 8 as well. Each bit can be selected individually as output mode by port 3output mode register (P3MD). P36 to P37 output special function data when the control flag of the P3MD is“1”and are used as general ports when it is “0”.7.3.4 Description (Port 4)■ General Port SetupEach bit can be set individually as either an input or output by the port 4 I/O control register (P4DIR). The controlflag of the P4DIR register is set to “1” for output mode, and to “0” for input mode.To read input data of a pin, set the control flag of the P4DIR register to”1” and read the value of the port 4 inputregister (P4IN).To output data to a pin, set the control flag of the P4DIR register to “1” and write data to the port 4 output register(P4OUT).Each bit can be set individually if pull-up resistor is added or not, by the port 4 pull-up control register (P4PLU).Set the control flag of the P4PLU register to “1” to add pull-up resistor.■ Special Function Pin SetupP42 to P43, P46 to P47 are used as I/O pins of timer 9 and 10 as well. Each bit can be selected individually as out-put mode by the port 4 output mode register (P4MD). P42 to P43, P46 to P47 output special function data whenthe control flag of the P4MD is “1”and are used as general ports when it is “0”