|
MC68HC05J3 Datasheet, PDF (34/92 Pages) Motorola, Inc – High-density Complementary Metal Oxide Semiconductor (HCMOS) Microcomputer Unit | |||
|
◁ |
4.5
Other port considerations
All output ports can emulate âopen-drainâ outputs. This is achieved by writing a zero to the relevant
output port latch. By toggling the corresponding data direction bit, the port pin will either be an
output zero or tri-state (an input). This is shown diagrammatically in Figure 4-3.
When using a port pin as an âopen-drainâ output, certain precautions must be taken in the user
software. If a read-modify-write instruction is used on a port where the âopen-drainâ is assigned
and the pin at this time is programmed as an input, it will read it as a âoneâ. The read-modify-write
4
instruction will then write this âoneâ into the output data latch on the next cycle. This would cause
the âopen-drainâ pin not to output a âzeroâ when desired.
Note: âOpen-drainâ outputs should not be pulled above VDD.
Read buffer output
(a)
A
Y
Data direction register bit DDRn
DDRn
1
1
0
0
(b)
1
1
0
0
A
Y
0
0
1
1

 Normal operation â tri state
0 tri state 
1 tri state 
0
low 
1
â

 âOpen-drainâ
0
high 
1
high 
VDD
VDD
Px0
âOpen-drainâ output
(c)
DDRx, bit 0 = 0
Portx, bit 0 = 0
Figure 4-3 Port logic levels
DDRx, bit 0 = 0
Portx, bit 0 = 0
MOTOROLA
4-6
INPUT/OUTPUT PORTS
TPG
MC68HC05J3
|
▷ |