[comp.sys.apple] Using Hardware to Control Serial Ports

barry@rbdc (Barry Newberry) (02/24/90)

Warning : there is a high probability of maniacs in engineering dept.

AAAAAIIIIGHHGHH !!!! (now that I have that out of my system ...)

This is dedicated to those of you who had such a nasty time trying to
use the IIgs serial ports via Hardware Addresses.

Lately, I have spent time disassembling ProTERM and analyzing the
code, because it is the best terminal program for the Apple II series
(in my opinion). Serial I/O seems to be done with the hardware addresses,
as opposed to the Pascal 1.1 protocol. The Super Serial Card is controlled
by normal hardware I/O addressing (r/w $C08n,X where X=slotx16). However,
the IIgs Serial Port is controlled by addresses $C038-C03B. These addresses
DIRECTLY read and write to the SCC 8530 command and data registers. The
standard rule for developers is "don't play with the registers." This
wouldn't be so bad if there was a map for the standard hardware addresses.
The SCC registers should only be used, when all (or at least most) commands
and settings for the SCC are understood. This causes trouble when some
things can only be done via the registers.

Is this madness or genius ?

The IIgs serial ports can be completely controlled via the SCC registers.
(At least that's what I have been led to believe.) This means that the
hardware addresses which are normally used for controlling a given slot
are not needed for controlling the serial ports. This, in turn, leaves
the serial port slots free for use by other cards, just select "Your Card"
for the slot in the Control Panel. Remember when people were talking about
being able to use slot 2 as a serial port and something else ? (possible
genius, hmmm... )

On the bad side, the hardware addresses $C000-C07F are getting real
crowded (in my opinion). There aren't many bytes left for additional
softswitches. Then again, you could use a byte (softswitch) to chose
between "old" IIgs I/O or "enhanced" IIgs I/O . ( <insert sarcasm>
"so, a LDA $C000 ... was that from the Main or the Alternate page ?")

So, does anyone have the hardware address map for the Super Serial
Card ? I know that $C084-C087, and $C08A have functions :-)  !
Also, who do I write for info on the SCC 8530 registers ?

P.S. : Thanks, J. B.
-- 
------------------------------------------------------------------------
    Remember, until there is a cure for Assembly Language Brain Fry,
      there will always be the N.C. Home for Deranged Programmers.
.......................................................................

jb10320@uxa.cso.uiuc.edu (Jawaid Bazyar) (02/26/90)

In article <1990Feb24.031856.26733@rbdc> barry@rbdc.UUCP (Barry Newberry) writes:
>
>Warning : there is a high probability of maniacs in engineering dept.
>
>AAAAAIIIIGHHGHH !!!! (now that I have that out of my system ...)
>
>This is dedicated to those of you who had such a nasty time trying to
>use the IIgs serial ports via Hardware Addresses.
>
>Lately, I have spent time disassembling ProTERM and analyzing the
>code, because it is the best terminal program for the Apple II series
   vvvvvvvv  I should hope so. Just wait.
>(in my opinion). Serial I/O seems to be done with the hardware addresses,
>as opposed to the Pascal 1.1 protocol. The Super Serial Card is controlled
>by normal hardware I/O addressing (r/w $C08n,X where X=slotx16). However,
>the IIgs Serial Port is controlled by addresses $C038-C03B. These addresses
>DIRECTLY read and write to the SCC 8530 command and data registers. The
>standard rule for developers is "don't play with the registers." This
>wouldn't be so bad if there was a map for the standard hardware addresses.

   I have a copy of the SCC8530 programmers manual from Zilog.  You can
call them and they'll give you one free.  But read further...

>The SCC registers should only be used, when all (or at least most) commands
>and settings for the SCC are understood. This causes trouble when some
>things can only be done via the registers.
>
>Is this madness or genius ?
>
>The IIgs serial ports can be completely controlled via the SCC registers.

  And they are, but the firmware does this control.

>(At least that's what I have been led to believe.) This means that the
>hardware addresses which are normally used for controlling a given slot
>are not needed for controlling the serial ports. This, in turn, leaves
>the serial port slots free for use by other cards, just select "Your Card"
>for the slot in the Control Panel. Remember when people were talking about
>being able to use slot 2 as a serial port and something else ? (possible
>genius, hmmm... )
   No, not genius.  It is very likely that with system 6 we will have the
Slot Arbiter, described in GS Tech Note #69.  It will provide the very
functionality you speak of, without having to bang your skull on the wall.

>
>On the bad side, the hardware addresses $C000-C07F are getting real
>crowded (in my opinion). There aren't many bytes left for additional
>softswitches. Then again, you could use a byte (softswitch) to chose
>between "old" IIgs I/O or "enhanced" IIgs I/O . ( <insert sarcasm>
>"so, a LDA $C000 ... was that from the Main or the Alternate page ?")
>
>So, does anyone have the hardware address map for the Super Serial
>Card ? I know that $C084-C087, and $C08A have functions :-)  !
>Also, who do I write for info on the SCC 8530 registers ?

  Again, just give Zilog a call. The number is 408 370 8000, San Jose, CA.
But, I warn you- I will not be responsible for your suicide when it comes.
Do yourself a favor and use the firmware- it already does everything you need,
and if you really want to you can write directly to the SCC registers with the
Extended Command interface.  Do you really want to write your own interrupt
handlers, buffer drivers, and error managers?  ProTERM is not quite right
for some reason.  I have a POPCom 1200 modem (AppleModem 1200 clone) that I
don't use anymore because I thought it broken.  It's not.  ProTERM won't use
it right. And no, it's NOT the init string.  This modem works fine, however,
from MY term program which goes thru the firmware.
>
>P.S. : Thanks, J. B.
>-- 
>------------------------------------------------------------------------
>    Remember, until there is a cure for Assembly Language Brain Fry,
>      there will always be the N.C. Home for Deranged Programmers.
>.......................................................................

   Can I join? Where do I sign?
--
Jawaid Bazyar               | This message was posted to thousands of machines
Junior/Computer Engineering | throughout the entire civilized world. It cost
jb10320@uxa.cso.uiuc.edu    | the net hundreds, maybe thousands of dollars.