[comp.sys.ibm.pc] Need help with Hayes 1200B software reset.

unbent@ecsvax.UUCP (Jay F. Rosenberg) (01/11/87)

	According to the documentation, it's supposed to be possible to get
the reset effect of a cold reboot (turning the machine off and on) for the
Hayes 1200B board modem by doing appropriate writes to Bit 2 of the UART's
Modem Control Register.  I've tried to implement this using Debug and
various Turbo Pascal routines, but failed miserably every time.
	Could anyone point me in the direction of a piece of software which
actually implements this documented function, or tell me how to write my
own?  Here's what the Haye's 1200B manual says:
	"To perform a processor reset, equivalent to power off/power on,
write to bit 2 of the UART's Modem Control Register (see Chapter 4).  Write
a 1, wait at least 50 ms, then write a 0 to OUT 1."
	And in Chapter 4:
	"Modem Control Register (MCR) 3FC r/w  ...
Bit 2:   Output 1 (OUT 1):   1 Resets the modem; equivalent to power
off/power on....  Must be held at 1 for at least 50 ms.
			     0 Setting for normal operation.  After
executing a reset, write a 0 to this bit to clear it."
	Any and all help would be deeply appreciated!

-- 

JAY ROSENBERG     Dept. of Philosophy     UNC     Chapel Hill, NC   27514
...{decvax,akgua}!mcnc!ecsvax!unbent                   unbent@ecsvax.UUCP
...tucc!tuccvm!ecsvax!unbent                         unbent@ecsvax.BITNET

mobo@sphinx.UUCP (01/13/87)

I have also tried this 17 different ways with no success.  If
anyone knows how, please post it.

Samuel Wilson         ..ihnp4!gargoyle!sphinx!mobo
                            FOTMOBO@UCHMVS1.Bitnet
University of Chicago, Division of Social Sciences

tim@sunybcs.UUCP (01/16/87)

>I have also tried this 17 different ways with no success.  If
>anyone knows how, please post it.

Ok, since you asked.  Here is a small program a friend of mine wrote
to do this because we both had problems with our modems not paying
attention all the time.  Thanks goes to markj at the same address
as mine.
If somebody doesnt have a C compiler, and can not translate it into
another language, let me know and I will send you a uuencoded version
of sethayes.exe
Program follows my signature.

--------
____________   ____/--\____ 
\______  ___) (   _    ____)     "Damn it Jim!,
     __\ \____/  / `--'            I'm a programmer not a Doctor!"   
     )           `|=(-
     \------------'
   Timothy D. Thomas                 SUNY/Buffalo Computer Science
   UUCP:  [decvax,dual,rocksanne,watmath,rocksvax]!sunybcs!tim
   CSnet: tim@buffalo,   ARPAnet: tim%buffalo@CSNET-RELAY  

------cut here-------cut here------cut here-------cut here----------
/***
 ***  sethayes.c -  Mark D. Johnson         July 1, 1985  V1.0
 ***
 ***  A short program to force my Hayes 1200b to pay attention
 ***  to communication programs other than Smartcom II.  Performs
 ***  a software reset directly on the UART registers.  Modem must
 ***  be COM1 for the reset to work.
 ***
 ***  Special thanks to TDT for his assistance in research.
 ***/

showregs() /* print UART register values */
{
int x1,x2,x3,x4,x5,x6,x7;              /* register holders */

     x1 = inp(0x3f8);
     x2 = inp(0x3f9);
     x3 = inp(0x3fa);
     x4 = inp(0x3fb);
     x5 = inp(0x3fc);
     x6 = inp(0x3fd);
     x7 = inp(0x3fe);

     printf("%d %d %d %d %d %d %d\n",x1,x2,x3,x4,x5,x6,x7);
}


main ()   /* perform software reset on COM1 port */
{
     int i;                            /* do nothing variable */

     printf("before reset: \n");
     showregs();                       /* show values before */

     outp(0x3fc,4);                    /* set reset bit */

     for (i = 0; i < 32000; i++);      /* waste time - necessary for reset */

     outp(0x3fc,3);                    /* init values needed */

     printf("\nfinal setting:\n");
     showregs();                       /* show values after */

}