beautypg.com

2 open-drain operation, Open-drain operation – National CP3BT26 User Manual

Page 71

background image

71

www.national.com

CP3

BT26

14.2

OPEN-DRAIN OPERATION

A port pin can be configured to operate as an inverting
open-drain output buffer. To do this, the CPU must clear the
bit in the data output register (PxDOUT) and then use the
port direction register (PxDIR) to set the value of the port
pin. With the direction register bit set (direction = out), the
value zero is forced on the pin. With the direction register bit
clear (direction = in), the pin is placed in the TRI-STATE
mode. If desired, the internal weak pull-up can be enabled
to pull the signal high when the output buffer is in TRI-
STATE mode.