Operation; Reading The Switches - FIGnition FUZE Hardware Reference Manual

Table of Contents

Advertisement

!
Fig 2.2a!
Fig2.2b
In the opposite way that a small resistor is like a wire causing a tiny voltage to drop across
it; an open switch is like a nearly infinite resistor taking the place of R2; so R1 will pull a
PortC input up to very nearly 5v [Fig 2.2a]. But when the switch is pressed, it connects to
0v and so its PortC input would read as 0 [Fig 2.2b].
Fig 2.3
When either PortB0 or PortD7 is set as an input, it has an extremely high resistance com-
pared with a PortC 'pull-up' resistor causing its PortC input to read as a 1 even if the switch
is pressed [Fig 2.3].

2.2 Operation

Even for something as simple as the set of switches making up the keypad there are sev-
eral layers to its operation.

2.2.1 Reading the switches.

We can see from Fig 2.1, pressing a single switch will connect exactly one row signal to
one column input (for example, pressing SW1 will connect PortD7 to PortC0). In the initial
case (when keys aren't pressed), the voltage at every column input will be high, because
all the keys behave as in Fig 2.2.
If we set PortD7 to an output and make it output 0, then any pressed keys (on the top row)
will connect to 0v and will be read as 0s by PortC [Fig 2.4]

Advertisement

Table of Contents
loading

Table of Contents