APPENDIX A: Circuit diagram
Contents
E2PROM Program

APPENDIX  B:  ASSEMBLY  PROGRAM  LISTING:

Contents:

E2PROM  Program
Order of Subroutines
Constants Definition
Variables Definition
Keycodes
 

Program Listing:
 
Add Adds two floating point numbers
Alarm Check to see if the next measurement is due yet
Almset Get the measurement period from the user
Almvis Get viscosity measurement range from the user
Calib Calibration viscosity measurement 
Chk1 Finds the maximum motor speed, where angle is < 170 degrees
Chk2 Finds the minimum motor speed, where angle is > 0
Chk3 Checks that maximum motor speed > minmum motor speed
Clkset User sets the time 
Clock Updates the time and displays it if appropriate flag is set
Divide Divides two floating point numbers
Equals Sets a floating point equal to another
Err Displays the error code
Error Displays the error code and waits for a keypress
Fpint Converts a floating point number to a two byte positive integer
Init Initialises certain necessary variables: called first after a sytstem reset
Input Get a floating point number from the user
Intfp Convert a two byte integer to positive floating point format
Keyb Scan and debounce the keyboard 
Main Main driver routine for all the viscosity programs
Mark Reads 'Mark' of the mark/space output from the mechanism
Meas Actual viscosity measurement
Measno Get number of measurements required from the user
Mlt Multiply two 32 bit integers
Mult Multiply two floating point numbers
Norm Normalise a floating point number 
Pb2 Program B2: Continuous viscosity measurement
Pb3 Program B3: Timed viscosity measurements, displaying real time
Pb4 Program B4: Timed viscosity measurements, displaying elapsed time
Pc Program C: Scan through results 
Print Print a floating point number on the display
Range Finds minimum and maximum motor speeds for a measurement
Read Reads mechanism: Angle and motor speed
Recip Takes the reciprocal of a floating point number
Regld Load all registers from the stack
Regsv Save all registers to the stack
Reset Restarts entire system if the Rst key is pressed for > than 0.5 seconds 
Space Reads 'Space' of the mark/space output from the mechanism
Sub Subtracts two floating point numbers
Visc Read absolute, uncalibrated viscosity
Vischk Check that the measured viscosity is within the measurement range
Wait Wait for a key to be pressed

 
APPENDIX A: Circuit diagram
Contents