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

Re: virtual serial drive, so how is serial port settings negotiated



On 9/24/2012 12:49 AM, Kevin wrote:
poking around the new adt vsdrive client I dont see how serial ports are negoiated, though I claim to be c-tarded I an really lost on how this occurs ...

as I am somewhat near having a stand alone box that slaps on the back of my //c to act as a serial drive host I seem to be stumped at the basics of communication

The virtual serial drive has the same communications backend as ADTPro, so it's more of a library that can talk to all sorts of serial hardware. But where the rubber meets the road on a //c is in this file:

http://adtpro.cvs.sourceforge.net/viewvc/adtpro/adtpro/client/src/prodos/serial/ssc.asm?revision=1.5&view=markup

INITSSC is the routine that sets the communications parms for the ASIC chip. It depends on a few things being set up beforehand:

PSPEED - a value corresponding to speed settings:
0 = 300, 1 = 9600, 2 = 19200, 3 = 115200

BPSCTRL - a table that PSPEED selects from:
$16,$1E,$1F,$10	; 300, 9600, 19200, 115200

The settings about parity, bits, etc. are standard.

The rest of the routine does some self-modification to other parts of the code so decisions don't have to be made at runtime as to which serial device is to be used. You probably don't need to worry about that (yet, at least).