MB95710M Series
MB95770M Series
Document Number: 002-09307 Rev. *D
Page 55 of 172
18.1.4 Port 0 operations
• Operation as an output port
• A pin becomes an output port if the bit in the DDR0 register corresponding to that pin is set to “1”.
• For a pin shared with other peripheral functions, disable the output of such peripheral functions.
• When a pin is used as an output port, it outputs the value of the PDR0 register to external pins.
• If data is written to the PDR0 register, the value is stored in the output latch and is output to the pin set as an output
port as it is.
• Reading the PDR0 register returns the PDR0 register value.
• To use a pin shared with the LCDC as an output port, set a corresponding function select bit in the LCDC enable
register 6 (LCDCE6:SEG[31:30]) or in the LCDC enable register 7 (LCDCE7:SEG[36:32]) to “0” to select the gen-
eral-purpose I/O port function, and then set the port input control bit in the LCDC enable register 1 (LC-
DCE1:PICTL) to “1”.
• Operation as an input port
• A pin becomes an input port if the bit in the DDR0 register corresponding to that pin is set to “0”.
• For a pin shared with other peripheral functions, disable the output of such peripheral functions.
• When using an analog input shared pin as an input port, set the corresponding bit in the A/D input disable register
(lower) (AIDRL) to “1”.
• If data is written to the PDR0 register, the value is stored in the output latch but is not output to the pin set as an
input port.
• Reading the PDR0 register returns the pin value. However, if the read-modify-write (RMW) type of instruction is
used to read the PDR0 register, the PDR0 register value is returned.
• To use a pin shared with the LCDC as an input port, set a corresponding function select bit in the LCDC enable
register 6 (LCDCE6:SEG[31:30]) or in the LCDC enable register 7 (LCDCE7:SEG[36:32]) to “0” to select the gen-
eral-purpose I/O port function, and then set the PICTL bit in the LCDCE1 register to “1”.
• Operation as a peripheral function output pin
• A pin becomes a peripheral function output pin if the peripheral output function is enabled by setting the output
enable bit of a peripheral function corresponding to that pin.
• The pin value can be read from the PDR0 register even if the peripheral function output is enabled. Therefore, the
output value of a peripheral function can be read by the read operation on the PDR0 register. However, if the read-
modify-write (RMW) type of instruction is used to read the PDR0 register, the PDR0 register value is returned.
• Operation as a peripheral function input pin
• To set a pin as an input port, set the bit in the DDR0 register corresponding to the input pin of a peripheral function
to “0”.
• When using the analog input shared pin as another peripheral function input pin, configure it as an input port, which
is the same as the operation as an input port.
• Reading the PDR0 register returns the pin value, regardless of whether the peripheral function uses that pin as its
input pin. However, if the read-modify-write (RMW) type of instruction is used to read the PDR0 register, the PDR0
register value is returned.
• Operation as an LCDC segment output pin
• Set the bit in the DDR0 register corresponding to an LCDC segment output pin to “0”.
• To use a pin shared with a general-purpose I/O port as an LCDC segment output pin, set a corresponding function
select bit in the LCDC enable register 6 (LCDCE6:SEG[31:30]) or in the LCDC enable register 7 (LC-
DCE7:SEG[36:32]) to “1” to select the LCDC segment output function, and then set the PICTL bit in the LCDCE1
register to “1”.
• Operation at reset
If the CPU is reset, all bits in the DDR0 register are initialized to “0” and port input is enabled. As for a pin shared with
analog input, its port input is disabled because the AIDRL register is initialized to “0”.