English
Language : 

ST62T01CB6 Datasheet, PDF (36/96 Pages) STMicroelectronics – 8-BIT MCUs WITH A/D CONVERTER, TWO TIMERS, OSCILLATOR SAFEGUARD & SAFE RESET
ST6200CM-Auto/ ST6201CM-Auto/ST6203CM-Auto
8 I/O PORTS
8.1 INTRODUCTION
Each I/O port contains up to 8 pins. Each pin can
be programmed independently as digital input
(with or without pull-up and interrupt generation),
digital output (open drain, push-pull) or analog in-
put (when available).
The I/O pins can be used in either standard or al-
ternate function mode.
All input lines can be individually connected by
software to the interrupt system by programming
the OR and DR registers accordingly. The inter-
rupt trigger modes (falling edge, rising edge and
low level) can be configured by software for each
port as described in the Interrupt section.
8.2.2 Analog Inputs
Standard I/O mode is used for:
Some pins can be configured as analog inputs by
– Transfer of data through digital inputs and out- programming the OR and DR registers according-
puts (on specific pins):
ly, see Table 8. These analog inputs are connect-
ed to the on-chip 8-bit Analog to Digital Converter.
– External interrupt generation
Caution: ONLY ONE pin should be programmed
Alternate function mode is used for:
– Alternate signal input/output for the on-chip
) peripherals
t(s The generic I/O block diagram is shown in Figure
c 23.
rodu 8.2 FUNCTIONAL DESCRIPTION
P Each port is associated with 3 registers located in
Data space:
te – Data Register (DR)
le – Data Direction Register (DDR)
so – Option Register (OR)
b Each I/O pin may be programmed using the corre-
O sponding register bits in the DDR, DR and OR reg-
- isters: bit x corresponding to pin x of the port. Table
) 8 illustrates the various port configurations which
t(s can be selected by user software.
c During MCU initialization, all I/O registers are
u cleared and the input mode with pull-up and no in-
d terrupt generation is selected for all the pins, thus
ro avoiding pin conflicts.
P 8.2.1 Digital Input Modes
te The input configuration is selected by clearing the
le corresponding DDR register bit.
o In this case, reading the DR register returns the
s digital value applied to the external I/O pin.
bDifferent input modes can be selected by software
Othrough the DR and OR registers, see Table 8.
as an analog input at any time, since by selecting
more than one input simultaneously their pins will
be effectively shorted.
8.2.3 Output Modes
The output configuration is selected by setting the
corresponding DDR register bit. In this case, writ-
ing to the DR register applies this digital value to
the I/O pin through the latch. Then, reading the DR
register returns the previously stored value.
Two different output modes can be selected by
software through the OR register: push-pull and
open-drain.
DR register value and output pin status:
DR
Push-pull
0
VSS
1
VDD
Open-drain
VSS
Floating
Note: The open drain setting is not a true open
drain. This means it has the same structure as the
push-pull setting but the P-buffer is deactivated.
To avoid damaging the device, please respect the
VOUT absolute maximum rating described in the
Electrical Characteristics section.
8.2.4 Alternate Functions
When an on-chip peripheral is configured to use a
pin, the alternate function (timer input/output...) is
not systematically selected but has to be config-
ured through the DDR, OR and DR registers. Re-
fer to the chapter describing the peripheral for
more details.
External Interrupt Function
36/96
1