Intel MCS48 User Manual page 367

Family of single chip microcomputers
Hide thumbs Also See for MCS48:
Table of Contents

Advertisement

8279/8279-5
INTERFACE CONSIDERATIONS
Scanned
Keyboard Mode,
2-Key
Lockout
There
are three possible
combinations
of
conditions
that
can occur
during
debounce
scanning.
When
a key
is
depressed, the
debounce
logic
is
set.
Other depressed
keys
are
looked
for
during the next
two
scans.
If
none
are
encountered,
it
is
a
single
key depression
and
the
key
position
is
entered
into
the
FIFO
along with
the
status
of
CNTL
and
SHIFT
lines.
If
the
FIFO
was
empty,
IRQ
will
be
set to signal
the
CPU
that
there
is
an
entry
in
the FIFO.
If
the
FIFO
was
full,
the
key
will
not
be
entered
and
the
error flag
will
be
set.
If
another closed switch
is
encountered,
no
entry to the
FIFO
can
occur.
If
all
other
keys
are released before
this
one,
then
it
will
be
entered
to
the
FIFO.
If
this
key
is
released before
any
other,
it
will
be
entirely
ignored.
A
key
is
entered
to
the
FIFO
only
once
per depression,
no
matter
how many
keys
were pressed
along with
it
or
in
what
order they
were
released.
If
two
keys
are
depressed
within the
debounce
cycle,
it
is
a simultaneous depression. Neither key
will
be recognized
until
one
key remains
depressed
alone.
The
last
key
will
be
treated
as a
single
key depression.
Scanned
Keyboard Mode, N-Key
Rollover
With
N-key
Rollover
each
key depression
is
treated
independently from
all
others.
When
a
key
is
depressed,
the
debounce
circuit
waits 2
keyboard scans and
then
checks
to
see
if
the
key
is
still
down.
If
it
is,
the
key
is
entered
into
the FIFO.
Any number
of
keys can be
depressed and another can be recognized and
entered
into
the FIFO.
If
a
simultaneous depression
occurs, the
keys
are
recognized
and
entered according
to
the order
the
keyboard scan found them.
Scanned
Keyboard
Special
Error
Modes
For
N-key
rollover
mode
the
user
can
program
a special
error
mode.
This
is
done
by
the
"End
Interrupt/Error
Mode
Set"
command.
The debounce
cycle
and
key-validity
check
are as
in
normal N-key mode.
If
during
a single
debounce
cycle
,
two
keys
are
found
depressed,
this
is
considered
a
simultaneous
multiple depression,
and
sets
an
error
flag.
This
flag
will
prevent
any
further writing
into
the
FIFO and
will
set
interrupt
(if
not
yet
set).
The
error
flag
could be read
in
this
mode
by
reading the
FIFO
STATUS
word. (See
"FIFO
STATUS"
for
further
details.)
The
error
flag
is
reset
by sending
the
normal
CLEAR command
with
Cf
-
1.
Sensor
Matrix
Mode
In
Sensor
Matrix
mode,
the
debounce
logic
is
inhibited.
The
status
of
the
sensor switch
is
inputted
directly to
the
Sensor
RAM.
In
this
way
the
Sensor
RAM
keeps an image
of
the
state of
the
switches
in
the
sensor
matrix.
Although
debouncing
is
not provided,
this
mode
has
the
advantage
that
the
CPU
knows
how
long the sensor
was
closed
and
when
it
was
released.
A
keyboard
mode
can
only
indicate
a validated closure.
To make
the software
easier,
the
designer should
functionally
group
the
sensors by
row
since
this
is
the format
in
which
the
CPU
will
read them.
The IRQ
line
goes
high
if
any sensor
value
change
is
detected
at
the
end
of
a
sensor
matrix scan.
The IRQ
line
is
cleared
by
the
first
data read operation
if
the
Auto-
Increment
flag
is
set to zero,
or
by
the
End
Interrupt
command
if
the
Auto-Increment
flag
is
set to
one.
Note:
Multiple:
changes
in
the matrix
Addressed by
(SL0-3
=
0)
may
cause
multiple
interrupts.
(SLo
=
in
the
Decoded
Mode). Reset
nay
cause
the
8279
to
see
multiple
changes.
Data
Format
In
the
Scanned
Keyboard mode,
the character entered
into
the
FIFO corresponds
to
the position
of
the switch
in
the
keyboard
plus the status
of
the
CNTL
and
SHIFT
lines (non-inverted).
CNTL
is
the
MSB
of
the character
and
SHIFT
is
the next
most
significant
bit.
The
next
three
bits
an;
from
the
scan counter and
indicate the
row
the
key
was
found
in.
The
last
three
bits
are
from
the
column
counter
and
indicate to
which
return
line
the
key
was
connected.
MSB
LSB
CNTL
SHIFT
I
I
SCAN
I
1
1
1
RETURN
.1
,
L.
SCANNED KEYBOARD DATA FORMAT
In
Sensor
Matrix
mode,
the data
on
the return
lines
is
entered
directly
in
the
row
of
the
Sensor
RAM
that
corresponds
to
the
row
in
the matrix being
scanned.
Therefore,
each
switch postion
maps
directly to
a
Sensor
RAM
position.
The SHIFT and
CNTL
inputs are
ignored
in
this
mode. Note
that
switches
are not necessarily the only
thing
that
can be connected
to
the return
lines
in
this
mode.
Any
logic that
can be
triggered
by
the
scan
lines
can
enter data
to
the return
line
inputs.
Eight multiplexed
input ports
could be
tied to
the return
lines
and scanned
by
the 8279.
MSB
LSB
RL
7
UL
6
RL
5
RL4
RL3
RL
2
RL1
RLp
J
In
Strobed
Input
mode,
the data
is
also
entered
to
the
FIFO
from
the return
lines.
The
data
is
entered
by
the
rising
edge
of a
CNTL/STB
line
pulse.
Data can
come
from
another
encoded
keyboard
or
simple switch
matrix.
The
return
lines
can
also
be used
as
a
general
purpose
strobed
input.
MSB
LSB
I
RL7
I
RL
6
RL
5
RL
4
RL
3
RL
2
RI_1
RL
Display
Left
Entry
Left
Entry
mode
is
the simplest display
format
in
that
each
display position
directly
corresponds
to
a byte
(or
nibble)
in
the Display
RAM.
Address
in
the
RAM
is
the
left-most
display
character
and address
15
(or
address
7
in
8
character
display)
is
the
right
most
display character.
Entering characters
from
position
zero
causes
the display
to
fill
from
the
left.
The
17th
(9th)
character
is
entered
back
in
the
left
most
position
and
filling
again
proceeds from
there.
8-77
00742A

Advertisement

Table of Contents
loading

Table of Contents