ADVANCE INFORMATION
VCT 38xxA
5.18.4.I2C Ports P40 and P41
5.18.4.1. Features
– digital I/O port
– I2C input and output function
The I2C ports SDA and SCL can alternatively be used
as digital I/O ports. To activate the I2C function of the
port pin the corresponding MOD flag has to be set to
special mode. In normal mode the port pin serves as
digital I/O. The output stage is open-drain only. After
reset, the I2C ports are in special mode.
– Schmitt trigger input buffer
– open-drain output
– connected to standby supply
VDD
P4D read
DB0/DB1
1
VSS
SDA/SCL In
0
VDD
1
SDA/SCL Out
P40
P41
Q
Q
Q
D
0
P4D write
VSS
D
P4M
D
P4E
Fig. 5–6: I2C port circuit
.
322: 1F9C
323: P4D
324: Port 4 Data Register
325: 1F9E
326: P4M
327: Port 4 Mode Register
bit
7
6
5
4
3
2
1
0
bit
7
6
5
4
3
2
1
0
SDAM
1
r
AIN3D
AIN2D
AIN1D AOUT2D AOUT1D SCLD
SCLD
SDAD
SDAD
0
w
AIN3M AIN2M AIN1M AOUT2M AOUT1M SCLM
w
reset
1
1
1
0
0
1
reset
0
0
0
0
0
0
SCLM
w1:
w0:
SCL Normal/Special Mode Flag
Special I2C Output Mode
Normal Output Mode
SCLD
r:
w:
SCL Data Input/Output
Read pin level resp. data latch.
Write data to data latch.
SDAM
w1:
w0:
SDA Normal/Special Mode Flag
Special I2C Output Mode
Normal Output Mode
SDAD
r:
w:
SDA Data Input/Output
Read pin level resp. data latch.
Write data to data latch.
328: 1F9F
329: P4E
330: Port 4 Enable Register
To use the I2C ports as software output, the appropri-
ate drivers must be activated by setting the SCLEN
and SDAEN flag and resetting the SCLM and SDAM
flags.
bit
w
7
6
5
4
3
2
1
0
SCLEN SDAEN
reset
1
1
SCLEN
w1:
w0:
SCL Enable Flag
Output driver is enabled
Output driver is disabled
SDAEN
w1:
w0:
SDA Enable Flag
Output driver is enabled
Output driver is disabled
Micronas
129