Digital Input Port

Address: $1003 (Port C)
Initialization: None
Format:
B7 B6 B5 B4 B3 B2 B1 B0
Input Operations: Reading port obtains current values of digital inputs
Output Operations: None within the scope of this class

We use this port only for input, and this is the default when the HC11 powers up, so we don't have to do anything special. Each bit corresponds to one digital sensor (like a switch).  Since port C is used for input only (for us), what does it mean to store a value at this address? Nothing really; the digital sensors will just change it back.

An important feature is that the digital port is connected to a pull-down resistor. That means that if the switch is pressed, a 0 bit results. If the switch is not pressed or not even attached to that bit of the port, a 1 results.