Specifications
Port
(ACIA)
or for the
Si
mplex
Serial Port.
PB6
is
used
in the output
mode
of the
Simplex
Serial
Port as a
protocol
input
line.
Neither
PB6
nor
PB7
are
available
directly
on
the
QUARK's
connector.
Note
that
when
the
VIA's
Port B lines are confi
gured
as
outputs, the value read in Input
Register B
(I/O address
6Ohex)
is the value
programmed
for the corresponding
bit
in
Output
Register
B,
not the logic level actually present
on
the output pin of the
VIA.
Serial
Keyboard
Interface
The
QUARK
can
be
used
with serial-output keyboards.
Many
applications
may
require the
use
of a "detachable", or stand-alone
keyboard.
These
keyboards
generally
use
asynchronous
serial
communication
over a single pair of conductors to
reduce
the size of the cable connecting the
keyboard
to the
main
housing
of the system.
The
Simplex
Serial Interface
can
be
used
for
this
application.
When
strapped in the input
mode
(explained below), the
CB2
control line of the
VIA
as
well
as
that device's Shift Register
can
be
used as a
receiver
for
the
asynchronous keyboard output. Timer 2 can
be
used
to
generate the clock for the Shift Register.
The
basic
method of
operation
is
to
enable
the
CB2
control
line
to
act
as
an
edge-
triggered independent-interrupt input. This
mode
is
enabled
by
setting
bit
5
and
clearing
bit
7 of the
VIA's
Peripheral Control Register
(PCR,
I/O
address
6Chex).
Also, the
state
of
bit
6
in the
PCR
determines the active
edge
on
CB2
WhlCh
will set the
CB2
Interrupt flag.
The
active
transition
wi
II
be
positive-to-negative
when
bit
6
is
cleared,
and
negative-to-positive
when
bit
6
is
set. Bit 6 should
be
configured
so
that the transmission of the
start
bit
from
the
keyboard
wi
II
be
recognized
as
the active
transition.
Note
that the
RS-232C
line receiver
driving the
CB2
control line will invert the signal
from
the
keyboard.
Jumper
J7
must
be
installed to allow the output of the
RS-232C
receiver
whose
input
is
from
pin
B-2
to
be
connected to the
CB2
line
on
the
VIA.
Jumper
J8,
which
connects the output
of the receiver to the
PB6
I/O
should
either
be
removed,
or
PB6
must
be
configured
as
an
input.
If
this
is
not
done,
then the output
on
PB6
wi
II short out the input
on
CB2.
Although
pin
B-2
would
ordinari ly
be
driven
by
an
RS-232C
driver,
most
TTL
serial
keyboard
outputs should be
able to drive
this
input properly.
When
the
keyboard
transmits the
start
bit,
the active
transition
of the
CB2
line will set
the
CB2
Interrupt flag
in
the Interrupt
Flag
Register.
If
the
CB2
Interrupt
Enable
bit
in the
Interrupt
Enable
Register is
set,
the
VIA
will generate
an
interrupt to the
Z80B.
Once
in the interrupt service routine for the
serial
keyboard, the
VIA
shift
register
must
be
enabled
in
one
of
its
input
modes.
The
most
useful
mode
is
likely to be the ''Shift in
Under
Control of
T2'~
since
in
this
mode
Timer
2 is
used
to generate the Shift Register clock.
If
the Shift Register
Flag
in
the
IFR
is
rot
set,
then shifting
will
begin
as
soon
as
this
mode
is
enabled.
At
the completion of eight
shifts,
the
SR
flag
in
the
IFR
will be
set,
and,
if
the
SR
Interrupt
in
the
IER
is
enabled, the
VIA
will generate
an
interrupt to the
Z80B.
The
contents
of the
SR
can
then
be
read,
and
the
SR
di sabled. This a llows the
CB2
input
to
return to the
edge-triggered independent-interrupt
mode,
so
that the next
start
bit
from
the
serial
keyboard
will
be
recogni
zed.
Baud
rates for the Shift Register
can
be
found
in Table
III.
It
should
be
noted that
depending
on
the interrupt service routine for the
serial
keyboard
as
well
as
the timing of the
serial
data stream
it
is
possible that the
first
bit
(or the
start
bit)
will
not
be
recognized
as
a data
bit.
As
of the date of issue of
this
document,
Megatel
does
not
offer software for a
serial
keyboard
interface using the simplex port.
The
Full-duplex port
may
also
be
used
for a
serial
keyboard
input. This port
would
be
particularly
si
mple
to
implement
if
the keyboard's output
is
standard 7- or
8-bit
RS-232C
protocol.
If
this
is the case, then
it
is necessary only to enable the
ACIA
properly for the
receiving
mode
used,
and
then
poll
the
Received Data
Register
Full lag
for
an
incoming
Megatel
Computer
Technologies Toronto,
Canada
Page
H/W-20