[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference nesbit::modular

Title:Embedded and Real Time Modular Computing Conference
Moderator:IRNBRU::GRANT
Created:Tue Sep 05 1995
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:235
Total number of notes:1091

190.0. "Watchdog timer on Intel Processor board" by RLTIME::COOK () Wed Mar 19 1997 20:30



I need an example or some explanation of how to use the watchdog timer under
Window NT on our 200Mhz Intel processor board.  Before someone points me to
the documentation on the Ayr web site, I don't have any way of printing 
postscript.  What I need is something I can mail to a customer ASAP.

ac


T.RTitleUserPersonal
Name
DateLines
190.1completely off the subjectRTOEU::EGAUTHIERAUA - Another Useful AbbreviationThu Mar 20 1997 19:1610
>the documentation on the Ayr web site, I don't have any way of printing 
>postscript.  What I need is something I can mail to a customer ASAP.

   there is an excellent windows based PS reader which can print called
   ROPS.  The kit is on the Ayr server, but I know that you can also
   find it with AltaVista.

   It blows GhostScript away.

   -Eric
190.2I prefer PsView insteadHELIX::SONTAKKEThu Mar 20 1997 22:407
    I am sorry I can NEVER get the ROPS to
    	display the correct fonts
    	printing is an absolute hack, you have to screw around the screen
    	aspect ratio until the bitmaps of your printer and the screen
    	align (or something equally stupid)
    
    You must have a different ROPS!
190.3HELIX::SONTAKKEThu Mar 20 1997 22:425
    On the topic, right on the AlphaBIOS advanced setup, you can choose the
    behaviour of the watchdog timer.  Anybody got a DMCC AlphaBIOS screen
    handy?
    
    - Vikas
190.4intel not alphaRTOEU::EGAUTHIERAUA - Another Useful AbbreviationFri Mar 21 1997 05:235
>    On the topic, right on the AlphaBIOS advanced setup, you can choose the

   The question is with regard to Intel.

   -Eric
190.5IRNBRU::GRANTIain Grant, E&RT, DTN 823-3532Thu Mar 27 1997 08:47284
Here are examples of both the Temperature Sensor / Watchdog Timer functionality
for the EBM3*-PA product.

First the Watchdog Timer

EBM3x-PA Watchdog timer example code
------------------------------------

	The following are two example sets of code to enable
the watchdog timer. The code uses the Ms-DOS Debug utility
to show an an example. The code will only runs in DOS, Windows3.X or
Windows 95. A driver would have to be written to use the watchdog
with Windows NT.

	-I is an 8 bit input from a ISA I/O address "IN  port instruction"
	-O is an 8 bit output to a ISA I/O address  "OUT port instruction"
	All number are in Hex.

	Please consult chaoter 4 of the product manual for further
details on the registers.


	The basic procedure is as follows.

	1) Reset the watchdog. 	
	2) Enable the watchdog in the required mode.

	3) To stop the watchdog trigerring write data to ISA I/O 73


	Example Sequences
	-----------------

        !This debug sequence will just set the watchdog flag
        -O 75 03	Index register 3
        -O 77 80	Reset the Watchdog timer and disable the watchdog.
        -I 73		Read card status register
        19		Bit 2 is a zero.
        -O 75 03	Index register 3
        -O 77 08	Enable the watchdog, Mode 1 ,delay 17.8mS
        -I 73		Read card status register
        1D		Bit 2 is a one.

        !This debug sequence will reset the SBC and 1.14 seconds
        -O 75 03	Index register 3
        -O 77 80	Reset the Watchdog timer and disbale the watchdog
        -I 73		Read card status register
        19		Bit 2 is a zero.
        -O 75 03	Index register 3
        -O 77 1B	Enable the watchdog, Mode 3, delay 1.14S
        !The SBC resets 1.14 seconds + 20ms delay after this command.

	!A write of any data to I/O address 73 will reset the Watchdog timer
	-O 73 FF


Martin McGregor


Next is a QBASIC example for the temperature sensor

REM
REM  Basic program to convert temperature for a PIP10D-L
REM  for a single CPU card.
REM
REM

CLS

start:
REM Initialise the variables
REM
REM

index = 0
idxport = 117
REM 75
dataport = 119
REM 77

REM AA
readtemp = 170
REM EE
startcon = 238
REM 22
stopcon = 34
REM 01
writeth = 1
REM 02
writetl = 2
REM A1
readth = 161
REM A2
readtl = 162
REM 0C
writecon = 12
REM AC
readcon = 172


REM     The temperature setting =degrees c *2
hightemp = 40 * 2
lowtemp = 10 * 2

DATA dx(5)

RESET:
REM set the index to 0
OUT idxport, index


REM input a byte from the data port

ax = INP(dataport)
PRINT "Initial Data ";
GOSUB binaryprint

dx = INT(ax / 2)

REM Input data to check if bit 2 is set
REM This indicates that the temperature system
REM is setup if a "1"

IF dx / 2 <> INT(dx / 2) THEN GOTO inited

PRINT "Initialising"

ax = writecon
cx = 8
GOSUB sendcommand

REM 2(00000010b)= Continuous convertion
ax = 2
GOSUB senddata

ax = writeth
GOSUB sendcommand
ax = hightemp
cx = 9
GOSUB senddata

ax = writetl
GOSUB sendcommand
ax = lowtemp
cx = 9
GOSUB senddata

ax = readcon
cx = 8
GOSUB sendcommand
GOSUB getdata
PRINT "config ";
GOSUB binaryprint
PRINT


ax = readth
GOSUB sendcommand
GOSUB getdata
ax = ax / 2
bx = bx / 2

PRINT "High temp set 1="; ax; "C 2="; bx; "C"

ax = readtl
GOSUB sendcommand
GOSUB getdata
ax = ax / 2
bx = bx / 2

PRINT "Low  temp set 1="; ax; "C 2="; bx; "C"


inited:

ax = startcon
GOSUB sendcommand
oldax = 0
oldbx = 0

loopr:

ax = readtemp
GOSUB sendcommand
GOSUB getdata
ax = ax / 2
bx = bx / 2

IF ax = oldax AND bx = oldbx THEN GOTO waitabit
PRINT "temperature Read 1="; ax; "C 2="; bx; "C at "; TIME$; "  ";
oldax = ax
oldbx = bx
ax = readcon
cx = 8
GOSUB sendcommand
GOSUB getdata
GOSUB binaryprint
PRINT ; " ";
ax = bx
GOSUB binaryprint
PRINT ; "-";
ax = temp
GOSUB binaryprint
waitabit:
SLEEP 1
GOTO loopr


END


binaryprint:

REM routine to display in binary 8 bit format

IF ax > 255 THEN RETURN
tx = ax
FOR x = 7 TO 0 STEP -1
        IF tx >= 2 ^ x THEN PRINT "1";  ELSE PRINT "0";
        IF tx >= 2 ^ x THEN tx = tx - 2 ^ x
NEXT x

RETURN

sendcommand:
OUT idxport, index
OUT dataport, 2
OUT dataport, 0
GOSUB senddata
RETURN



senddata:
REM ax should contain the data in decimal
REM cx should have a counter of the number of bit to send.
REM ax will be destoyed by the command
REM PRINT ax,
FOR x = 0 TO cx - 1


    IF ax / 2 <> INT(ax / 2) THEN OUT dataport, 17 ELSE OUT dataport, 0
REM     IF ax / 2 <> INT(ax / 2) THEN PRINT ; "1";  ELSE PRINT ; "0";

    ax = INT(ax / 2)


NEXT x

REM PRINT
RETURN


getdata:
ax = 0
bx = 0

REM ax should contain the data for temp 1 in decimal
REM bx should contain the data for temp 2 in decimal
REM cx should have a counter of the number of bit to receive.

REM PRINT "Data ",
FOR x = 0 TO cx - 1

temp = INP(dataport)

    IF temp / 2 <> INT(temp / 2) THEN ax = ax + 2 ^ x
    temp = INT(temp / 16)
    IF temp / 2 <> INT(temp / 2) THEN bx = bx + 2 ^ x

REM     IF temp / 2 <> INT(temp / 2) THEN PRINT ; "1";  ELSE PRINT ; "0";

NEXT x

REM PRINT
RETURN





Iain Grant
DMCC Product Support Engineer