[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 6522 as Serial Port?



Rob Thomson <rob.thomson@vuw.ac.nz> wrote:

> Can I use some of the outputs of a 6522 for serial transfer to Apple or PC?
> I can add a voltage converter (MAX232, etc), but can I use some inputs/outputs
> (data, handshake, etc) for serial transfers?

Not easily.  The 6522 VIA has an 8-bit shift in/shift out mechanism, but
it has no support for asynchronous character transmit or receive (start
bit, data bits, stop bits).

If you were going to use a 6522, the best way to handle asynchronous
transmission would be to generate the data stream directly on a single
output, timing the width of each bit (one of the VIA timers could help
with this).

For asynchronous receive, you would have to sample an input several
times faster than the baud rate (at least eight times faster, preferably
more), watching for edges, and counting off bits.

As you can imagine, this is a pretty CPU-intensive oion, and is not
feasible at anything faster than about 1200 bps if you want to do
anything else.


The serial shift register provided by the VIA can be used to implement
an SPI connection (Serial Peripheral Interface), but this is not
something that can be interfaced to a standard asynchronous serial port.

-- 
David Empson
dempson@actrix.gen.nz
Snail Mail: P.O. Box 27-103, Wellington, New Zealand