Philips Semiconductors Product data
P87LPC767
Low power, low price, low pin count (20 pin)
microcontroller with 4-kbyte OTP and 8-bit A/D converter
2002 Mar 25
22
Open Drain Output
Configuration
The open drain output configuration turns off all pull-ups and only
drives the pull-down transistor of the port driver when the port latch
contains a logic 0. To be used as a logic output, a port configured in
this manner must have an external pull-up, typically a resistor tied to
V
DD
. The pull-down for this mode is the same as for the
quasi-bidirectional mode.
The open drain port configuration is shown in Figure 13.
Push-Pull Output
Configuration
The push-pull output configuration has the same pull-down structure
as both the open drain and the quasi-bidirectional output modes, but
provides a continuous strong pull-up when the port latch contains a
logic 1. The push-pull mode may be used when more source current
is needed from a port output.
The push-pull port configuration is shown in Figure 14.
The three port pins that cannot be configured are P1.2, P1.3, and
P1.5. The port pins P1.2 and P1.3 are permanently configured as
open drain outputs. They may be used as inputs by writing ones to
their respective port latches. P1.5 may be used as a Schmitt trigger
input if the P87LPC767 has been configured for an internal reset
and is not using the external reset input function RST.
Additionally, port pins P2.0 and P2.1 are disabled for both input and
output if one of the crystal oscillator options is chosen. Those
options are described in the Oscillator section.
The value of port pins at reset is determined by the PRHI bit in the
UCFG1 register. Ports may be configured to reset high or low as
needed for the application. When port pins are driven high at reset,
they are in quasi-bidirectional mode and therefore do not source
large amounts of current.
Every output on the P87LPC767 may potentially be used as a 20
mA sink LED drive output. However, there is a maximum total output
current for all ports which must not be exceeded.
All ports pins of the P87LPC767 have slew rate controlled outputs.
This is to limit noise generated by quickly switching output signals.
The slew rate is factory set to approximately 10 ns rise and fall times.
The bits in the P2M1 register that are not used to control
configuration of P2.1 and P2.0 are used for other purposes. These
bits can enable Schmitt trigger inputs on each I/O port, enable
toggle outputs from Timer 0 and Timer 1, and enable a clock output
if either the internal RC oscillator or external clock input is being
used. The last two functions are described in the Timer/Counters
and Oscillator sections respectively. The enable bits for all of these
functions are shown in Figure 15.
Each I/O port of the P87LPC767 may be selected to use TTL level
inputs or Schmitt inputs with hysteresis. A single configuration bit
determines this selection for the entire port. Port pins P1.2, P1.3,
and P1.5 always have a Schmitt trigger input.
SU01160
PORT
PIN
INPUT
DATA
PORT LATCH
DATA
N
Figure 13. Open Drain Output
SU01161
PORT
PIN
V
DD
INPUT
DATA
PORT LATCH
DATA
N
P
Figure 14. Push-Pull Output
Philips Semiconductors Product data
P87LPC767
Low power, low price, low pin count (20 pin)
microcontroller with 4-kbyte OTP and 8-bit A/D converter
2002 Mar 25
23
BIT SYMBOL FUNCTION
P2M1.7 P2S When P2S = 1, this bit enables Schmitt trigger inputs on Port 2.
P2M1.6 P1S When P1S = 1, this bit enables Schmitt trigger inputs on Port 1.
P2M1.5 P0S When P0S = 1, this bit enables Schmitt trigger inputs on Port 0.
P2M1.4 ENCLK When ENCLK is set and the P87LPC767 is configured to use the on-chip RC oscillator, a clock
output is enabled on the X2 pin (P2.0). Refer to the Oscillator section for details.
P2M1.3 ENT1 When set, the P.7 pin is toggled whenever Timer 1 overflows. The output frequency is therefore
one half of the Timer 1 overflow rate. Refer to the Timer/Counters section for details.
P2M1.2 ENT0 When set, the P1.2 pin is toggled whenever Timer 0 overflows. The output frequency is therefore
one half of the Timer 0 overflow rate. Refer to the Timer/Counterssection for details.
P2M1.1, P2M1.0 These bits, along with the matching bits in the P2M2 register, control the output configuration of
P2.1 and P2.0 respectively, as shown in Table 4.
(P2M1.0)
SU01638
(P2M1.1)ENT0ENT1ENCLKP0SP1SP2S
01234567
P2M1
Reset Value: 00h
Not Bit Addressable
Address: A4h
Figure 15. Port 2 Mode Register 1 (P2M1)
Keyboard Interrupt (KBI)
The Keyboard Interrupt function is intended primarily to allow a
single interrupt to be generated when any key is pressed on a
keyboard or keypad connected to specific pins of the P87LPC767,
as shown in Figure 16. This interrupt may be used to wake up the
CPU from Idle or Power Down modes. This feature is particularly
useful in handheld, battery powered systems that need to carefully
manage power consumption yet also need to be convenient to use.
The P87LPC767 allows any or all pins of port 0 to be enabled to
cause this interrupt. Port pins are enabled by the setting of bits in
the KBI register, as shown in Figure 17. The Keyboard Interrupt Flag
(KBF) in the AUXR1 register is set when any enabled pin is pulled
low while the KBI interrupt function is active. An interrupt will
generated if it has been enabled. Note that the KBF bit must be
cleared by software.
Due to human time scales and the mechanical delay associated with
keyswitch closures, the KBI feature will typically allow the interrupt
service routine to poll port 0 in order to determine which key was
pressed, even if the processor has to wake up from Power Down
mode. Refer to the section on Power Reduction Modes for details.
Philips Semiconductors Product data
P87LPC767
Low power, low price, low pin count (20 pin)
microcontroller with 4-kbyte OTP and 8-bit A/D converter
2002 Mar 25
24
SU01163
KBF (KBI INTERRUPT)
EKB
(FROM IEN1 REGISTER)
P0.7
KBI.7
P0.6
KBI.6
P0.5
P0.4
P0.3
P0.2
P0.1
P0.0
KBI.5
KBI.4
KBI.3
KBI.2
KBI.1
KBI.0
Figure 16. Keyboard Interrupt
BIT SYMBOL FUNCTION
KBI.7 KBI.7 When set, enables P0.7 as a cause of a Keyboard Interrupt.
KBI.6 KBI.6 When set, enables P0.6 as a cause of a Keyboard Interrupt.
KBI.5 KBI.5 When set, enables P0.5 as a cause of a Keyboard Interrupt.
KBI.4 KBI.4 When set, enables P0.4 as a cause of a Keyboard Interrupt.
KBI.3 KBI.3 When set, enables P0.3 as a cause of a Keyboard Interrupt.
KBI.2 KBI.2 When set, enables P0.2 as a cause of a Keyboard Interrupt.
KBI.1 KBI.1 When set, enables P0.1 as a cause of a Keyboard Interrupt.
KBI.0 KBI.0 When set, enables P0.0 as a cause of a Keyboard Interrupt.
Note: the Keyboard Interrupt must be enabled in order for the settings of the KBI register to be effective. The interrupt flag
(KBF) is located at bit 7 of AUXR1.
KBI.0
SU01164
KBI.1KBI.2KBI.3KBI.4KBI.5KBI.6KBI.7
01234567
KBI
Reset Value: 00h
Not Bit Addressable
Address: 86h
Figure 17. Keyboard Interrupt Register (KBI)

P87LPC767FN,112

Mfr. #:
Manufacturer:
NXP Semiconductors
Description:
IC MCU 8BIT 4KB OTP 20DIP
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union