[comp.sys.atari.st] Getting a BREAK signal out of the RS232 Port

tomwest@gpu.utcs.toronto.edu (Tom West) (03/29/88)

  Does anybody know how to get the Rs232 port to produce a break signal?
I have heard that there is some escape sequence (using the VT52 emulator)
that will do it, but I don't believe it is documented (if it actually
exist).  Are there any other methods.  (I am using OSS Pascal, but am
fluent in C). 

   Many thanks in advance.

-- 
				Tom West

BITNET:         tomwest@utorgpu.bitnet, tomwest@gpu.utcs.utoronto
Internet:       tomwest@gpu.utcs.toronto.edu 
UUCP:           tomwest@utgpu 

		utzoo, yetti, harpo, mnetor \
		cbosgd, deepthot, utoronto  -  !utgpu!tomwest
		ihnp4, lsuc, sfmin, vnr-vpa /

dal@stag.UUCP (Dale Schumacher) (04/04/88)

    <tomwest@gpu.utcs.toronto.edu> (Tom West) writes...
>   Does anybody know how to get the Rs232 port to produce a break signal?
> I have heard that there is some escape sequence (using the VT52 emulator)
> that will do it, but I don't believe it is documented (if it actually
> exist).  Are there any other methods.  (I am using OSS Pascal, but am
> fluent in C). 

I've been using the following routines successfully in my code and they
seem to work fine.

rs232cd()			/* state of rs232 carrier detect line */
	{
	register long ssp;
	register int *mfp, status;

	mfp = ((int *) 0xFFFFFA00L);		/* base address of MFP */
	ssp = Super(0L);			/* enter supervisor mode */
	status = *mfp;				/* get MFP status */
	Super(ssp);				/* return to user mode */
	return(!(status & 0x0002));		/* check for carrier */
	}

snd_brk()			/* send a BREAK to the rs232 port */
	{
	register long ssp;
	register char *tsr;

	tsr = ((char *) 0xFFFFFA2DL);		/* address of tsr */
	ssp = Super(0L);			/* enter supervisor mode */
	*tsr = 0x09;				/* turn break on */
	Super(ssp);				/* return to user mode */
	delay(30);				/* 0.3 second BREAK */
	ssp = Super(0L);			/* enter supervisor mode */
	*tsr = 0x01;				/* turn break off */
	Super(ssp);				/* return to user mode */
	}

hangup()			/* drop carrier by droppping DTR to modem */
	{
	Ongibit(0x10);				/* kill DTR */
	delay(50);				/* 0.5 second delay */
	Offgibit(0xEF);				/* restore DTR */
	}


                Dale Schumacher
                ..ihnp4!meccts!stag!syntel!dal
                (alias: Dalnefre')