First page Back Continue Last page Overview Graphics
The 68HC12 contains many bi-directional input/output ports.
Write to Data Direction Bits corresponding to the bi-directional bit positions to define a bit as input or output.
- A “1” programs the corresponding bi-directional bit to be an output and a “0” to be an input.
- On power-up, all bi-directional bits are inputs.
The bi-directional ports in the 68HC12 can be programmed with any proportion of the bits in a port programmed as inputs and outputs.
Most all systems that use bi-directional I/O bits have them default to inputs. This is generally a safe startup mode because it prevents a situation where two outputs are conflicting with each other. Before making an I/O port an output, it may be necessary to write data to it so it comes up in an appropriate state. In addition since an output bit will have no control during power-up, it may be necessary to provide external hardware (such as a pull-up resistor) a default state during power-up.