CHAPTER 5 PORT FUNCTIONS
User’s Manual U15109EJ3V0UD
141
(1) Function of P0 pins
Port 0 is an 8-bit I/O port for which I/O settings can be controlled in 1-bit units. I/O settings are controlled via the
port 0 mode register (PM0).
In output mode, the values set to each bit are output to port 0 (P0). When using this port in output mode, either
the valid edge of each interrupt request should be made invalid or each interrupt request should be masked
(except for NMI requests).
When using this port in input mode, the pin statuses can be read by reading P0. Also, the values of P0 (output
latch) can be read by reading P0 while in output mode.
The valid edges of NMI and INTP0 to INTP6 are specified via the rising edge specification register 0 (EGP0) and
the falling edge specification register 0 (EGN0).
When a reset is input, the settings are initialized to input mode. Also, the valid edge of each interrupt request
becomes invalid (NMI and INTP0 to INTP6 do not function immediately after reset).
(2) Noise elimination
(a) Elimination of noise from NMI and INTP0 to INTP3 pins
An on-chip noise eliminator is provided that uses analog delay to eliminate noise. Consequently, if a signal
having a constant level is input for longer than a specified time to these pins, it is detected as a valid edge.
Edge detection occurs only after the specified amount of time has elapsed.
(b) Elimination of noise from INTP4 to INTP6 and ADTRG pins
A digital noise eliminator is provided on chip.
This circuit uses digital sampling. A pin’s input level is detected using a sampling clock (f
xx
), and noise
elimination is performed for the INTP4, INTP5, and ADTRG pins if the same level is not detected three times
consecutively. The noise-elimination width can be changed for the INTP6 pin (see
7.3.8 (3) Noise
elimination of INTP6 pin
).
Cautions 1.
If the input pulse width is 2 or 3 clocks, whether it will be detected as a valid edge or
eliminated as noise is undetermined.
To ensure correct detection of a valid edge, constant-level input is required for 3 clocks
or more.
2.
If noise is occurring in synchronization with the sampling clock, it may not be
recognized as noise. In such cases, attach a filter to the input pins to eliminate the
noise.
3.
Noise elimination is not performed when these pins are used as an ordinary input port
pins.