[net.micro.atari16] Break control in the 68901

dkb-amos@HAWAII-EMH.ARPA (08/06/86)

        Could anyone tell me how to assert a break on the 1040ST
serial line.  I assume this is done with some bit pattern in the
68901 control register.

Thanks in advance.
-Dennis

bammi@cwruecmp.UUCP (08/07/86)

In article <8608052200.AA08360@ucbvax.Berkeley.EDU> dkb-amos@HAWAII-EMH.ARPA writes:
>
>        Could anyone tell me how to assert a break on the 1040ST
>serial line.  I assume this is done with some bit pattern in the
>68901 control register.
>
>Thanks in advance.
>-Dennis


I in fact did this a while back for a program, that i luckily have handy here
on the system. Here is the relevant function from the program.

--
#include <osbind.h>
/* tsr_ptr points to the 8 bit TSR register of the 68901 */

static unsigned char *tsr_ptr = (char *)0x00fffa2d; /* See St internals      */
static long *hz_200 =  (long *)0x000004ba; /* Yes the Hitch Hikers Guide
		 			      is wrong!! */
/*
 * send a break
 * Modifies Bit 3 in the TSR (reg 23) of the Mfp
 */

sbreak()
{
	register long save_ssp;
	register long time;

	save_ssp = Super(0L);	/* Super Mode */

	/* set bit 3 of the TSR */
	*tsr_ptr |= (unsigned char)8;

	
	/* wait for 250 ms -- you can adjust the duration
	 * 250 ms seems to be almost a universal figure for break
	 * duration.
         */
	time = *hz_200 + 50;
	while(*hz_200 < time)
		/* wait */ ;

	/* reset bit 3 of the tsr */
	*tsr_ptr &= (unsigned char)~8;

	Super(save_ssp);	/* Back to user Mode */
}
--

-- 
					Jwahar R. Bammi
 		        Usenet:  .....!decvax!cwruecmp!bammi
		        CSnet:  bammi@case         Arpa:  bammi%case@csnet-relay
			CompuServe:  71515,155