English
Language : 

EM6622 Datasheet, PDF (17/70 Pages) EM Microelectronic - MARIN SA – Ultra Low Power Microcontroller with 4x32 LCD Driver
EM6622
6.4 Port B
The EM6622 has one four bit general purpose I/O port. Each bit can be configured individually by software for
input/output, pull-up, pull-down and CMOS or Nch. open drain output type. The port outputs either data,
frequency or PWM signals.
6.4.1 Input / Output Mode
Each port B terminal is bit-wise bi-directional. The input or output mode on each port B terminal is set by writing
the corresponding bit in the RegPBCntl control register. To set for input (default), 0 is written to the
corresponding bit of the RegPBCntl register which results in a high impedance state for the output driver. The
output mode is set by writing 1 in the control register, and consequently the output terminal follows the status of
the bits in the RegPBData register.
The port B terminal status can be read on address RegPBData even in output mode. Be aware that the data
read on port B is not necessary of the same value as the data stored on RegPBData register.
See also Figure 11 for details.
Figure 11. Port B Architecture
Internal Data Bus
Pull-down
Option Register
Pd[n]
Open Drain Option
Register
OD[n]
Port B Direction Register
DDR[n]
Port B Data Register
DR[n]
Read
MUX
Port B
Control
PB[n]
I / O Terminal
Active Pull-up
in Nch. Open
Drain Mode
Mask Option
MPBPD[n]
Multiplexed
Multiplexed
Outputs are:
Output
PWM, Ck[16],
Ck[11], Ck[1] Multiplexed
Output Active
4
DB[n]
Read
Read for PB[3:0]
mask option
MPBPD[n]
Active
Pull-down
Copyright  2002, EM Microelectronic-Marin SA
17
03/02 REV. C/445
www.emmicroelectronic.com