the apple super serial card

before i could start hooking up any custom hardware, i needed to have a way to get code from my laptop (where i am writing and assembling it) to the apple.  the obvious answer was through the super serial card (SSC), since i already had a USB-to-serial adapter.

while setting up the physical connection was simple enough (i’ve gathered enough of a collection of cables and adapters over the years that it was simply a matter of locating the correct ones), the software side proved to be more difficult.  part of this was because i was simultaneously creating the software for both ends of the connection.

to back up a step, i verified that the connection was working properly simply by using Terminal on the laptop and IN#3 (SSC card in slot 3) on the apple.  i selected 300 baud because, for typing, that seemed plenty fast.  that allowed me to type on the laptop and have it appear on the apple.  i didn’t worry about communication in the other direction because i didn’t need it yet.  however, that only allowed for text communication, while i needed to be able to transfer binary programs.

so i wrote a serial receive utility for the apple (in assembler).  i also wrote a simple utility to convert the 65C02 binary output from the assembler into a text file containing a series of apple ‘input lines’ – i.e. as if i were typing the program in byte-by-byte from the Monitor prompt.  so the sequence of operations was

  1. write/edit the code for my serial receive utility
  2. assemble the code using Anton Treuenfels’ Hobby Cross Assembler
  3. use my conversion utility to convert the binary into ‘input lines’
  4. set up the Terminal-to-IN#3 connection
  5. send the text file via Terminal
  6. type in the command to save the file to disk on the apple

i hit an immediate problem with this in that 300 baud was way too fast for the apple to keep up.  luckily in Terminal it is possible to add a delay after each character sent and a different delay after a CR/LF is sent.  i believe i ended up needing 30ms per character and 500ms after a CR/LF to ensure proper communication.

once i was able to get an initial version of my receive utility across, i expanded my conversion utility to be able to send the binary file directly.  then followed a long series of trying a wide variety of things in both the apple and laptop utilities (including hooking up my logic analyzer at one point to confirm what control lines were/were not being used) before i was eventually able to find success.  i then increased the speed from 300 to 9600 baud without difficulty, and have kept it there ever since.  i think my apple code is tight enough to handle 19.2k (the highest the SSC supports), but 9600 is fast enough for the size of files i’m transferring, so i’m not going to bother trying.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s