Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!princeton!caip!cbmvax!carolyn From: carolyn@cbmvax.cbm.UUCP (Carolyn Scheppner) Newsgroups: net.micro.amiga Subject: Re: AEGIS DRAW / AMIGA / APPLE PLOTTER (NEED HELP!!) Message-ID: <416@cbmvax.cbmvax.cbm.UUCP> Date: Mon, 16-Jun-86 14:55:17 EDT Article-I.D.: cbmvax.416 Posted: Mon Jun 16 14:55:17 1986 Date-Received: Wed, 18-Jun-86 04:05:19 EDT References: <3311@vax4.fluke.UUCP> Reply-To: carolyn@cbmvax.UUCP (Carolyn Scheppner) Distribution: net Organization: Commodore Technology, West Chester, PA Lines: 290 In article <3311@vax4.fluke.UUCP> star@fluke.UUCP (David Whitlock) writes: >Hope some of you RS-232 GURU's out their can help me with this small problem. >I am trying to get Aegis Draw to talk to an Apple 4 Color/Pen Plotter. >According to Apple, this plotter supports hardware handshaking only. > > Current configuration is as follows > > > 1-------------------------1 > 2-------------------------3 > 3-------------------------2 > 5-------------------------20 > 20-------------------------5 > 7-------------------------7 > >Pin 20 is the DTE line which according to Apple goes to the "Computer" > >I am assuming that this only requires it to be hooked up to pin 5 CTS on the >Amiga. I assumed wrong. No hardware handshaking transpires. > What follows are hardware/software instructions for hardware handshaking for Amiga<>PC. Hopefully, the same cabling and setup can be used with your plotter. I have attached the C source for SetSerial to the end of this message. ( Thanks to Tom Pohorsky for information reposted here) Carolyn Scheppner --- Commodore-Amiga Technical Support ------------------------------------------------------------------------------- I'm "enclosing" my memo on serial downloads from IBM PC's. Note: - this is in the latest documentation on IBM cross-development - be sure the user has a "7-wire" RS-232 cable (i.e. supprots the DTR, DSR,RTS,and CTS lines) this is explained below. - IBM, unlike the Mac, Amiga, and most others, does NOT support proper xon/xoff hanshaking, thus the use of "hardware" handshaking. soooooo, Here's the pin connections for IBM-Amiga serial communication, but first a couple notes: 1. You'll want to disable xON/xOFF handshaking, or else x11's and x13's will be misinterpreted as flow control. To do this set the high order bit of io_SerFlags. To do THAT, type: setserial 10 x84 That will disable xControl, and enable RTS/CTS handshaking. Note that setserial uses shared access, causing bit 5 of io_SerFlags to be "look like it's always on" for setserial. 2. Similarly on the IBM side, one needs to run the "MODE" command for proper setup. Type: MODE com1:,N,,1,P where: com1: is the usually the serial port (may vary per hardware) set to same as Amiga, 19200 if practical. N no parity ,, defaults to 8 data bits, 7 prob'ly ok. 1 1 stop bit P VERY IMPORTANT. The "P" option is usually for talking to printers, but MUST be used (for flow control). ***** Cabling Requirements ***** Amiga IBM frame ground 1 - 1 frame ground Transmit data 2 - 3 Receive data Receive data 3 - 2 Transmit data Request To Send 4 - 5 Clear To Send Clear To Send 5 - 4 Request To Send Data Set Ready 6 - 20 Data Terminal Ready Data Term Ready 20 - 6 Data Set Ready system ground 7 - 7 system ground ... or, in a nut shell, put 1 and 7 straight across, swap 2 and 3, swap 4 and 5, and swap 6 and 20. Note that this is the "standard" RS232-C cable. Note also that this may vary for different manufacturer's serial cards. If there is a problem, one can find the Amiga serial pin-out in Appendix E of the hardware manual. Consult the proper info for the IBM side. It's not uncommon that pin 8 (Carrier Detect) needs to be tied low on the IBM side. *********************************************************************** Setserial is actually sort of self-documenting. typing "setserial" will produce a little message on the use of the arguments. typing "setserial 0" will list the all the parameters: their name and current value. some of the parameters will require reference to the header file serial.h, which is in the rom manual. this will explain the bit assignments for io_SerFlags, for example, such as which bit to set to disable xon/off handshaking. -----------------SetSerial.c CUT HERE------------------------------------ /* SetSerial allows the CLI user to dynamically change any particular * serial port parameter. * * July 6, 1985 Version 1.0 Keith Stobie Initial version * July 7, 1985 Version 2.0 Keith Stobie Converted to Lattice * July 8, 1985 Version 3.0 Keith Stobie Both term words settable. * Sep 25, 1985 Version 3.1 Tom Pohorsky Remove WBufLen * Nov 9, 1985 Version 3.2 Tom Pohorsky Cleanup */ char *prog_name; /* Name of program being run */ char *prog_version = "3.2"; /* Version of the program */ #include #include #include #include #include #include #include #include #include #include #undef NULL #include extern struct MsgPort *CreatePort(); int set_serial( index, value ) int index; /* which parameter to set */ ULONG value; /* The new value for paramter */ { struct IOExtSer IORser; /* Serial port IO request block */ int error; if ((index < 0) || (index > 11)) { printf( "Index value %ld is not in range 0-10!\n", index ); return 20; } IORser.io_SerFlags |= SERF_SHARED; if ((error = OpenDevice (SERIALNAME, 0, &IORser, 0)) != 0) { printf( "Unable to open Serial Device, error=%ld\n", error ); return 20; } IORser.IOSer.io_Command = SDCMD_QUERY; if ((error = DoIO( &IORser ) != 0)) { printf ( "Query status error %ld\n", error); return 20; } /* SET UP the read message port in the I/O request */ if ((IORser.IOSer.io_Message.mn_ReplyPort = CreatePort( "SetSerial", 0 )) == NULL) { printf( "Unable to create port for IO message\n" ); CloseDevice( &IORser ); return 20; } switch( index ) { case 0: print_request( &IORser ); break; case 1: IORser.io_CtlChar = value; break; case 2: IORser.io_RBufLen = value; break; case 3: IORser.io_Baud = value; break; case 4: IORser.io_BrkTime = value; break; case 5: IORser.io_TermArray.TermArray0 = value; break; case 6: IORser.io_TermArray.TermArray1 = value; break; case 7: IORser.io_ReadLen = value; break; case 8: IORser.io_WriteLen = value; break; case 9: IORser.io_StopBits = value; break; case 10: IORser.io_SerFlags = value; break; default: printf( "Internal Logic error! case value %ld\n", index ); } /* switch */ IORser.IOSer.io_Command = SDCMD_SETPARAMS; error = DoIO( &IORser ); DeletePort( IORser.IOSer.io_Message.mn_ReplyPort ); CloseDevice( &IORser ); if (error) { printf( "Error %ld doing IO to set params!\n", error ); return 10; } if (IORser.IOSer.io_Error) { printf( "Error %ld from serial device doing set params!\n" , IORser.IOSer.io_Error ); return 10; } return 0; } /* set_serial() */ print_request( IORser ) struct IOExtSer *IORser; /* Serial port IO request block */ { #define PRINT( field ) printf( " %s = %8lx %8ld\n" \ , "field", (ULONG) IORser->field \ , (ULONG) IORser->field ) #define IPRINT( index, field ) printf( " %2ld %s = %8lx %8ld\n" \ , index, "field", (ULONG) IORser->field \ , (ULONG) IORser->field ) printf( "index field name hexadec decimal\n" ); IPRINT( 1, io_CtlChar ); IPRINT( 2, io_RBufLen ); IPRINT( 3, io_Baud ); IPRINT( 4, io_BrkTime ); IPRINT( 5, io_TermArray.TermArray0 ); IPRINT( 6, io_TermArray.TermArray1 ); IPRINT( 7, io_ReadLen ); IPRINT( 8, io_WriteLen ); IPRINT( 9, io_StopBits ); IPRINT(10, io_SerFlags ); printf( "\n" ); /* Not associated with an index */ PRINT( io_Status ); } /* print_request() */ print_usage() { printf("%s: version %s\n", prog_name, prog_version ); printf("usage: %s \n", prog_name ); printf(" is a decimal number indicating which parameter.\n" ); printf(" 0 indicates print current values (and indexes) \n"); printf(" without changing them.\n" ); printf(" number to set the indexed parameter to.\n"); printf(" value should be in decimal unless it starts with X\n" ); printf(" or x in which case the number should be hexadecimal\n"); exit( 5 ); } main( argc, argv ) int argc; char *argv[]; { int index; ULONG value; if (argc <=0 ) { prog_name = "SetSerial"; } else { prog_name = argv[0];} if (argc == 1) { print_usage(); } if (argc < 2 ) { printf( "Too few parameters\n" ); print_usage();} if (argc > 3 ) { printf( "Too many parameters\n" ); print_usage();} sscanf( *++argv, "%d", &index ); if ((index != 0) && (argc < 3)) { printf( "Too few parameters\n" ); print_usage(); } if (argc == 3) { ++argv; if ((*argv[0] == 'x') || (*argv[0] == 'X')) { sscanf( *argv+1, "%x", &value ); /* Skip x or X */ } else { sscanf( *argv, "%d", &value ); } } exit( set_serial( index, value ) ); } /* main() */ -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Carolyn Scheppner -- CBM >>Amiga Technical Support<< UUCP ...{allegra,caip,ihnp4,seismo}!cbmvax!carolyn PHONE 215-431-9180 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=