Open Collections

UBC Theses and Dissertations

UBC Theses Logo

UBC Theses and Dissertations

An automated sample line for the preparation of O¹⁸ /O¹⁶ isotope analyses from water samples 1982

You don't seem to have a PDF reader installed, try download the pdf

Item Metadata

Download

Media
UBC_1982_A6_7 W49.pdf [ 7.98MB ]
Metadata
JSON: 1.0052993.json
JSON-LD: 1.0052993+ld.json
RDF/XML (Pretty): 1.0052993.xml
RDF/JSON: 1.0052993+rdf.json
Turtle: 1.0052993+rdf-turtle.txt
N-Triples: 1.0052993+rdf-ntriples.txt
Citation
1.0052993.ris

Full Text

AN AUTOMATED SAMPLE LINE FOR THE PREPARATION OF 0 1 8 / 0 1 6 ISOTOPE ANALYSES FROM WATER SAMPLES by PETER WHAITE B.Eng. ( E l e c t r i c a l ) The U n i v e r s i t y of New S o u t h W a l e s , 1973 A THESIS SUBMITTED IN PARTIAL FULFILMENT OF THE REQUIREMENTS FOR THE DEGREE OF MASTER OF SCIENCE i n t h e Department of G e o p h y s i c s and Astronomy We a c c e p t t h i s t h e s i s as c o n f o r m i n g t o th e r e q u i r e d s t a n d a r d . The U n i v e r s i t y of B r i t i s h C o l u m b i a Q September, 1982 I n p r e s e n t i n g t h i s t h e s i s i n p a r t i a l f u l f i l m e n t o f t h e r e q u i r e m e n t s f o r an a d v a n c e d d e g r e e a t t h e U n i v e r s i t y o f B r i t i s h C o l u m b i a , I a g r e e t h a t t h e L i b r a r y s h a l l make i t f r e e l y a v a i l a b l e f o r r e f e r e n c e and s t u d y . I f u r t h e r a g r e e t h a t p e r m i s s i o n f o r e x t e n s i v e c o p y i n g o f t h i s t h e s i s f o r s c h o l a r l y p u r p o s e s may be g r a n t e d by t h e h e a d o f my d e p a r t m e n t o r by h i s o r h e r r e p r e s e n t a t i v e s . I t i s u n d e r s t o o d t h a t c o p y i n g o r p u b l i c a t i o n o f t h i s t h e s i s f o r f i n a n c i a l g a i n s h a l l n o t be a l l o w e d w i t h o u t my w r i t t e n p e r m i s s i o n . D e p a r t m e n t o f O e o P v W S T l C . ^ ^ ' rl^n^QVQc^HV The U n i v e r s i t y o f B r i t i s h C o l u m b i a 1956 Main Mall V a n c o u v e r , Canada V6T 1Y3 ii A b s t r a c t An a u t o m a t e d sample p r e p a r a t i o n l i n e has been d e v e l o p e d t o e q u i l i b r a t e water s a m p l e s f o r d e t e r m i n a t i o n o f t h e i r oxygen i s o t o p e r a t i o . P r e l i m i n a r y e s t i m a t e s put t h e r e p e a t a b i l i t y of t h e sample p r e p a r a t i o n methods a t a p p r o x i m a t e l y 0.04°/oof a f i g u r e t h a t compares v e r y f a v o u r a b l y w i t h t h e p r e s e n t s t a t e o f t h e a r t . A n o t e w o r t h y f e a t u r e of our sample l i n e , i s t h a t t e m p e r a t u r e c o n t r o l i s u n n e c e s s a r y d u r i n g sample e q u i l i b r a t i o n . E r r o r s a r i s i n g from n o n - c o n s t a n t t e m p e r a t u r e c o n d i t i o n s a r e p r e v e n t e d by s i m u l t a n e o u s l y s a v i n g a l l of t h e e q u i l i b r a t e d gas samp l e s i n s e p a r a t e r e s e r v o i r s when t h e e q u i l i b r a t i o n r e a c t i o n i s c o m p l e t e . S e v e r a l o t h e r i n n o v a t i o n s i n sample r a c k d e s i g n a r e a l s o d e s c r i b e d . T h e s e a r e : a c i r c u l a r r a c k geometry; an impr o v e d , i n e x p e n s i v e , m a g n e t i c s t i r r e r d e s i g n t o a g i t a t e w ater sa m p l e s ; a P e l t i e r c o o l i n g d e v i c e t o t r a p water v a p o u r ; and t h e use of s t a n d a r d P y r e x t e s t t u b e s as e q u i l i b r a t i o n f l a s k s . The p r e p a r a t i o n l i n e i s h i g h l y m o d u l a r . Up t o s i x t e e n r a c k s , e a c h c a p a b l e o f p r e p a r i n g s i x t e e n s a m p l e s , can be i n c l u d e d i n t h e s y s t e m . Racks may be removed, r e p a i r e d or m o d i f i e d , and r e p l a c e d , w i t h o u t d i s t u r b i n g t h e o p e r a t i o n of any o t h e r r a c k s i n t h e s y s t e m . The c u r r e n t c o n f i g u r a t i o n i s a minimum s y s t e m w i t h o n l y one r a c k . The programming c o n c e p t s u s e d t o c o n t r o l o p e r a t i o n of t h e s y s t e m a r e new t o t h i s a p p l i c a t i o n , and hence a r e a s i g n i f i c a n t c o n t r i b u t i o n . A m u l t i - t a s k i n g e x e c u t i v e a l l o c a t e s r e s o u r c e s amongst t h e r a c k s on a p r i o r i t y b a s i s . By u s i n g l i n k e d l i s t s t r u c t u r e s , t h e o p e r a t i n g s y s t e m m a x i m i s e s r e s o u r c e and i i i p r o c e s s o r u t i l i s a t i o n , b u t does n o t compromise f l e x i b i l i t y and m o d u l a r i t y . The o p e r a t o r c an s u b m i t any r a c k f o r p r e p a r a t i o n a t any t i m e , and t h e s y s t e m c o u l d , w i t h s i x t e e n r a c k s , p r e p a r e a f u l l l o a d o f 256 samples i n a day. A s i m p l e h a n d s h a k i n g i n t e r f a c e has been p r o v i d e d t o c o n t r o l t h e r e l e a s e o f samples f o r a n a l y s i s . T h i s s h o u l d make i t p o s s i b l e t o c o n n e c t t h e sample l i n e t o any mass s p e c t r o m e t e r c a p a b l e o f t h e a u t o m a t e d a n a l y s i s o f c a r b o n d i o x i d e . The u s e r c o n t r o l s sample l i n e o p e r a t i o n by commands e n t e r e d on a t e l e t y p e k e y b o a r d . The command l a n g u a g e i s d e l i b e r a t e l y u n s t r u c t u r e d , and u s e r s c a n t y p e i n " n a t u r a l " E n g l i s h s e n t e n c e s i f t h e y w i s h . A l l sy s t e m o p e r a t i o n s and u s e r s e n t e n c e s a r e p r i n t e d on t h e t e l e t y p e t o p r o v i d e a permanent r e c o r d f o r l a t e r s c r u t i n y . F i n a l l y a manual command r e p e r t o i r e has been p r o v i d e d . I t al-lows t h e o p e r a t o r c o m p l e t e c o n t r o l o v e r any r a c k . A l l s o l e n o i d s , r e g i s t e r s , and c o n t r o l l i n e s , c a n be m a n i p u l a t e d on an i n d i v i d u a l b a s i s from t h e t e l e t y p e k e y b o a r d . iv TABLE OF CONTENTS A b s t r a c t .. •. i i T a b l e o f C o n t e n t s i v L i s t o f F i g u r e s . ' i x L i s t o f P r o g r a m s •••• x L i s t o f T a b l e s x i L i s t o f E q u a t i o n s x i i Ac k n o w l e d g e m e n t s x i i i CHAPTER I . INTRODUCTION 1 1.1 C o n t r i b u t i o n s o f t h i s T h e s i s 1 1.2 The Measurement o f t h e Oxygen I s o t o p e R a t i o i n Water .. 3 1.2.1 Terms u s e d i n I s o t o p e A n a l y s i s 4 1.2.2 P r e p a r a t o n of Water Samples 5 1.2.3 A n a l y s i s of Samples 7 1.2.4 C o l l e c t i o n of D a t a 9 1.2.5 D a t a R e d u c t i o n Methods 11 1.2.6 P r e c i s i o n o f A n a l y s i s ... 13 1.3 P r o b l e m s i n Sample P r e p a r a t i o n . 14 1.3.1 The T e m p e r a t u r e S e n s i t i v i t y o f E q u i l i b r a t i o n .... 14 1.3.2 Sample F r a c t i o n a t i o n D u r i n g Pump Down 16 1.3.3 E q u i l i b r a t i o n Time 20 1.3.4 C o n t a m i n a t i o n and M i x i n g 21 1.3.5 Water A d s o r p t i o n 22 1.4 I s s u e s i n A u t o m a t i o n 23 1.4.1 A d v a n t a g e s of A u t o m a t i o n 24 1.4.2 The D i s a d v a n t a g e s , o f A u t o m a t i o n 25 CHAPTER I I . INNOVATIONS IN THE MECHANICAL DESIGN 27 2.1 O r g a n i s a t i o n 27 2.1.1 I n n o v a t i o n s i n Rack C o n s t r u c t i o n 27 2.1.2 Sample P r e p a r a t i o n - Sample R a c k s 27 2.1.3 The Mass S p e c t r o m e t e r L i n e 29 2.1.4 G e n e r a l S e r v i c e s - The M a i n L i n e 29 2.1.5 I n t e r c o n n e c t i o n s 30 2.2 The Sample R a c k s 32 2.2.1 Rack O v e r v i e w 32 2.2.2 Rack O r g a n i s a t i o n 33 2.2.3 The T e m p e r a t u r e - P r o b l e m 34 2.2.4 U s i n g Sample R e s e r v o i r s 35 2.2.5 R e - e q u i l i b r a t i o n i n t h e R e s e r v o i r s 36 2.2.6 The Sample F l a s k A s s e m b l y 38 2.2.7 The R e s e r v o i r s - C o n s t r u c t i o n and Volume 40 2.2.8 Sample A g i t a t i o n 42 2.2.9 The M a g n e t i c S t i r r e r s 43 V 2.3 The Main L i n e 45 2.3.1 The Main L i n e M a n i f o l d 45 2.3.2 The Vacuum Pump 46 2.3.3 P r e s s u r e Gauges 47 2.3.4 The C 0 2 S u p p l y 48 2.4 The Mass S p e c t r o m e t e r L i n e 48 2.4.1 The Gas L i n e s 48 2.4.2 A P e l t i e r C o o l e d V apour T r a p 49 CHAPTER I I I . HARDWARE ORGANIZATION AND OPERATION 52 3.1 S y s t e m O r g a n i z a t i o n 52 3.1.1 System Buses 52 3.1.2 System Modules 54 3.1.3 System Memory Map 55 3.1.4 M o d u l a r i t y 56 3.2 The M i c r o p r o c e s s o r (TM9980) 56 3.3 Random A c c e s s Memory 58 3.4 EPROM Memory 59 3.5 The System I/O P o r t 60 3.6 The U s e r I/O P o r t 60 3.7 The S e r i a l Communication P o r t 61 3.8 Bus E x p a n s i o n I n t e r f a c e 61 3.9 The A n a l o g u e - t o - D i g i t a l C o n v e r t e r 61 3.10 The CMOS E x p a n s i o n Bus 62 3.10.1 Bus I n t e r r u p t s 63 3.11 The Sample Rack Hardware 63 3.11.1 Rack Hardware O r g a n i s a t i o n 63 3.11.2 Rack R e g i s t e r A d d r e s s i n g 65 3.11.3 The Rack S t a t u s R e g i s t e r 66 3.11.4 The Rack C o n t r o l R e g i s t e r 68 3.11.5 The S o l e n o i d D r i v e r R e g i s t e r s 68 3.12 The M a s t e r C o n t r o l B o a r d 69 3.12.1 M a s t e r C o n t r o l F u n c t i o n s 69 CHAPTER IV. THE OPERATING SYSTEM 72 4.1 SYSTEM OVERVIEW 72 4.2 TMS9980 S o f t w a r e T e c h n i q u e s 73 4.2.1 Workspace P o i n t e r (WP) 73 4.2.2 The Program C o u n t e r (PC) 74 4.2.3 The S t a t u s R e g i s t e r (ST) 74 4.2.4 The Program S t a t e V e c t o r (PSV) 75 VI 4.2.5 C o n t e x t S w i t c h i n g 75 4.3 The Task C o n t r o l B l o c k (TCB) 77 4.4 L i n k e d L i s t s 79 4.4.1 The H e a d p o i n t e r 79 4.4.2 The F o r w a r d P o i n t e r 80 4.4.3 A d v a n t a g e s of L i s t S t r u c t u r e s 80 4.4.4 L i s t O p e r a t i o n s 81 4.5 Memory Management 83 4.5.1 The F r e e L i s t (Q.FRE) 84 4.5.2 A l l o c a t i n g and D e - a l l o c a t i n g Memory 85 4.6 A c c e s s i n g T a s k s '86 4.6.1 The R e s i d e n t Task L i s t (Q.TSK) 87 4.7 E x e c u t i o n of T a s k s 87 4.7.1 The E x e c u t i o n Queue (Q.XEC) 88 4.7.2 D i s p a t c h i n g o r A l l o c a t i o n 88 4.7.3 D e - a l l o c a t i o n 89 4.8 S t a r t i n g t h e System (STARTUP) : 90- 4.8.1 S t a r t u p P r o c e d u r e 90 4.9 I n t r o d u c i n g New T a s k s (RELINQ) 92 4.10 I n a c t i v a t i n g T a s k s f o r a G i v e n Time 93 4.10.1 The T i m e r Queue (Q.TMR) 94 4.10.2 S e t t i n g t h e A l a r m (WAIT) 94 4.10.3 The System C l o c k (SRVCLK) 95 4.10.4 The C l o c k Update Task (TSKCUD) 96 4.11 E r r o r C o n d i t i o n s 98 .4.11.1 The E r r o r Queue (Q.ERR) -. 99 4.11.2 G e t t i n g on t h e Queue (WAIT.ERR) 100 4.11.3 G e t t i n g O f f t h e E r r o r Queue 100 4.12 R e s o u r c e Management 102 4.12.1 Semaphores and t h e C r i t i c a l S e c t i o n ....102 4.12.2 S e m a p h o r e • S t r u c t u r e - t h e Semaphore T a b l e (SEMTAB) .104 4.12.3 R e s e r v i n g a R e s o u r c e (RESERV) .105 4.12.4 R e l e a s i n g a R e s o u r c e (RELESE) 106 4.12.5 U s i n g RESERV and RELESE .106 4.13 W a i t i n g f o r I n t e r r u p t s (WAIT.INT) 109 4.14 S e r v i c i n g I n t e r r u p t s 110 4.15 S e r v i c i n g CMOS Bus I n t e r r u p t s (SRVBUS) 111 4.16 U s i n g t h e A n a l o g u e - t o - D i g i t a l C o n v e r t e r 112 4.17 C h a n g i n g Rack R e g i s t e r s 113 4.17.1 The Rack R e f r e s h T a b l e (RCKTAB) 114 4.17.2 The LED T a b l e (LEDTAB) 114 4.17.3 R e f r e s h i n g t h e Racks (SRVDSP) 115 vii 4.18 F i n i s h i n g T a s k s (FINISH) 117 CHAPTER V. THE OPERATOR INTERFACE 118 5.1 A D e f i n i t i o n 118 5.2 I d e a s 119 5.3 P r a c t i c a l i t i e s 119 5.4 D e s i g n i n g t h e I n t e r f a c e 120 5.4.1 C h o o s i n g I n p u t and O u t p u t D e v i c e s 120 5.4.2 D e v e l o p i n g a " N a t u r a l " Command Language 122 5.4.3 S o f t w a r e T o o l s .• 126 5.5 The Manual and Command T a s k s 128 CHAPTER V I . AUTOMATED SAMPLE PROCESSING METHODS 131 6.1 The Rack P r o c e s s i n g T a s k 131 6.1.1 Sample P r e p a r a t i o n 132 6.1.2 E q u i l i b r a t i o n 132 6.1.3 Sample S t o r a g e , 133 6.1.4 Sample A n a l y s i s 134 6.2 The Pumping A l g o r i t h m 135 6.3 Rack E r r o r s 136 CHAPTER V I I . PRELIMINARY TESTS AND RESULTS 138 7.1 P r e c i s i o n o f Sample P r e p a r a t i o n 138 7.1.1 Methods and R e s u l t s 138 7.1.2 D i s c u s s i o n o f R e s u l t s 139 7.2 E r r o r s from C r o s s C o n t a m i n a t i o n 141 7.2.1 Methods and R e s u l t s ...141 7.2.2 D i s c u s s i o n o f R e s u l t s 143 APPENDIX I . CIRCIUT DESCRIPTION AND OPERATION 144 A1.1 The TMS9980 M i c r o p r o c e s s o r 144 A1.1.1 M i c r o p r o c e s s o r O p e r a t i o n 144 A1.2 O p e r a t i o n o f t h e A n a l o g u e - t o - D i g i t a l C o n v e r t e r 146 A1.3 The CMOS Bus I n t e r f a c e ..148 A1.3.1 CMOS Bus L i n e s 148 A1.3.2 L e v e l T r a n s l a t i o n 150 A1.3.3 Ready H a n d s h a k i n g 151 A1.3.4 I n t e r r u p t L i n e Debounce C i r c u i t 153 A1.4 The Rack I n t e r f a c e 155 A1.4.1 The Rack S e l e c t . L o g i c and C o n t r o l L i n e s 155 v i i i A1.4.2 Rack S t a t u s R e g i s t e r and I n t e r r u p t G e n e r a t i o n ..156 A1.4.3 Rack W r i t e O p e r a t i o n s 158 A1.5 The M a s t e r C o n t r o l B o a r d 159 APPENDIX I I . PROGRAM LISTING OF THE SAMPLE LINE OPERATING SYSTEM 1 62 APPENDIX I I I . REFERENCES CONSULTED IN THIS THESIS 164 ix L I S T OF FIGURES 1.1 DEL E r r o r Due t o a M i s m a t c h i n T u b i n g C o n d u c t a n c e 19 2.1 M e c h a n i c a l O r g a n i s a t i o n of t h e Sample L i n e 31 2.2 The Sample P r e p a r a t i o n U n i t 36 2.3 The Sample F l a s k A s s e m b l y 40 2.4 R e s e r v o i r C o n s t r u c t i o n 42 2.5 S c h e m a t i c D i a g r a m showing C o n s t r u c t i o n o f t h e M a g n e t i c S t i r r e r s 44 2.6 P e l t i e r C o o l e d Vapour T r a p A s s e m b l y 51 3.1 System O r g a n i s a t i o n 53 3.2 Rack R e g i s t e r & Hardware O r g a n i s a t i o n 64 3.3 Rack R e g i s t e r A d d r e s s i n g 66 3.4 The Rack S t a t u s R e g i s t e r 67 3.5 The Rack C o n t r o l R e g i s t e r 68 3.6 The M a s t e r C o n t r o l and S t a t u s R e g i s t e r s 70 4.1 C o n t e x t S w i t c h u s i n g BLWP I n s t r u c t i o n 77 4.2 A S i m p l e L i s t S t r u c t u r e 80 4.3 D i s p a t c h i n g a Task f o r E x e c u t i o n 90 4.4 An Example of D e a d l o c k 109 7.1 R e s u l t s f r o m I d e n t i c a l Gas Samples 139 7.2 R e s u l t s f r o m I d e n t i c a l Water Samples 140 7.3 R e s u l t s of t h e C r o s s C o n t a m i n a t i o n . T e s t 143 A1.1 T y p i c a l WRITE and READ c y c l e 145 A1.2 S i m p l i f i e d S c h e m a t i c o f ADC 147 A1.3 READY H a n d s h a k i n g C i r c u i t 151 A1.4 H a n d s h a k i n g S i g n a l s 152 A1.5 Bus I n t e r r u p t L i n e D e b o u n c i n g 154 A1.6 Rack S e l e c t L o g i c 155 A1.7 Rack S t a t u s and I n t e r r u p t L o g i c 157 A1.8 Rack W r i t e L o g i c .....158 A1.9 Sample R e q u e s t I n t e r r u p t L o g i c 160 X L I S T OF PROGRAMS 4.1 P a s c a l s t r u c t u r e o f a t a s k c o n t r o l b l o c k 78 4.2 TCBGET - c r e a t e s a TCB/workspace s t r u c t u r e 85 4.3 DISOLV - d i s s o l v e s t h e TCB/workspace s t r u c t u r e 85 4.3 R E L I N G Q u i s h i n g t h e CPU 92 4.4 P r o c e d u r e t o p l a c e TCB on t i m e r queue 95 4.5 S y s t e m c l o c k s e r v i c e r o u t i n e (SRVCLK) 96 4.6 The c l o c k u p d a t e t a s k (TSKCUD) 98 4.6 W a i t i n g f o r e r r o r s (WAIT.ERR) 100 4.7 U s i n g semaphore p r i m i t i v e s t o p r o t e c t a C r i t i c a l S e c t i o n 103 4.8 Semaphore s t r u c t u r e (SEMTAB) 105 4.8a R e s e r v i n g r e s o u r c e s (RESERV) 106 4.9 R e l e a s i n g r e s o u r c e s (RELESE) 106 4.10 W a i t i n g f o r I n t e r r u p t s (WAIT.INT) .110 4.11 CMOS Bus i n t e r r u p t s e r v i c e r o u t i n e (SRVBUS) 112 4.12 G e t t i n g ADC v a l u e s (ADCGET & SRVADC) 113 4.13 F i n i s h i n g T a s k s (FINISH) 115 xc L I S T OF TABLES 3.1 System Memory Map 55 xi i L I S T OF EQUATIONS 1 D e f i n i t i o n of t h e DEL f u n c t i o n 4 2 The e q u i l i b r a t i o n r e a c t i o n 5 3 R e l a t i o n s h i p between DEL v a l u e s o f i n i t i a l w a t er and f i n a l C 0 2 6 4 T e m p e r a t u r e s e n s i t i v i t y o f e q u i l i b r a t i o n 14 5 B a t c h d i s t i l l a t i o n f r a c t i o n a t i o n 16 6 DEL e r r o r as a f u n c t i o n of r e s i d u a l a i r p r e s s u r e 17 7 DEL e r r o r due t o mismatch i n t u b i n g c o n d u c t a n c e 17 X i i i Acknowledgements The s u c c e s s f u l c o m p l e t i o n o f l a r g e p r o j e c t s u c h a s t h i s w o uld not have been p o s s i b l e w i t h o u t t h e s u p p o r t and encouragement of many p e o p l e . P r i m a r i l y , I must thank my s u p e r v i s e r , R.D. R u s s e l l . H i s a c c e p t a n c e of my c r e d e n t i a l s , and h i s immediate o f f e r o f f i n a n c i a l s u p p o r t , a f t e r I a r r i v e d unannounced, unknown, and u n e x p e c t e d , c a n n o t be f o r g o t t e n . The e a r l y i n f l u e n c e s of R.D. R u s s e l l , W.F. S l a w s o n , T.K. A h e r n , and R.D. Meldrum were v e r y i m p o r t a n t . The need f o r a sample p r e p a r a t i o n l i n e was p e r c e i v e d a f t e r s e p a r a t e v i s i t s by R.D. R u s s e l l and T.K. A h e r n t o D a n s g a a r d ' s l a b o r a t o r y i n Denmark. The t e c h n i q u e of u s i n g sample r e s e r v o i r s a r o s e from d i s c u s s i o n of D a n s g a a r d ' s a p p a r a t u s by members of t h e above g r o u p . T h i s , and many of t h e i r o t h e r i d e a s , were g i v e n t o me d u r i n g t h e i n i t i a l s t a g e s of t h e p r o j e c t . S u p p o r t from t h e t e c h n i c a l s t a f f a t t h e Department of G e o p h y s i c s and Astronomy was e s s e n t i a l a s t h e d e s i g n of t h e sample r a c k r e a c h e d i t ' s c o n s t r u c t i o n s t a g e s . In p a r t i c u l a r K.D. S c h r e i b e r and W. S e i p gave me t h e s u b s t a n t i a l b e n e f i t of t h e i r a c c u m u l a t e d e x p e r i e n c e s , and pounded many of my i m p r a c t i c a l d e s i g n s i n t o s o m e t h i n g w o r k a b l e . F o r t h e f i n a l s t a g e s t h e f o r m a t i o n of t h e G e o p h y s i c a l I n s t r u m e n t a t i o n Group has p r o d u c e d a v e r y c o n d u c i v e and e x c i t i n g l a b o r a t o r y e n v i r o n m e n t . I am p a r t i c u l a r l y g r a t e f u l t o B.B. N a r o d and J . B e n n e s t f o r t h e d i s c u s s i o n s w i t h them t h a t l e d t o t h e d e v e l o p m e n t of a new d e s i g n i n magnet s t i r r e r s t o a g i t a t e t h e water s a m p l e s . The U.B.C. Computing C e n t r e has p r o v i d e d c o n t i n u i n g , and x i v r e l i a b l e s u p p o r t . "The m a i n t e n a n c e o f an HDLC l i n k t o o u r m i n i - c o m p u t e r s , and t h e p r o v i s i o n of e x t e n s i v e f i l e a nd e d i t i n g f a c i l i t i e s , have b o t h made my t a s k c o n s i d e r a b l y e a s i e r . B o t h G.K.C. C l a r k e and R.D. R u s s e l l were r e s p o n s i b l e f o r r e a d i n g t h i s t h e s i s . I s u s p e c t t h a t my w r i t i n g w o u l d have been i m p o s s i b l e t o r e a d w i t h o u t t h e i r many comments, s u g g e s t i o n s , and r e v i s i o n s . D u r i n g t h e p r o j e c t , f i n a n c i a l a s s i s t a n c e was r e c e i v e d i n t h e f o r m o f t e a c h i n g and r e s e a r c h a s s i s t a n t s h i p s , and o f a U.B.C. G r a d u a t e F e l l o w s h i p . The e n t i r e p r o j e c t was f u n d e d by NSERC o p e r a t i n g and s t r a t e g i c g r a n t s (A720 and G852) g i v e n t o R.D. R u s s e l l . A g a i n , my a p p r e c i a t i o n f o r h i s c o n s i d e r a b l e f i n a n c i a l s u p p o r t . M o s t l y , my t h a n k s t o P e t r a f o r h e r p e r s o n a l s u p p o r t i n a new c o u n t r y . CHAPTER I . INTRODUCTION 1 1.1 CONTRIBUTIONS OF THIS THESIS An a u t o m a t e d sample p r e p a r a t i o n l i n e has l o n g been r e c o g n i s e d as e s s e n t i a l t o oxygen i s o t o p e a n a l y s i s . D a n s g a a r d had e s t a b l i s h e d s u c h a f a c i l i t y i n Denmark by 1975, and r e c e n t l y VG M i c r o m a s s have r e a l i s e d t h e c o m m e r c i a l p o s s i b l i t i e s by i n t r o d u c i n g t h e i r model MM5020 C 0 2 / H 2 0 e q u i l i b r a t i o n s y s t e m ( M i c r o m a s s , 1978). The M i c r o m a s s sample l i n e i s a more u p - t o - d a t e v e r s i o n of D a n s g a a r d ' s . I t f e a t u r e s a c o n s t a n t t e m p e r a t u r e a i r b a t h t o m a i n t a i n an even e q u i l i b r a t i o n t e m p e r a t u r e , an a d j u s t a b l e l a t e r a l o s c i l l a t i n g m o t i o n f o r m i x i n g t h e water s a m p l e s , and a r e m o t e l y s i t u a t e d "mimic" d i a g r a m w h i c h may be employed t o o p e r a t e t h e s y s t e m . T h i s t h e s i s d e s c r i b e s a sample l i n e i n c o r p o r a t i n g new s o l u t i o n s t o t h e p r o b l e m s of C 0 2 / H 2 0 e q u i 1 i b r a t i o n . T r a d i t i o n a l l y , e q u i l i b r a t e d C 0 2 / H 2 0 samples a r e m a i n t a i n e d a t a c o n s t a n t t e m p e r a t u r e w h i l s t a w a i t i n g a n a l y s i s . The extreme t e m p e r a t u r e s e n s i t i v i t y o f t h e e q u i l i b r a t i o n r e a c t i o n p u t s s e v e r e c o n s t r a i n t s on t h e t e m p e r a t u r e r e g u l a t o r , and r e q u i r e s t h e use o f e x t r e m e l y s t a b l e c o n t r o l l e r s . I n o u r s y s t e m e q u i l i b r a t e d C 0 2 from e v e r y sample i s s i m u l t a n e o u s l y i s o l a t e d i n a bank of r e s e r v o i r s . The t e m p e r a t u r e s t a b i l i t y becomes u n i m p o r t a n t p r o v i d e d t h a t a l l s a m p l e s e x p e r i e n c e t h e same t e m p e r a t u r e h i s t o r y . Sample f r a c t i o n a t i o n d u r i n g e v a c u a t i o n o f t h e a i r s p a c e Sec 1 .1 2 above t h e water sample i s a v o i d e d i f e v e r y sample i s pumped e q u a l l y . I n s t e a d o f pumping t h r o u g h r a t e - d e t e r m i n i n g c a p i l l a r i e s , t h e sample l i n e u s e s c i r c u l a r symmetry t o a c h i e v e t h e same e f f e c t . The p r o b l e m s of c a p i l l a r y m o u n t i n g , c l e a n i n g , and slow pump down a r e t h u s a v o i d e d . The sample p r e p a r a t i o n s y s t e m i s h i g h l y m o d u l a r . The b a s i c u n i t i s t h e r a c k w h i c h may, a t any t i m e , be c o n n e c t e d or d i s c o n n e c t e d from t h e s y s t e m , w i t h o u t i n t e r f e r i n g w i t h o t h e r r a c k s . M o d u l a r i t y f a c i l i t a t e s r e p a i r and m o d i f i c a t i o n of r a c k s w i t h a minimum o f d i s t u r b a n c e , and a l l o w s t h e s y s t e m t o be e x t e n d e d a t w i l l . W r i t i n g t h e s o f t w a r e t o run t h e sample p r e p a r a t i o n l i n e has been t h e most s a t i s f y i n g a s p e c t of t h i s p r o j e c t . I have v i e w e d t h e mass s p e c t r o m e t e r as a r e s o u r c e , and t h e sample r a c k s as u s e r s i n a m u l t i - u s e r e n v i r o n m e n t . By d e s i g n i n g an o p e r a t i n g s y s t e m from t h i s p e r s p e c t i v e i t i s p o s s i b l e t o queue r a c k s f o r p r e p a r a t i o n and a n a l y s i s a t any t i m e , i r r e s p e c t i v e of t h e s t a t u s of o t h e r r a c k s i n t h e s y s t e m . To my knowledge no o t h e r a u t o m a t e d l i n e o p e r a t e s i n t h i s manner. U s u a l l y a l l r a c k s must be l o a d e d w i t h samples b e f o r e any p r e p a r a t i o n can b e g i n , and t h e s y s t e m i s t h e n f u l l y o c c u p i e d u n t i l t h e l a s t a n a l y s i s ends. O p e r a t i n g s y s t e m t e c h n i q u e s i n memory management, r e s o u r c e s h a r i n g , and t a s k s c h e d u l i n g have been u s e d e x t e n s i v e l y . The r e s u l t i n g l i s t - s t r u c t u r e d a p p r o a c h a l l o w s p r o g r a m s and t a s k s t o be added, c h a n g e d and e x e c u t e d w i t h g r e a t f l e x i b i l i t y and s i m p l i c i t y . U s i n g some of t h e more p r i m i t i v e a s p e c t s of a r t i f i c i a l i n t e l l i g e n c e , a r e a d i l y u n d e r s t a n d a b l e command l a n g u a g e w i t h an e x t e n s i v e v o c a b u l a r y has been d e v e l o p e d . Sec 1 .1 3 C r i t i c a l a r e a s a r e p r o v i d e d w i t h s o f t w a r e p r o t e c t i o n a g a i n s t o p e r a t o r i n t e r f e r e n c e , t h e r a c k p r o c e s s i n g a l g o r i t h m c h e c k s e x t e n s i v e l y f o r f o r s e e a b l e p r o b l e m s , and a t a s k c a n be s c h e d u l e d t o r u n p e r i o d i c s y s t e m t e s t i n g p r o c e d u r e s . A c o m p l e t e l o g of s y s t e m e v e n t s i s o u t p u t on t e l e t y p e and s h o u l d a l l o w c o r r e c t i o n of u n f o r e s e e a b l e c o n d i t i o n s as w e l l as p r o v i d i n g d a t a f o r f u t u r e p r o g r a m d e v e l o p m e n t . An e x t r e m e l y p r o m i s i n g c o n t r i b u t i o n i s t h e d e v e l o p m e n t of m a g n e t i c s t i r r e r s t o a g i t a t e t h e sam p l e s d u r i n g e q u i l i b r a t i o n . T h e s e a r e o f a u n i q u e d e s i g n t h a t u s e s no moving p a r t s . They c a n be a s s e m b l e d q u i c k l y from i n e x p e n s i v e and commonly a v a i l a b l e components, and o p e r a t e a t e x t r e m e l y low power l e v e l s . I t i s b e l i e v e d t h a t s u c h s t i r r e r s w i l l be v a l u a b l e t o many p e o p l e f o r a v a r i e t y o f a p p l i c a t i o n s . O t h e r l e s s r a d i c a l c o n t r i b u t i o n s d e s e r v e t o be m e n t i o n e d . A c o l d t r a p has been c o n s t r u c t e d t h a t u s e s P e l - t i e r c o o l e r s t o remove water v a p o u r from e q u i l i b r a t e d gas s a m p l e s . C o o l i n g i s e a s i l y c o n t r o l l e d u s i n g e l e c t r i c a l s i g n a l s , and t h e c o n s t a n t r e p l e n i s h m e n t of l i q u i d n i t r o g e n i s no l o n g e r a p r o b l e m . F i n a l l y , but a l s o i m p o r t a n t l y , an o p t i c a l l y i s o l a t e d i n t e r f a c e , c o u p l e d w i t h a s i m p l e h a n d s h a k i n g p r o t o c o l , m i n i m i s e s t h e de p e n d e n c y o f t h e sample l i n e on t h e mass s p e c t r o m e t e r . 1.2 THE MEASUREMENT OF THE OXYGEN ISOTOPE RATIO IN WATER In a d d i t i o n t o t h e n o r m a l mass 16, t h e r e a r e two more s t a b l e i s o t o p e s of oxygen. The masses 17 and 18 o c c u r w i t h a b u n d a n c e s o f a b o u t 0.04% and 0.02% r e s p e c t i v e l y . The v a r i a t i o n of t h e 0 1 8 / 0 1 6 r a t i o i n n a t u r a l oxygen r e f l e c t s t h e p h y s i o - Sec 1 .2 4 c h e m i c a l h i s t o r y of t h e c o l l e c t e d sample. In p a r t i c u l a r t h i s r a t i o i n wa t e r and i c e s a m p l e s c a n be u s e d t o t r a c e t h e o r i g i n s of t h e samp l e , and i n t h e c a s e o f i c e s a m p l e s f r o m deep c o r e s , c a n i n d i c a t e t h e p a l e o c l i m a t i c c o n d i t i o n s t h a t p r e c i p i t a t e d t h e o r i g i n a l snow. Such d a t a i s e s s e n t i a l t o a w o r k a b l e u n d e r s t a n d i n g o f t h e d y n a m i c s o f l a r g e b o d i e s of i c e and w a t e r . In an e r a of exp a n d e d n o r t h e r n d e v e l o p m e n t t h i s knowledge c a n o n l y be b e n e f i c i a l . 1 . 2 . 1 Terms u s e d i n I s o t o p e A n a l y s i s B e c a u s e t h e n a t u r a l v a r i a t i o n o f s t a b l e i s o t o p e r a t i o s i s v e r y s m a l l i t i s c o n v e n i e n t t o r e p o r t a n a l y s e s i n terms o f t h e d i f f e r e n c e f r o m an a g r e e d i n t e r n a t i o n a l s t a n d a r d . T h i s i s t h e DEL f u n c t i o n ( E q u a t i o n 1 . 1 ) . The i n t e r n a t i o n a l l y a g r e e d The DEL v a l u e 1s d e f i n e d to r e f l e c t the small v a r i a t i o n 1n n a t u r a l Isotope r a t i o s . DEL v a l u e s a r e u s u a l l y r e p o r t e d as p a r t s per thousand (per m i l ) r e l a t i v e to an i n t e r n a t i o n a l l y a g r e e d s t a n d a r d water, V-SMOW. E q u a t i o n 1.1 D e f i n i t i o n o f t h e DEL f u n c t i o n . s t a n d a r d i s V i e n n a - S t a n d a r d Mean Ocean Water (V-SMOW) but i n p r a c t i c e c o m p a r i s o n s t a k e p l a c e w i t h a l o c a l s t a n d a r d and r e s u l t s a r e c o r r e c t e d t o a g r e e w i t h V-SMOW. The n a t u r a l r a n g e o f DEL v a l u e s i n water i s t y p i c a l l y from "50°/oo i n a r c t i c r e g i o n s t o + 2 0 ° / o o i n o c e a n w a t e r a t t h e e q u a t o r . 6(x/s)=1000(Rx/Rs -1) per mil C / o „ ) (1.1) where: Rx Rs n i i / r i u of the unknown sample, n n / n i i of the agreed s t a n d a r d , number of 0'" atoms, number of 0 1 6 atoms. Sec 1.2.1 5 1.2.2 P r e p a r a t o n o f Water Samples The d i r e c t a n a l y s i s o f 0 1 8 / 0 1 6 i n w ater i s i m p r a c t i c a l due t o t h e p o l a r n a t u r e o f t h e m o l e c u l e . The c h a r g e d m o l e c u l e s t e n d t o " s t i c k " t o s u r f a c e s w i t h i n t h e mass s p e c t r o m e t e r and c o n t a m i n a t e s u b s e q u e n t s a m p l e s . A l s o , t h e h y d r o g e n atoms i n t r o d u c e so many mass c o m b i n a t i o n s t h a t t h e mass s p e c t r u m becomes v e r y d i f f i c u l t t o i n t e r p r e t . I n s t e a d , t h e method now g e n e r a l l y i n use i s t h a t d e s c r i b e d by E p s t e i n & Mayeda (1953) and p r o c e e d s i n f o u r b a s i c s t e p s . 1. A i r i s removed from t h e e q u i l i b r a t i o n v e s s e l s . 2. C a r b o n d i o x i d e i s a d m i t t e d . 3. The w ater samples a r e e q u i l i b r a t e d w i t h C 0 2 a t a d e f i n e d t e m p e r a t u r e . 4. The e q u i l i b r a t e d C 0 2 i s w i t h d r a w n f o r measurement. W i t h t h e o r i g i n a l t e c h n i q u e , t h e w ater was f r o z e n t o -78°C b e f o r e t h e a i r was removed. T h i s a v o i d e d water l o s s and i s o t o p i c f r a c t i o n a t i o n of t h e s a m p l e s . Thawing, f r e e z i n g , and pumping were r e p e a t e d t o e l i m i n a t e t h e p o s s i b l e c o n t a m i n a t i n g e f f e c t s of g a s e s d i s s o l v e d w i t h i n t h e w a t e r . R o e t h e r (1970) d e s c r i b e d and t e s t e d a sample l i n e w h i c h e l i m i n a t e d a l l t h e t i m e c o n s u m i n g , and l a b o u r i n t e n s i v e f r e e z i n g s t e p s . U s i n g c a p i l l a r i e s and c o n t r o l l e d s h a k i n g he f i r m l y e s t a b l i s h e d t h e f e a s i b i l i t y o f modern a u t o m a t e d l i n e s . Sample p r e p a r a t i o n r e l i e s on t h e c h e m i c a l r e a c t i o n of c a r b o n d i o x i d e w i t h water t o t r a n s f e r oxygen atoms from t h e l i q u i d t o t h e g a s . M i l l s and U r e y (1939,1940) have s t u d i e d t h i s r e a c t i o n i n d e t a i l and p o i n t out t h a t i t depends on t h e pH o f t h e s o l u t i o n ( e q u a t i o n 1.2). Sec 1.2.2 6 The f i r s t r e a c t i o n i n e q u a t i o n 1.2 i s known as h y d r a t i o n and The e x a c t e q u i l i b r a t i o n r e a c t i o n depends upon the pH of the s o l u t i o n . C0». + H»0 H I C O J (1.2a) i s the h y d r a t i o n r e a c t i o n and o c c u r s i f the pH of the s o l u t i o n i s l e s s than 8. CO? + OH" ^ H C O i (1.2b) i s a b i m o l e c u l a r r e a c t i o n t h a t p r e d o m i n a t e s as the pH r i s e s above 10. E q u a t i o n 1.2 The e q u i l i b r a t i o n r e a c t i o n . p r o c e e d s w i t h a r e l a x a t i o n t i m e of a p p r o x i m a t e l y 1 m i n u t e . The a l t e r n a t i v e b i m o l e c u l a r r e a c t i o n i s a b o u t one h u n d r e d t i m e s s l o w e r so t h e a d v a n t a g e of f o r c i n g h y d r a t i o n i s o b v i o u s . U s u a l l y t h i s i s n o t n e c e s s a r y a s most n a t u r a l w a t e r i s s l i g h t l y a c i d i c . The DEL v a l u e o f t h e f i n a l e q u i l i b r a t e d C 0 2 w i l l d e p e n d on th e i s o t o p i c r a t i o of t h e c a r b o n d i o x i d e , of t h e w a t e r , and on t h e r e l a t i v e amounts of water and c a r b o n d i o x i d e . E q u a t i o n 1.3 i s s i m p l y d e r i v e d from a c o n s i d e r a t i o n of mass b a l a n c e . When The f i n a l DEL v a l u e i s a r e s u l t of the i n i t i a l d e l v a l u e s of both CO* and HiO, as w e l l as the r e l a t i v e amounts of each. A mass b a l a n c e g i v e s the f o l l o w i n g r e 1 at ionsh1p. 6(w/sw) = (p+a)/p 6 ( c / s c ) - a/p 6 ( c o / s c ) p e r mil (1.3) where: 6(w/sw) .. DEL of the sample r e l a t i v e t o s t a n d a r d H;0. 6 ( c / s c ) .. DEL of C O i e q u i l i b r a t e d w i t h the sample r e l a t i v e to COJ e q u i l i b r a t e d w i t h the s t a n d a r d . 6 ( c o / s c ) . DEL of u n e q u l 1 i b r a t e d COi r e l a t i v e to CO? e q u i l i b r a t e d w i t h the s t a n d a r d . P number of oxygen atoms 1n the water d i v i d e d by the number of oxygen atoms i n the CO:. ot* the s e p a r a t i o n f a c t o r of C O , and H i O In e q u i l i b r i u m . E x p e r i m e n t a l l y measured at 1.046 at 25°C. E q u a t i o n 1.3 R e l a t i o n s h i p between DEL v a l u e s o f i n i t i a l w a t e r and f i n a l C 0 2 . the same C 0 2 i s u s e d b o t h a s a s t a n d a r d and t o e q u i l i b r a t e t h e water s a m p l e s , t h e l a s t t e r m of t h e above e x p r e s s i o n d r o p s o u t . Sec 1.2.2 7 I t s h o u l d be n o t e d t h a t i n s u c h a c a s e t h e s t a n d a r d water i s a v i r t u a l s t a n d a r d , and t h a t l a t e r c o r r e c t i o n i s made i t s i s o t o p i c c o m p o s i t i o n . The p r o b l e m s and e r r o r s i n t r o d u c e d d u r i n g t h i s s t a g e o f t h e a n a l y s i s w i l l be d i s c u s s e d l a t e r . They i n c l u d e t h e p o s s i b i l i t y of sample f r a c t i o n a t i o n , c o n t a m i n a t i n g e f f e c t s from r e s i d u a l g a s e s , "memory" e f f e c t s from a d s o r b e d w a t e r , t h e s e n s i t i v i t y o f t h e s e p a r a t i o n f a c t o r t o t e m p e r a t u r e , and t h e t r a n s p o r t o f c a r b o n d i o x i d e i n t o a d i s s o l v e d s t a t e i n t h e s a m p l e . 1.2.3 A n a l y s i s of Samples A f t e r sample e q u i l i b r a t i o n DEL v a l u e s may be c a l c u l a t e d by m e a s u r i n g t h e r e l a t i v e a b u n d a n c e s o f 0 1 6 and 0 1 8 i n t h e e q u i l i b r a t e d g a s . The r a t i o w i l l be a l m o s t i d e n t i c a l t o h a l f t h a t e x h i b i t e d by t h e abundances of C 0 2 o f mass 44 and 46. I t ca n be measured d i r e c t l y i n a mass s p e c t r o m e t e r . The mass s p e c t r o m e t e r i s u s u a l l y o f t h e M c K i n n e y - N i e r t y p e ( N i e r , l 9 4 7 ; N i e r e t . a l , 1 9 4 7 ; McKinney e t . a l , 1 9 5 0 ) . I t f e a t u r e s a d u a l - s i d e d i n l e t s y s t e m t o f a c i l i t a t e r a p i d c o m p a r i s o n of e q u i l i b r a t e d C 0 2 a g a i n s t a w o r k i n g r e f e r e n c e , a d u a l c o l l e c t o r a s s e m b l y w h i c h a l l o w s t h e mass 44 and mass 46 i o n beams t o be measured s i m u l t a n e o u s l y , and c o m p e n s a t i o n o f t h e s m a l l e r i o n c u r r e n t w i t h a p o r t i o n of t h e l a r g e r one. The i s o t o p e f a c i l i t y a t UBC u s e s a mass s p e c t r o m e t e r of t h e M c K i n n e y - N i e r t y p e o r i g i n a l l y c o n s t r u c t e d by K o l l a r and R u s s e l l ( K o l l a r , 1 9 6 0 ) f o r t h e p r e c i s e measurement o f t h e h e a v i e r l e a d i s o t o p e r a t i o s . C o n s e q u e n t l y i t has h i g h e r r e s o l v i n g power and d i s p e r s i o n t h a n i s u s u a l i n t h e mass 44 t o 46 ra n g e and a l l o w s t h e e l i m i n a t i o n o f t h e mass 45 c o r r e c t i o n s ( C r a i g , 1957). S i n c e Sec 1.2.3 8 i t s c o n v e r s i o n a s an oxygen machine A h e r n and R u s s e l l have made e x t e n s i v e m o d i f i c a t i o n s w i t h a view t o w a r d s c o m p l e t e l y a u t o m a t e d a n a l y s i s ( A h e r n , 1972; R u s s e l l & A h e r n , 1974; A h e r n , 1980). As w e l l as c o m p l e t e l y r e w o r k i n g t h e c o l l e c t o r , t h e s o u r c e , and t h e m e a s u r i n g s y s t e m , t h e o r i g i n a l I n t e r d a t a c o n t r o l a l g o r i t h m ( R u s s e l l , B l e n k i n s o p e t . a l . , 1971) has been c o n t i n u a l l y m o d i f i e d , and s e v e r a l hardware a d d i t i o n s made t o e f f e c t i n c r e a s e d computer c o n t r o l . Random f l u c t u a t i o n s w i t h i n t h e mass s p e c t r o m e t e r and i t s m e a s u r i n g s y s t e m c o n t r i b u t e s i g n i f i a n t u n c e r t a i n t y t o t h e measurement o f an i s o t o p i c r a t i o . Much of t h i s u n c e r t a i n t y c a n be e l i m i n a t e d by a l t e r n a t e l y a d m i t t i n g gas t o t h e mass s p e c t r o m e t e r f r o m unknown and r e f e r e n c e gas r e s e r v o i r s . T h i s g e n e r a t e s a s e r i e s of unknown sample i s o t o p e r a t i o s i n t e r l e a v e d w i t h a s i m i l i a r s e r i e s from a known r e f e r e n c e . By i n t e r p o l a t i n g between t h e d a t a p o i n t s an a v e r a g e d i f f e r e n c e i n r a t i o c a n be d e r i v e d , and f r o m t h i s a DEL v a l u e of t h e sample r e l a t i v e t o t h e s t a n d a r d . To a v o i d s y s t e m a t i c e r r o r s t h e g a s e s must f l o w f r o m t h e i n l e t l i n e t o t h e s o u r c e i n t h e mass s p e c t r o m e t e r under i d e n t i c a l c o n d i t i o n s . Such c o n d i t i o n s a r e met by h a v i n g t h e i n l e t l i n e e q u a l i s e t h e mass 44 peak s i g n a l s of b o t h g a s e s b e f o r e a n a l y s i s b e g i n s . The i n l e t l i n e on our s y s t e m was o r i g i n a l l y d e s i g n e d and c o n s t r u c t e d by A h e r n ( 1 9 8 0 ) . I t f e a t u r e s a s e r v o c o n t r o l l e r u s i n g two m e r c u r y c o l u m n s t o e q u a l i s e t h e two peak s i g n a l s and a r a t h e r c l e v e r l y d e s i g n e d m i c r o p r o c e s s o r t o c o n t r o l v a l v e s e q u e n c i n g . T h i s l a t t e r a p p a r a t u s i s c a p a b l e of a d m i t t i n g and q u e u i n g a new sample even Sec 1.2.3 9 t h o u g h a n a l y s i s of a n o t h e r may be t a k i n g p l a c e . A t i m e - s h a r i n g a r r a n g e m e n t s u c h as t h i s h e l p s o p t i m i s e sample t h r o u g h p u t . U n f o r t u n a t e l y t h e o r i g i n a l c o n f i g u r a t i o n of t h e i n l e t l i n e p r o v e d i n c a p a b l e of a u t o m a t e d o p e r a t i o n , m a i n l y due t o t h e s u s c e p t i b i l i t y o f t h e c o n t r o l l e r t o e l e c t r i c a l i n t e r f e r e n c e , and t o t h e p r e s e n c e of many s m a l l l e a k s t h r o u g h o u t t h e p l u m b i n g . The i n l e t . l i n e i s of c r u c i a l i m p o r t a n c e t o t h i s t h e s i s s o , i n c o - o p e r a t i o n w i t h R.D. R u s s e l l , I r e b u i l t i t i n a m o d u l a r , and t h e r e f o r e more s e r v i c e a b l e , f a s h i o n . R e l i a b l e o p e r a t i o n was a t t a i n e d by s y s t e m a t i c a l l y r e m o v i n g t h e l e a k s and by i n s t a l l i n g d e c o u p l i n g c i r c u i t r y i n t h e e l e c t r o n i c s . 1.2.4 C o l l e c t i o n of D a t a A m p l i f i e r s i n t h e c o l l e c t o r of t h e mass s p e c t r o m e t e r p r o d u c e two v o l t a g e s p r o p o r t i o n a l t o t h e i n t e n s i t i e s of t h e mass 44 and mass 46 i o n beams. A f t e r some c o n d i t i o n i n g i n an a n a l o g u e c i r c u i t , t h e v o l t a g e s a r e measured and d i g i t i s e d by a r a t i o i n g d i g i t a l v o l t m e t e r . The d i g i t a l v a l u e s p r o d u c e d (known a s PHI v a l u e s ) c an be r e l a t e d t o t h e i s o t o p i c r a t i o u s i n g e q u a t i o n s d e s c r i b e d by R u s s e l l & Ahern ( 1 9 7 4 ) . An I n t e r d a t a m i n i - c o m p u t e r c o l l e c t s a b o u t f o u r samples a s e c o n d from t h e d i g i t a l r a t i o m e t e r , and f i l t e r s t h e s e t o p r o d u c e an a v e r a g e PHI v a l u e e v e r y e l e v e n s e c o n d s . By e x a m i n i n g s t a n d a r d d e v i a t i o n s of i n d i v i d u a l PHI v a l u e s , and t h e d i f f e r e n c e between c o n s e c u t i v e o n e s , an e x p e r i e n c e d o p e r a t o r c an u s u a l l y j u d g e t h e q u a l i t y o f d a t a q u i t e w e l l . An a n a l y s i s would be t e r m i n a t e d when enough good d a t a had been c o l l e c t e d . To do t h e same i n an a u t o m a t e d s i t u a t i o n i s a much more d i f f i c u l t p r o p o s i t i o n , m a i n l y b e c a u s e human judgement i s Sec 1.2.4 10 somewhat i n t u i t i v e . C o n s i d e r a t i o n must be g i v e n t o t h e p r o b l e m e l s e d a t a c o l l e c t e d f r o m t h e s y s t e m may be e i t h e r u s e l e s s or r e d u n d a n t . A h e r n (1980) a t t e m p t e d t h i s w i t h a s i m p l e a l g o r i t h m . He c a l c u l a t e d DEL v a l u e s o n - l i n e u s i n g l i n e a r i n t e r p l o a t i o n o f t h e PHI v a l u e s . The e r r o r o f t h e measurement c o u l d be e s t i m a t e d by d i v i d i n g t h e s t a n d a r d d e v i a t i o n by t h e s q u a r e r o o t of t h e number of DEL v a l u e s u s e d i n i t s c a l c u l a t i o n . A n a l y s i s was t e r m i n a t e d when t h e e r r o r f e l l below a c e r t a i n p r e s e t l i m i t (0.04°/oo)« The v a l i d i t y of e s t i m a t i n g t h e measurement e r r o r i n t h i s way i s u n d i s p u t e d but t h e p r e c i s i o n of t h e a n a l y s i s i s a n o t h e r m a t t e r . L i k e most p h y s i c a l s i g n a l s t h e p r o d u c t i o n of DEL v a l u e s w i l l be a M a r k o f f p r o c e s s ( F e l l e r , 1 9 6 8 ) . The DEL c a n n o t be t r u t h f u l l y c o n s i d e r e d a s a random v a r i a b l e so e s t i m a t e s o f t h e mean and e r r o r do not a c c u r a t e l y r e f l e c t t h e sample b e i n g a n a l y s e d . In o t h e r words, t h e r e i s a s i g n i f i c a n t component of low f r e q u e n c y n o i s e t h r o u g h o u t t h e sys t e m , and DEL v a l u e s d e r i v e d d u r i n g a sample a n a l y s i s c a n o n l y be c o n s i d e r e d i n d e p e n d e n t when s e p a r a t e d by an i m p r a c t i c a l l y l o n g t i m e . O v e r a l l improvement i n t h e p r e c i s i o n of t h e a n a l y s i s c a n o n l y be im p r o v e d when t h e low f r e q u e n c y n o i s e i s r e d u c e d . A c a s e c a n s t i l l be made f o r i m p r o v i n g measurement p r e c i s i o n . T h e r e a r e o f t e n i n s t a n c e s when t h e p r e s e n c e of a random s t e p , s p i k e o r g l i t c h makes i t u n l i k e l y t h a t an a l g o r i t h m b a s e d on s i m p l e s t a t i s t i c a l m e a s ures w i l l t a k e an optimum c o u r s e of a c t i o n . The r e m o v a l of bad d a t a i s e s s e n t i a l l y a p r o b l e m of p a t t e r n r e c o g n i t i o n , and i s i s s t i l l b e s t h a n d l e d by t h e human mind. Sec 1.2.4 11 I have t h e r e f o r e t a k e n t h e a t t i t u d e t h a t a u t o m a t e d a n a l y s e s c a n s t i l l b e n e f i t from human judgement. The machine has been c o n f i g u r e d f o r what i t i s good a t ; c o l l e c t i n g t h e d a t a . The same q u a n t i t y o f d a t a i s c o l l e c t e d from e v e r y sample, good o r bad. I f d a t a i s c o n s i s t e n t l y bad t h e n f u n d a m e n t a l p r o b l e m s e x i s t w i t h i n t h e mass s p e c t r o m e t e r and must be c o r r e c t e d b e f o r e r o u t i n e a n a l y s e s can p r o c e e d . The human t a l e n t f o r p a t t e r n r e c o g n i t i o n has been l e f t w i t h t h e u s e r . D a t a r e d u c t i o n t a k e s p l a c e o f f - l i n e i n an i n t e r a c t i v e e n v i r o n m e n t t h a t e n a b l e s t h e u s e r t o j u d g e , a c c e p t , and r e j e c t i n d i v i d u a l d a t a p o i n t s . 1.2.5 D a t a R e d u c t i o n Methods S e v e r a l d i f f e r e n t methods have been u s e d i n t h i s l a b o r a t o r y t o d e r i v e DEL v a l u e s from t h e two PHI s e r i e s o u t p u t by t h e m e a s u r i n g s y s t e m . Samples a n a l y s e d f o r t h e P o l a r C o n t i n e n t a l S h e l f P r o j e c t ( R u s s e l l & K o e r n e r , 1969) were r e d u c e d by f i t t i n g a T c h e b y c h e v p o l y n o m i a l t o t h e d a t a v a l u e s . Two s i m i l i a r c u r v e s d i f f e r i n g by a m u l t i p l i c a t i v e f a c t o r were c o n s t r u c t e d t h r o u g h t h e two s e r i e s . From t h e c u r v e s and t h e a v e r a g e PHI v a l u e of t h e s t a n d a r d (PHISTD) a DEL v a l u e can be c a l c u l a t e d from t h e e q u a t i o n s d i s c u s s e d by R u s s e l l & A h e r n ( 1 9 7 4 ) . L a t e r A h e r n (1975) u s e d a method e m p l o y i n g c u b i c s p l i n e s t o f i t d a t a p o i n t s i n t h e two s e r i e s . Two smooth c u r v e s were p r o d u c e d , but were not c o n s t r a i n e d t o be r e l a t e d i n any way. PHIDIFF was o b t a i n e d by c a l c u l a t i n g t h e a v e r a g e d i f f e r e n c e between them, and an e s t i m a t e of measurement e r r o r was made from t h e s t a n d a r d d e v i a t i o n of PHIDIFF. The l i n e a r i n t e r p o l a t i o n c a r r i e d out o n - l i n e ( A h e r n 1980) works i n a s i m i l a r f a s h i o n t o t h e c u b i c s p l i n e s , but t h e d a t a p o i n t s a r e c o n n e c t e d by s t a i g h t Sec 1.2.5 12 l i n e segments i n s t e a d of smooth c u r v e s . A h e r n q u o t e s n e g l i g i b l e e r r o r f r o m . t h e a p p r o x i m a t i o n . The methods used by m y s e l f a r e not u n s i m i l i a r t o R u s s e l l ' s T c h e b y c h e v p o l y n o m i a l . Two p a r a l l e l , b u t s t r a i g h t , l i n e s a r e f i t t e d t o t h e PHI v a l u e s u s i n g t h e method o f l e a s t s q u a r e s . A c o n s t a n t d i f f e r e n c e e x i s t s between t h e two l i n e s and t h i s , a l o n g w i t h t h e a v e r a g e PHI v a l u e o f t h e s t a n d a r d , i s u s e d t o c a l c u l a t e t h e measurement DEL. L i k e w i s e t h e e r r o r i s e s t i m a t e d from t h e d e v i a t i o n o f t h e d a t a p o i n t s from t h e s t r a i g h t l i n e . C o r r e c t i o n bf t h e DEL v a l u e s t o a g r e e w i t h t h e i n t e r n a t i o n a l SMOW s t a n d a r d i s i n c l u d e d i n t h e d a t a r e d u c t i o n p a c k a g e . E a c h r a c k a n a l y s e d c o n t a i n s s e v e r a l known s t a n d a r d s amongst t h e unknowns, ( u s u a l l y f o u r s t a n d a r d s and t w e l v e unknowns). D a t a r e d u c t i o n t a k e s p l a c e by t h e r a c k so t h e a v e r a g e measured v a l u e of t h e s t a n d a r d s c a n be u s e d t o c o r r e c t f o r SMOW. In a d d i t i o n t h e i r s t a n d a r d d e v i a t i o n g i v e s t h e u s e r an i n d i c a t i o n of t h e p r e c i s i o n of a n a l y s e s f o r t h a t r a c k . The p r o g ram u s e d t o r e d u c e t h e d a t a i s menu d r i v e n and s e l f e x p l a n a t o r y . I t a l l o w s t h e u s e r t o see r e s u l t s and g r a p h i c a l l y examine t h e raw d a t a . S u s p e c t p o i n t s may be f l a g g e d as s u c h , and w i l l be i g n o r e d i n s u b s e q u e n t r e g r e s s i o n s . The p r o c e s s c a n be r e p e a t e d u n t i l t h e o p e r a t o r i s s a t i s f i e d w i t h t h e q u a l i t y and v a l i d i t y o f t h e a n a l y s e s . When r e a d y t h e r e s u l t s a r e p r e s e n t e d i n a p r i n t a b l e form t o a h i g h q u a l i t y Z erox p r i n t e r . The p r i n t e r o u t p u t i s of p u b l i s h a b l e q u a l i t y , and can be s e n t d i r e c t l y t o t h e owner o f t h e s a m p l e s . Sec 1.2.5 13 1.2.6 P r e c i s i o n of A n a l y s i s The e r r o r of t h e f i n a l DEL v a l u e can be a t t r i b u t e d t o b o t h p r e p a r a t i o n and a n a l y s i s of t h e sample. In p a r t i c u l a r t h e p r e c i s i o n or r e p e a t a b i l i t y o f t h e sample p r e p a r a t i o n s t a g e by c u r r e n t s t a t e - o f - t h e - a r t sample l i n e s s h o u l d be met o r b e t t e r e d by t h i s r e s e a r c h . The M i c r o m a s s MM602 s e r v e s as an a p p r o p r i a t e benchmark f o r s t a b l e i s o t o p e mass s p e c t r o m e t e r s . R e c e n t p r o m o t i o n a l l i t e r a t u r e f r o m M i c r o m a s s d e f i n e s t h e i n t e r n a l r e p r o d u c i b i I t y o f t h e machine as c a l c u l a t e d f r o m a s e r i e s o f t w e l v e a l t e r n a t e measurements o f i s o t o p i c r a t i o f r o m sample and s t a n d a r d g a s . F o r a C 0 2 a n a l y s i s i t was b e t t e r t h a n 0 . 0 1 7 ° / 0 0 a t t h e two sigma l e v e l . Our own machine f a r e s somewhat p o o r l y by c o m p a r i s o n . A f t e r r u n n i n g 22 i s o t o p i c a l l y i d e n t i c a l C 0 2 s a m p l e s on h i s newly c o n s t r u c t e d i n l e t l i n e , A h e r n (1980) r e p o r t e d a p r e c i s i o n of 0 . 0 3 ° / o o a t t h e one sigma l e v e l . Rough t e s t s by m y s e l f i n d i c a t e an even worse f i g u r e ; p r o b a b l y a r o u n d 0 . 1 5 ° / 0 0 . U n t i l t h e i n s t a b i l i t i e s c a u s i n g t h e s e p o o r r e s u l t s a r e l o c a t e d and r e m e d i e d i t w i l l be i m p o s s i b l e t o t e s t t h e sample p r e p a r a t i o n l i n e t o a b e t t e r p r e c i s i o n . L a r g e e r r o r s a r e c o n t r i b u t e d d u r i n g t h e sample p r e p a r a t i o n s t a g e . A h e r n (1975) has e s t i m a t e d t h a t t h e manual methods p r e v i o u s l y employed i n t h i s l a b o r a t o r y were r e s p o n s i b l e f o r a p p r o x i m a t e l y ± 0 . 0 8 ° / O o of t h e f i n a l e r r o r . R o e t h e r (1970) on t h e o t h e r hand c o n c l u d e d t h a t h i s l i n e had a r e p r o d u c i b i l i t y o f b e t t e r t h a n ± 0 . 0 3 ° / O o even t h o u g h he e l i m i n a t e d a l l t h e f r e e z i n g and t h a w i n g s t e p s . I t i s r a t h e r s u r p r i s i n g , t h e r e f o r e , t o f i n d t h a t M i c r o m a s s w i l l o n l y g u a r a n t e e a p r e c i s i o n o f ± 0 . 1 ° / o o f ° r Sec 1.2.6 14 t h e i r c u r r e n t l y a v a i l a b l e MM5020 e q u i l i b r a t i o n s y s t e m ( M i c r o m a s s , 1978). T h i s may be due t o M i c r o m a s s ' s c h o i c e o f a c o n s t a n t t e m p e r a t u r e a i r b a t h i n w h i c h t o e q u i l i b r a t e t h e s a m p l e s . R o e t h e r u s e d a l e s s c o n v e n i e n t water b a t h , but b e c a u s e of i t s h i g h e r s p e c i f i c h e a t s t a b l e t e m p e r a t u r e c o n t r o l would have been much e a s i e r . The sample l i n e d e v e l o p e d t h r o u g h t h i s t h e s i s a l s o "immerses" t h e samples i n a i r . I t s h o u l d c e r t a i n l y be c a p a b l e of a ± 0 . 1 ° / o o r e p r o d u c i b i l i t y , b u t u l t i m a t e l y be a b l e t o b e t t e r a mass s p e c t r o m e t e r p r e c i s i o n of ± 0 . 0 3 ° / O o - 1.3 PROBLEMS IN SAMPLE PREPARATION 1.3.1 The T e m p e r a t u r e S e n s i t i v i t y o f E q u i l i b r a t i o n D u r i n g t h e e q u i l i b r a t i o n r e a c t i o n , atoms of oxygen move f r e e l y between t h e C 0 2 and water m o l e c u l e s . B e c a u s e i t r e q u i r e s more e n e r g y t o move t h e h e a v i e r 0 1 8 m o l e c u l e s t h e y t e n d t o " g r a v i t a t e " t o t h e l o w e s t e n e r g y s t a t e of t h e c o m p l e t e r e a c t i o n . The f i n a l i s o t o p i c r a t i o o f t h e C 0 2 w i l l t h e r e f o r e d i f f e r from t h a t of t h e water as t h e r e a c t i o n n e a r s c o m p l e t i o n . I t i s t h e n c o n v e n i e n t t o d e f i n e a s e p a r a t i o n f a c t o r (a) as t h e i s o t o p i c r a t i o of t h e C 0 2 d i v i d e d by t h e i s o t o p i c r a t i o of t h e water when t h e exchange i s i n e q u i l i b r i u m As m i g h t be e x p e c t e d t e m p e r a t u r e a f f e c t s t h e amount o f e n e r g y a v a i l a b l e t o move t h e 0 1 8 m o l e c u l e s , and v a r i e s t h e s e p a r a t i o n f a c t o r . Such b e h a v i o u r i s p r e c i s e l y what makes s t a b l e i s o t o p e a n a l y s i s v a l u a b l e , b u t u n l e s s t h e sample p r e p a r a t i o n t e m p e r a t u r e i s w e l l c o n t r o l l e d i t i s a l s o a major Sec 1.3.1 15 s o u r c e o f e r r o r . An o u t l i n e o f t h e s e n s i t i v i t y o f t h e r e a c t i o n C o n s i d e r a c l o s e d system w i t h water and COi i n chemical and i s o t o p i c e q u i l i b r i u m . A change i n tem p e r a t u r e w i l l a l t e r the s e p a r a t i o n f a c t o r (a) and the measured DEL v a l u e of the e q u i l i b r a t e d COi. D i f f e r e n t i a t i n g e q u a t i o n 1.3 w i t h r e s p e c t to te m p e r a t u r e g i v e s : a6/dT = ( 1/T)(da/dT)(6+1000) (1.4a) where: a* the s e p a r a t i o n f a c t o r . 6 the measured DEL v a l u e of the e q u i l i b r a t e d CO;. and the i s o t o p i c r a t i o of the water Is assumed c o n s t a n t . S t a s c h e w s k i (1964) has d e r i v e d an e m p i r i c a l r e l a t i o n s h i p d e s c r i b i n g the v a r i a t i o n of a w i t h t e m p e r a t u r e . 8*= 0.9779 exp( 18 ,989/T) (1.4b) where: T 1s the temperature In °K. D i f f e r e n t i a t i n g (1.4b) and s u b s t i t u t i n g to (1.4a) y i e l d s the temperature sens i t i v i t y . d6/dy = -18.989 (1000 + 6)/T (1.4c) For the normal range of DEL v a l u e s , and f o r small temperature v a r i a t i o n s , 1.4c can be a p p r o x i m a t e d a t 25°C as: A6 = 0.21 AT (1 .4d) where: A6 the change i n Del of the e q u i l i b r a t e d CO; (per m i l ) . AT the change i n temperature (°C). E q u a t i o n 1.4 T e m p e r a t u r e s e n s i t i v i t y o f e q u i l i b r a t i o n . t o t e m p e r a t u r e i s g i v e n i n e q u a t i o n s 1.4. I f a p e r m i s s i b l e v a r i a t i o n i n t h e DEL v a l u e of a r a c k o f s a m p l e s i s ± 0 . 0 3 ° / O o t h e n e q u a t i o n 1.4d p l a c e s a l i m i t o f ± 0 . 1 2 ° C on t h e e f f e c t i v e t e m p e r a t u r e d i f f e r e n c e between s a m p l e s . T h i s l i m i t must a p p l y n o t o n l y i n a s p a t i a l s e n s e , but a l s o f o r t h e t i m e t a k e n t o c o m p l e t e t h e a n a l y s i s o f e v e r y sample on t h e r a c k . S uch s t a b i l i t y i s r e l a t i v e l y e a s y t o a t t a i n i n a w a t e r b a t h b ut i s much more d i f f i c u l t i n a i r . I f i t were p o s s i b l e t o a n a l y s e a l l s a m p l e s s i m u l t a n e o u s l y t h e s e v e r e r e s t r i c t i o n on t i m e s t a b i l i t y c o u l d be a v o i d e d . As l o n g as t h e s p a t i a l v a r i a t i o n i s w i t h i n l i m i t s , t h e DEL v a l u e s Sec 1.3.1 16 o f a l l s a m p l e s w i l l change i d e n t i c a l l y a n d no e r r o r w i l l be i n t r o d u c e d . Our sample l i n e u s e s r e s e r v o i r s t o s t o r e t h e e q u i l i b r a t e d gas samp l e s s i m u l t a n e o u s l y , w i t h t h e same e f f e c t . 1.3.2 Sample F r a c t i o n a t i o n D u r i n g Pump Down C r a i g e t . a l . (1953) g i v e the f o l l o w i n g r e l a t i o n s h i p f o r an e q u i l i b r i u m b a t c h d i s t i l l a t i o n o f water. l n ( 1 + 6 ) - l n ( 1+6°) = (a-1) l n ( f ) (1.5a) where: f i s the f r a c t i o n of water r e m a i n i n g . 6° DEL v a l u e of water a t f = 1. 6 DEL v a l u e of water a f t e r f-1 has e v a p o r a t e d . a* s e p a r a t i o n f a c t o r of water vapour. U s i n g the a p p r o x i m a t i o n t h a t ln(1+A)=A when A i s s m a l l , then 1.5a can be ap p r o x i m a t e d a s : A6 = -€* Am/m ( 1 . 5b) where : ef= 1 -of* . . . .' Exper 1 mental 1 y determ 1 ned as -9.1 per mil at 25°C . Am mass of water sample l o s t to e v a p o r a t i o n . m o r i g i n a l mass of the water sample. A6 change i n DEL v a l u e of the water. E q u a t i o n 1.5 B a t c h d i s t i l l a t i o n f r a c t i o n a t i o n . B e f o r e C 0 2 c a n be a d m i t t e d t o t h e sample f l a s k s , most o f t h e a i r must be removed by pumping. I t i s awkward t o f r e e z e t h e s a m p l e s on an a u t o m a t e d l i n e , so w a t e r c o n s t a n t l y e v a p o r a t e s a s t h e p r e s s u r e d r o p s . The r e s u l t i n g i s o t o p i c f r a c t i o n a t i o n s h i f t s t h e DEL v a l u e s o f t h e s a m p l e s and becomes a p o t e n t i a l s o u r c e of e r r o r . U s i n g e q u a t i o n s f o r R a y l e i g h d i s t i l l a t i o n ( e q u a t i o n s 1.5) a change i n t h e DEL v a l u e o f a sample c a n be c o n v e n i e n t l y e x p r e s s e d as a f u n c t i o n o f t h e r e s i d u a l a i r p r e s s u r e ( e q u a t i o n s 1.6). The t o l e r a n c e o f an a n a l y s i s t o r e s i d u a l a i r i s , however, h a r d t o d e t e r m i n e . R o e t h e r (1970) has a l l o w e d t h a t p r e s s u r e s o f a few h u n d r e d m i c r o n s of m e r c u r y a r e t o l e r a b l e when samples were e q u i l i b r a t e d w i t h C 0 2 a t a p r e s s u r e o f 400 t o r r . H i s p r e f e r r e d Sec 1.3.2 17 l o w e r l e v e l o f 20-50»iHg was t o f a c i l i t a t e r a p i d t r a n s f e r o f t h e gas f r o m t h e sample f l a s k s , by f r e e z i n g C 0 2 a t t h e gas sample t u b e . S i n c e t h i s t e c h n i q u e i s n o t u s e d on a u t o m a t e d l i n e s t h e h i g h e r l e v e l i s p r o b a b l y q u i t e a d e q u a t e . At an e q u i l i b r a t i o n p r e s s u r e o f one a t m o s p h e r e (760 t o r r ) , r e s i d u a l a i r p r e s s u r e s s h o u l d t h e r e f o r e be l e s s t h a n 1 t o r r . C o n s i d e r a c o n t a i n e r from which a m i x t u r e of a i r and water vapour i s b e i n g pumped at F ( t ) l i t r e s / s e c o n d . Assuming t h a t the p a r t i a l p r e s s u r e of the water vapour (Pw) i s h e l d c o n s t a n t by e v a p o r a t i o n from a mass, m, of l i q u i d water, then the Ideal gas laws show t h a t : dm/dt = (Pw. W. F( t ) )/(62 .36 T) grams/sec (1.6a) and t h a t : dP/dt = - ( P - P w ) . F ( t ) / V t o r r / s e c (1.6b) E l i m i n a t i n g F ( t ) , i n t e g r a t i n g , and then s u b s t i t u t i n g i n t o e q u a t i o n 1.5b y i e l d s an e x p r e s s i o n f o r the change 1n DEL v a l u e of the water t h a t i s independent of the f l o w r a t e . A6 = (**.V.W.Pw)/(62.36m.T) 1 n(Pr/(Pa-Pw)) per mil (1.6c) where: t* 1-o*= -9.1% per m i l . V gas volume i n l i t r e s . W m o l e c u l a r weight = 18gms f o r water. Pw p a r t i a l p r e s s u r e of water at T°C (23.75 t o r r P 298°K) m mass of l i q u i d water (grams) T temperature i n "K. Pr f i n a l r e s i d u a l a i r p r e s s u r e ( t o r r ) . Pa i n i t i a l p r e s s u r e above the sample- u s u a l l y 760 t o r r . E q u a t i o n 1.6 DEL e r r o r a s a f u n c t i o n o f r e s i d u a l a i r p r e s s u r e . The a c t u a l sample f r a c t i o n a t i o n i n r e a c h i n g t h i s and l o w e r p r e s s u r e s i s i n s i g n i f i c a n t . W i t h a 10CC water sample and a 60cc a i r s p a c e , t h e change i n DEL v a l u e ( a t a t e m p e r a t u r e o f 25°C) i s 0 . 0 0 8 ° / o o / 0 . 0 l 1 ° / o 0 f and 0 . 0 1 4 ° / 0 0 f o r r e s i d u a l p r e s s u r e s o f 1, 0.1, and 0.01 t o r r r e s p e c t i v e l y ( e q u a t i o n 1 . 6 c ) . A more s e r i o u s p r o b l e m i s t h e l a c k of symmetry i n pump ge o m e t r y f r o m sample t o s a m p l e . C o n v e n t i o n a l l y samples a r e a r r a n g e d on t h e i r r a c k i n a s t r a i g h t l i n e , and a r e e v a c u a t e d Sec 1.3.2 18 t h r o u g h t u b i n g f r o m one end. The sample n e a r e s t t h e pump can I f samples a r e pumped down by a vacuum pump of h i g h c a p a c i t y , through t u b i n g of u n i f o r m c r o s s s e c t i o n , then the v o l u m e t r i c f l o w r a t e i s w e l l r e p r e s e n t e d by: F ( t ) = F . P ( t ) ( 1 .7a) where: F c o n s t a n t t h a t depends upon the geometry of the t u b i n g . P ( t ) time v a r y i n g p r e s s u r e above the sample. S u b s t i t u t i n g (1.7a) i n e q u a t i o n (1.6b), then i n t e g r a t i n g g i v e s the time taken to r e a c h a r e s i d u a l a i r p r e s s u r e , Pr. t = V/(F.Pw) ln{(Pw+Pr)(Pa-Pw)/(Pa.Pr)} (1.7b) where: A l l v a r i a b l e s were d e f i n e d i n e q u a t i o n s 1.6. C o n s i d e r two samples pumping at unequal r a t e s , F i & F i , where Fi > F i . Let the t i m e s t a k e n t o r e a c h the same r e s i d u a l a i r p r e s s u r e be t i & tz r e s p e c t i v e l y . Under t h e s e c o n d i t i o n s , e q u a t i o n 1.6a p l a c e s an upper bound on the add i t iona1 mass l o s t f rom sample 1. Am = W.F..Pw.(Pw+Pr)/(62.36 T) ( t * - t . ) grams (1.7c) S u b s t i t u t i n g a p p r o p r i a t e v a l u e s from 1.7b & 1.7c i n t o e q u a t i o n 1.5b p l a c e s an upper l i m i t on the f i n a l d i f f e r e n c e i n DEL v a l u e s between the samples as a f u n c t i o n of the r a t i o of the f l o w r a t e s . A6 = C.(Pw+Pr).ln{(Pw+Pr ) ( P a - P w ) / ( P a . P r ) } . ( F i / F j - 1 ) per mil ....(1.7d) where: F. c o n d u c t a n c e of the t u b i n g through which sample 1 i s b e i n g pumped. F i t u b i n g conductance f o r sample 2: and C = t*.V.w/(62.36m.T) Note t h a t t h i s e s t i m a t e of the upper bound co n v e r g e s to the t r u e change as the r e s i d u a l a i r p r e s s u r e d r o p s . * E q u a t i o n 1.7 DEL e r r o r due t o m i s m a t c h i n t u b i n g c o n d u c t a n c e . t h e n have an e f f e c t i v e t u b i n g c o n d u c t a n c e w e l l o v e r an o r d e r of m a g n i t u d e g r e a t e r t h a n t h o s e a t t h e f a r end. By c o n s i d e r i n g t h e s i m p l e c o n f i g u r a t i o n o u t l i n e d i n e q u a t i o n s 1.7 t h e d i f f e r e n c e i n DEL v a l u e s of two s a m p l e s , due t o a m i s m a t c h of t u b i n g c o n d u c t a n c e s , c a n be e x p r e s s e d a s a f u n c t i o n o f r e s i d u a l a i r p r e s s u r e . F i g u r e 1.1 p r e s e n t s e q u a t i o n 1.7d g r a p h i c a l l y , f o r t h e c o n d i t i o n s u s e d p r e v i o u s l y . I f t h e mass s p e c t r o m e t e r i s c a p a b l e o f a 0 . 0 3 ° / O o p r e c i s i o n t h e n sample e r r o r due t o pump-down f r a c t i o n a t i o n s h o u l d be l e s s t h a n 0.01 ° / 0 0 t o be c o n s i d e r e d n e g l i g i b l e . The t u b i n g Sec 1.3.2 19 c o n d u c t a n c e s of e v e r y sample must t h e n be m a tched w i t h i n a 1 5 10 15 20 25 ratio of flow conductances F i g u r e 1.1 DEL E r r o r Due t o a M i s m a t c h i n T u b i n g C o n d u c t a n c e f a c t o r of 2 t o 3 d e p e n d i n g on t h e f i n a l r e s i d u a l a i r p r e s s u r e . In t h e c o n v e n t i o n a l l i n e a r r a c k s u c h a match i s p o s s i b l e o n l y when t h e s i d e arms t o t h e s a m p l e s a r e made much more r e s t r i c t i v e t h a n t h e c o n n e c t i n g l i n e . B e c a u s e t h e volume o f t h e c o n n e c t i n g l i n e must be kept low t o g i v e a d e q u a t e C 0 2 p r e s s u r e a t t h e mass s p e c t r o m e t e r , t h e o n l y c h o i c e i s t o pump the s a m p l e s t h r o u g h s m a l l b o r e c a p i l l a r y t u b i n g . T h e s e a r e e a s i l y m a t ched w i t h i n 20%, and make sample f r a c t i o n a t i o n e r r o r s i n s i g n i f i c a n t . C a p i l l a r i e s do have some p r a c t i c a l d i s a d v a n t a g e s . The f i n e b o r e i n c r e a s e s t h e p o s s i b i l i t y o f b l o c k a g e , and n e c e s s i t a t e s t h e i r f r e q u e n t r e m o v a l f o r c l e a n i n g . T h i s i n c r e a s e s t h e s y s t e m m a i n t e n a n c e c o s t , d e c r e a s e s t h r o u g h p u t , and p r e s e n t s some t r i c k y Sec 1.3.2 20 p r o b l e m s of m e c h a n i c a l d e s i g n . I f r a c k geometry i s r e s t r u c t u r e d a r o u n d a c i r c u l a r l y s y m m e t r i c form t h e use o f c a p i l l a r i e s c a n be a v o i d e d . Samples can be pumped e q u a l l y from a c e n t r a l p o i n t and c o n d u c t a n c e s a r e e a s i l y k ept w i t h i n 20%, u s i n g s t a n d a r d t u b i n g w h i l s t m a i n t a i n i n g a low p u m p - l i n e volume. I f n e c e s s a r y t h e pump r a t e of a l l samples may be c o n t r o l l e d u s i n g a s i n g l e a d j u s t a b l e l e a k between t h e pump and t h e r a c k . 1.3.3 E q u i l i b r a t i o n Time The most t i m e - c o n s u m i n g s t e p o f t h e sample p r e p a r a t i o n i s t h a t t a k e n f o r c o m p l e t i o n o f t h e e q u i l i b r a t i o n r e a c t i o n . M i n i m i s i n g t h e e q u i l i b r a t i o n t i m e w i l l d e c r e a s e t h e r a c k t u r n a r o u n d t i m e . D e p e n d i n g on t h e p a r t i c u l a r s y s t e m c o n f i g u r a t i o n t h i s e i t h e r a l l o w s more samples t o be run d u r i n g a w o r k i n g day, o r d e c r e a s e s t h e number of r a c k s r e q u i r e d t o o p t i m a l l y u t i l i s e t h e mass s p e c t r o m e t e r . T h r e e f a c t o r s i n f l u e n c e t h e e q u i l i b r a t i o n t i m e . The f i r s t has been p r e v i o u s l y d i s c u s s e d ( s e c t i o n 1.2.2) and i s t h e r a t e a t w h i c h t h e e q u i l i b r a t i o n r e a c t i o n p r o c e e d s . At a pH o f l e s s t h a n 8 t h e h y d r a t i o n r e a c t i o n has a t i m e c o n s t a n t o f a p p r o x i m a t e l y 66 s e c o n d s . As o n l y t h e d i s s o l v e d C 0 2 c a n r e a c t w i t h t h e water sample, t h e gas i n t h e e q u i l i b r a t i o n f l a s k must be exc h a n g e d s e v e r a l t i m e s b e f o r e e q u i l i b r a t i o n of a l l t h e C 0 2 i s c o m p l e t e . T h e r e f o r e , t h e t o t a l r e a c t i o n r a t e depends on t h e r a t e a t w h i c h C 0 2 t r a n s f e r s a c r o s s t h e water s u r f a c e , and t h e r a t i o o f t h e volume o f C 0 2 d i s s o l v e d i n t h e water sample t o t h e t o t a l volume of C 0 2 . The volume of C 0 2 i n t h e water i s t h e p r o d u c t o f t h e v o l u m e t r i c s o l u b i l i t y (0.98 c c o f C 0 2 p e r c c o f H 2 0 a t STP ) and th e sample volume. Sec 1.3.3 21 The d e t e r m i n i n g f a c t o r i s t h e r a t e a t w h i c h d i s s o l v e d C 0 2 c a n be t r a n s f e r r e d from t h e s u r f a c e i n t o t h e b u l k w ater sample. R o e t h e r (1970) has i n v e s t i g a t e d e q u i l i b r a t i o n t i m e a s a f u n c t i o n of s h a k i n g f r e q u e n c y on a r a c k of s a m p l e s . He n o t e s t h a t t h i s r e m a i n s r a t h e r h i g h a t low f r e q u e n c i e s , b u t t h a t i t d r o p s r a p i d l y when t h e water sample b e g i n s t o r e s o n a t e w i t h i n i t s c o n t a i n e r , and shows no f u r t h u r d e c r e a s e a f t e r t h i s . Samples a r e most commonly a g i t a t e d by s h a k i n g or o s c i l l a t i n g t h e c o m p l e t e r a c k . Not o n l y i s t h i s m e c h a n i c a l l y complex, but t h e need f o r f l e x i b l e vacuum c o u p l i n g s must c a s t d o u b t on t h e u l t i m a t e r e l i a b i l i t y . A n o t h e r c o n t r i b u t i o n of t h i s t h e s i s i s t h e f i r s t use of m a g n e t i c s t i r r e r s . T h e s e g e n e r a t e no h e a t , a r e s i l e n t and v i b r a t i o n f r e e . T e f l o n e n c a s e d s t i r r e r b a r s , p l a c e d i n t h e samples b e f o r e c o n n e c t i o n t o t h e r a c k , g e n e r a t e a v o r t e x t h a t c o n s t a n t l y r e p l e n i s h e s t h e s u r f a c e l a y e r w i t h a c o m p l e t e l a c k of sample s p l a s h . 1.3.4 C o n t a m i n a t i o n and M i x i n g When C 0 2 i s t r a n s f e r r e d i n t o a r e s e r v o i r , sample c o n t a i n e r or i n t o t h e mass s p e c t r o m e t e r i n l e t l i n e , any remnant gas w i l l mix w i t h i t , and a l t e r t h e DEL v a l u e . The e r r o r i n t r o d u c e d i s a f u n c t i o n of t h e d i f f e r e n c e i n DEL v a l u e s , and of t h e r a t i o of th e gas p r e s s u r e s . The c a l c u l a t i o n s f o r c o n c e i v a b l e s i t u a t i o n s i n t h i s s y s t e m , t h o u g h s t r a i g h t f o r w a r d , a r e t e d i o u s , and a r e not r e p r o d u c e d h e r e . I n s t e a d i t can be s t a t e d t h a t u s i n g a s i m p l e r o t a r y vacuum pump t o r e d u c e p r e s s u r e s t o 0.01 t o r r c o m p l e t e l y removes c o n t a m i n a t i o n a s a s o u r c e of e r r o r . Sec 1.3.4 22 The same argument a p p l i e s t o c r o s s m i x i n g o f water s a m p l e s d u r i n g pumpdown. Even i f a l l o w e d t o m i n g l e f r e e l y , t h e q u a n t i t y of water i n g a s e o u s form p r o v i d e s i n s i g n i f i c a n t c o n t a m i n a t i o n of t h e r e m a i n i n g l i q u i d . No s p e c i a l p r e c a u t i o n s need be t a k e n t o p r e v e n t back m i x i n g between water s a m p l e s . 1.3.5 Water A d s o r p t i o n The l e a s t u n d e r s t o o d s o u r c e o f e r r o r i s due t o water a d s o r p t i o n on t h e i n t e r n a l s u r f a c e s of t h e sample p r e p a r a t i o n l i n e . In d e v e l o p i n g h i s c o n c e p t o f a d s o r p t i o n , Langmuir (1918) had t h e f o l l o w i n g e x p l a n a t i o n f o r t h e phenomena. "The atoms f o r m i n g t h e s u r f a c e o f a s o l i d a r e h e l d t o t h e u n d e r l y i n g atoms by f o r c e s s i m i l i a r t o t h o s e a c t i n g between atoms i n s i d e t h e s o l i d . From B r a g g ' s work on c r y s t a l s t r u c t u r e , and f r o m many o t h e r c o n s i d e r a t i o n s we know t h a t t h e s e f o r c e s a r e of t h e t y p e u s u a l l y c l a s s e d a s c h e m i c a l . In t h e s u r f a c e l a y e r , b e c a u s e of t h e asymmetry o f t h e c o n d i t i o n s , t h e a r r a n g e m e n t of atoms must a l w a y s be s l i g h t l y d i f f e r e n t from t h a t i n t h e i n t e r i o r . T hese atoms w i l l be u n s a t u r a t e d c h e m i c a l l y and t h u s a r e s u r r o u n d e d by an i n t e n s e f i e l d o f f o r c e . " The p o l a r w ater m o l e c u l e w i l l be s t r o n g l y a t t r a c t e d by t h e s u r f a c e f o r c e s o f t h e s o l i d . Even a t p r e s s u r e s as low as 2GVHg, e x p e r i m e n t a l measurements show t h e p r e s e n c e of a m o n o l a y e r of water m o l e c u l e s on g l a s s s u r f a c e s ( F r a n k , 1 9 2 9 ) . I t i s c o n v e n i e n t t o c o n s i d e r t h e a d s o r b e d water as a s o l i d , w i t h a c o r r e s p o n d i n g l y low vap o u r p r e s s u r e . U n f o r t u n a t e l y i t i s s t i l l p o s s i b l e f o r t h e a d s o r b e d water t o r e - e q u i l i b r a t e w i t h C 0 2 p a s s e d o v e r t h e s u r f a c e . A h e r n (1975) f o u n d i t n e c e s s a r y t o p r e v e n t water v a p o u r e n t e r i n g h i s p r e p a r a t i o n l i n e d u r i n g t h e t r a n s f e r o f t h e e q u i l i b r a t e d C 0 2 f r o m above t h e sample. When t h i s was n o t done, t h e DEL v a l u e o f t h a t sample was u n r e l i a b l e . R o e t h e r (1970) has a l s o n o t e d s u c h Sec 1.3.5 23 an e f f e c t and q u o t e s i t s m a g n i t u d e a s 0.05±0.05% o f t h e d i f f e r e n c e i n DEL v a l u e from t h e p r e v i o u s s a m p l e . He a t t r i b u t e d t h i s t o water a d s o r b e d on t h e m a n i f o l d and s t o p c o c k s i d e a r m s of h i s a p p a r a t u s ; and t o i t s r e - e q u i l i b r a t i o n w i t h t h e n e x t sample a t a d i f f e r e n t t e m p e r a t u r e ( a p p r o x i m a t e l y 3.5°C h i g h e r ) . O b v i o u s l y t h e r e a r e t o o many f a c t o r s t o a t t e m p t an a n a l y t i c a l a p p r a i s a l o f t h e memory e f f e c t . I f R o e t h e r ' s f i g u r e s a r e an i n d i c a t i o n , i t i s n o t a s e r i o u s p r o b l e m . Even i n t h e u n l i k e l y p o s s i b i l i t y o f a d i f f e r e n c e i n DEL o f 50°/Oo between c o n s e c u t i v e samples t h e e r r o r i n t r o d u c e d i s a t most 0.05°/oo» E x t r a p o l a t i o n s t o o t h e r s y s t e m s a r e , however, d i f f i c u l t t o make. T r a d i t i o n a l l y a c c e p t e d t e c h n i q u e s s c r u p u l o u s l y a v o i d t h e p r e s e n c e of water and water v a p o u r t h r o u g h o u t t h e sample l i n e . T h i s i s not t h e c a s e f o r t h i s sample l i n e , n or f o r D a n s g a a r d ' s , and t h e p o s s i b i l i t y t h a t memory e f f e c t s c o u l d i n t r o d u c e s i g n i f i c a n t e r r o r i s an uneasy one t o l i v e w i t h . I f n e c e s s a r y , a b e t t e r compromise i s t o f l u s h common a r e a s w i t h d r y a i r between a n a l y s e s . T h i s c o u l d p r o v e e f f e c t i v e i n r e m o v i n g t h e a d s o r b e d f i l m , but c o u l d d e l a y t h e r a t e a t w h i c h samples can be r e l e a s e d t o t h e mass s p e c t r o m e t e r and r e d u c e t h r o u g h p u t . 1.4 ISSUES IN AUTOMATION The m e c h a n i c a l , r e p e t i t i v e n a t u r e of a u t o m a t i o n m i g h t a l i e n a t e t h e human v i e w p o i n t , b u t i t does a l l o w a s i g n i f i c a n t i n c r e a s e i n t h e a c c u r a c y of r o u t i n e oxygen i s o t o p e a n a l y s e s . In t h i s i n s t a n c e i t a l s o r e p l a c e s an i n c r e a s i n g l y u n i n t e r e s t i n g c h o r e , and f r e e s p e r s o n n e l f o r t h e i n t e r p r e t i v e a s p e c t s more Sec 1.4 24 s u i t e d t o t h e i r a b i l i t i e s . D e s p i t e i t s a d v a n t a g e s , a u t o m a t i o n b r i n g s i t s own p r o b l e m s , and r e q u i r e s a c a r e f u l e x a m i n a t i o n of t h e a p p l i c a t i o n . T h i s s e c t i o n o u t l i n e s b o t h t h e p o s s i b i l i t i e s , and t h e i n h e r e n t d i f f i c u l t i e s . 1.4.1 A d v a n t a g e s o f A u t o m a t i o n S l i g h t a l t e r a t i o n s i n t h e a b s o l u t e i s o t o p i c r a t i o of a sample a r e i n e v i t a b l e by t h e t i m e t h e r a t i o i s m easured. C o m p a r i s o n w i t h a known s t a n d a r d t h a t has been s u b j e c t e d t o i d e n t i c a l p r o c e s s e s , a l l o w s t h e s e s m a l l c h a n g e s t o be measured and c o r r e c t e d . A u t o m a t i o n has t h e a d v a n t a g e t h a t i t imposes a r i g i d r e p e a t i b i l i t y t o t h e whole p r o c e s s . The c o n f i d e n c e t h a t measured c h a n g e s i n t h e s t a n d a r d s a r e a t r u e measure o f t h o s e o c u r r i n g i n unknown samples must be s i g n i f i c a n t l y g r e a t e r . The d e v e l o p m e n t of m i c r o p r o c e s s o r t e c h n o l o g y has made i t p o s s i b l e t o implement t i m e - s h a r i n g s y s t e m s i n s p e c i a l i s e d s i t u a t i o n s . E x e c u t i n g a complex s e q u e n c e o f i n s t r u c t i o n s i n m i c r o s e c o n d s a l l o w s t h e m i c r o p r o c e s s o r t o p e r f o r m a l a r g e number of j o b s s i m u l t a n e o u s l y . By p r o v i d i n g a s u f f i c i e n t number of sample h o l d e r s i t becomes p o s s i b l e t o admit samples t o a mass s p e c t r o m e t e r on a c o n t i n u o u s , t w e n t y - f o u r hour b a s i s . The s k i l l r e q u i r e d of human p e r s o n e l t o p e r f o r m manual a n a l y s e s i s n o t i n s i g n i f i c a n t . O p e r a t o r s must be t r a i n e d i n l a b o r a t o r y t e c h n i q u e s , and have e x p e r i e n c e and knowledge of mass s p e c t r o m e t r y . I t has p r o v e n d i f f i c u l t t o f i n d and r e t a i n s t a f f f o r what i s e s s e n t i a l l y a monotonous j o b . A u t o m a t i n g sample p r e p a r a t i o n a l l o w s t h e l a b o r a t o r y t e c h n i q u e s t o be de- e m p h a s i s e d , so t h a t t h e s c i e n t i f i c c h a l l e n g e s c a n r e c e i v e g r e a t e r a t t e n t i o n . Sec 1.4.1 25 A w e l l d e s i g n e d a u t o m a t e d s y s t e m can be b u i l t t o e x h i b i t i n t e l l i g e n c e and a d a p t a b i l i t y . I t can be d e s i g n e d t o run s e l f c h e c k p r o c e d u r e s on i t s v i t a l o r g a n s ; t h u s t o document, and p o s s i b l y r e c t i f y , p r o b l e m s t h a t would o t h e r w i s e go u n n o t i c e d . The f l e x i b i l i t y p o s s i b l e w i t h a m i c r o p r o c e s s o r - c o n t r o l l e d s y s t e m e n a b l e s s t r a t e g i e s t o be d e v e l o p e d , i m plemented and t e s t e d i n r e s p o n s e t o t h e c h a n g i n g needs and c r i t e r i a of t h e a n a l y t i c p r o c e d u r e s . 1.4.2 The D i s a d v a n t a g e s of A u t o m a t i o n The r e p l a c e m e n t of manual methods by a u t o m a t e d ones i s a c o u r s e f r a u g h t w i t h d i f f i c u l t y and m i s u n d e r s t a n d i n g . The c o n s t a n t and l o o s e r e f e r e n c e s t o i n t e l l i g e n t s y s t e m s a r e more i n d i c a t i v e o f w i s h f u l t h i n k i n g t h a n a n y t h i n g r e a l . E n g i n e e r i n g p r o b l e m s c r e a t e d when i n t e r f a c i n g t o an o f t e n u n p r e d i c a t a b l e w o r l d n e c e s s i t a t e a r e - a p p r a i s a l and e v a l u a t i o n of d e s i g n t r a d e o f f s and t e c h n i q u e s . Any a u t o m a t e d s y s t e m w i l l be p a r t i a l l y b l i n d . The d e s i g n e r must b a l a n c e t h e a d v a n t a g e s of i n c r e a s e d s i g h t a g a i n s t t h e c o s t and o v e r h e a d s r e q u i r e t o o b t a i n and a n a l y s e t h e e x t r a i n f o r m a t i o n . I n e v i t a b l y , t h e p r o b a b i l i t y o f o c c u r r e n c e o f some p r o b l e m s i s n o t l a r g e enough t o w a r r a n t t h e p r o v i s i o n of a s e n s o r t o d e t e c t i t . S h o u l d s u c h a p r o b l e m o c c u r t h e a s s u m p t i o n s upon w i c h t h e s y s t e m i s b a s e d become i n v a l i d b u t t h e s y s t e m w i l l c o n t i n u e t o o p e r a t e . No m a t t e r how s u p e r f i c i a l l y c l e v e r a s y s t e m a p p e a r s on t h e s u r f a c e i t i s n e v e r c a p a b l e of i n t u i t i v e , and u s u a l l y i n c a p a b l e of a d a p t i v e , d e c i s i o n s . A u t o m a t i o n c a n n o t u s u a l l y d e a l w i t h Sec 1.4.2 26 p r o b l e m s t h a t t h e programmer has not c o n t e m p l a t e d , but l i s t s t r u c t u r e d l a n g u a g e s (eg L I S P ) can s u p p o r t programs o f s u r p r i s i n g a d a p t a b i l i t y . T h e s e a r e d e s i g n e d i n s u c h a way t h a t p r o g r am and d a t a a r e i n d i s t i n g u i s h a b l e . I t i s p o s s i b l e t o g e n e r a t e and e x e c u t e new p r o g r a m s i n r e s p o n s e t o t h e c h a n g i n g s t a t e of t h e s y s t e m . Automated systems c a n be e x t r e m e l y u n c o m m u n i c a t i v e . U n l e s s p r o v i s i o n i s made t o i n d e s t r u c t i b l y r e c o r d r e l e v a n t s y s t e m o p e r a t i o n s , f a u l t s become v e r y d i f f i c u l t t o d i a g n o s e , and even t o r e p e a t . A s y s t e m t h a t i s t o o v e r b o s e i s j u s t as bad. A g r e y a r e a t h a t i s d i f f i c u l t t o d e f i n e and implement i s t h e p r o v i s i o n of o p e r a t o r i n t e r v e n t i o n . On one hand i t i s t e m p t i n g t o g i v e t h e o p e r a t o r a b s o l u t e o v e r r i d i n g p r i o r i t y and a l a r g e d e g r e e of m a n i p u l a t i v e power. On t h e o t h e r hand, p a r t s of t h e s y s t e m t h a t t h e o p e r a t o r i s not p r o p e r l y c o n c e r n e d w i t h s h o u l d be p r o t e c t e d from i n a d v e r t e n t m a n i p u l a t i o n s . T h e r e i s , f i n a l l y , t h e i s s u e of u n d e r s t a n d a b i l i t y . U n l e s s any o p e r a t o r f i n d s i t e a s y t o u n d e r s t a n d and use t h e s y s t e m , t h e n i t s i n t r o d u c t i o n w i l l s i m p l y r e s u l t i n t h e r e p l a c e m e n t of a t r a i n e d l a b o r a t o r y t e c h n i c i a n , w i t h a t r a i n e d computer t e c h n i c i a n . A g a i n t h e most p r o m i s i n g a p p r o a c h e s t o t h e s e p r o b l e m s a r e f o u n d i n t h e f i e l d of a r t i f i c i a l i n t e l l i g e n c e . P r o g r a m / s t r u c t u r e s have been d e v e l o p e d t h a t can i n t e r p r e t n a t u r a l E n g l i s h s e n t e n c e s , i n f e r t h e i n t e n d e d meaning, a c t upon i t , and r e p l y i n E n g l i s h ( W i n o g r a n d , 1 9 7 2 ) . Sec 1.4.2 CHAPTER I I . INNOVATIONS IN THE MECHANICAL DESIGN 27 2.1 ORGANISATION 2.1.1 I n n o v a t i o n s i n Rack C o n s t r u c t i o n T h i s c h a p t e r p r e s e n t s an o v e r a l l d e s c r i p t i o n o f t h e m e c h a n i c a l d e s i g n of t h e sample p r e p a r a t i o n l i n e b u t e m p h a s i s e s t h o s e a s p e c t s t h a t make o u r equipment u n i q u e . S p e c i f i c a l l y t h e r e a r e t h r e e major i n n o v a t i o n s : t h e use o f e q u i l i b r a t e d gas r e s e r v o i r s , a c i r c u l a r r a c k geometry, and i m p l e m e n t a t i o n o f a new d e s i g n i n m a g n e t i c s t i r r e r s . The m e c h a n i c a l o r g a n i s a t i o n c an be c l a r i f i e d by d e l i n e a t i n g t h r e e f u n c t i o n a l a r e a s . T h e s e a r e a s s o c i a t e d w i t h sample p r e p a r a t i o n , t h e mass s p e c t r o m e t e r , and g e n e r a l s e r v i c e s . The s y s t e m t a k e s form by i n t e r c o n n e c t i n g hardware a s s o c i a t e d w i t h e a c h of t h e a r e a s . 2.1.2 Sample P r e p a r a t i o n - Sample Racks E a c h sample t o be e q u i l i b r a t e d i n t h e s y s t e m r e q u i r e s a d e d i c a t e d , u n s h a r e d c o l l e c t i o n of m e c h a n i c a l hardware termed t h e sample u n i t ( s e e f i g u r e 2 . 2 ) . In t h i s s y s t e m i t s p a r t s a r e t h e sample f l a s k a s s e m b l y where t h e e q u i l i b r a t i o n r e a c t i o n t a k e s p l a c e , a s m a l l r e s e r v o i r t o s t o r e t h e e q u i l i b r a t e d gas u n t i l i t can be u s e d d u r i n g a n a l y s i s , and two i n t e r c o n n e c t i n g s o l e n o i d s t h a t i s o l a t e t h e above c o n t a i n e r s f r o m e a c h o t h e r and from t h e r e s t o f t h e s y s t e m . Sec 2.1.2 28 In t h e f i n a l a n a l y s i s DEL v a l u e s a r e c a l c u l a t e d by c o m p a r i n g i s o t o p i c r a t i o s o b t a i n e d from known s t a n d a r d s and from unknown s a m p l e s . The r e s u l t s t h u s o b t a i n e d w i l l be v a l i d o n l y i f b o t h s t a n d a r d and unknown samples have undergone i d e n t i c a l p r o c e s s e s . To keep c o n d i t i o n s between t h e i n d i v i d u a l sample u n i t s as s i m i l i a r as p o s s i b l e i t becomes n e c e s s a r y t o g r o u p them t o g e t h e r as one u n i t i n some p h y s i c a l l y manageable c o n f i g u r a t i o n . H i s t o r i c a l l y s u c h a u n i t i s known as t h e sample r a c k ( f i g u r e 2 . 1 ) . C h o o s i n g t h e number o f samples on e a c h r a c k i n v o l v e s a t r a d e o f f between c o n f l i c t i n g demands. The number f i n a l l y d e c i d e d upon was s i x t e e n , t h e l e n g t h of t h e m i c r o p r o c e s s o r word. T h i s c h o i c e s i m p l i f i e s d e s i g n of b o t h hardware and s o f t w a r e . S i x t e e n samples a day r e p r e s e n t s a d o u b l i n g of t h e manual a n a l y s i s r a t e p r e v i o u s l y p o s s i b l e i n t h i s l a b o r a t o r y (Ahern 1980) and g i v e s our r e s e a r c h r e a l v a l u e . The c o s t o f c o n s t r u c t i n g a r a c k f o r s i x t e e n samples i s r e l a t i v e l y i n e x p e n s i v e , and t h e p h y s i c a l s i z e i s s m a l l enough t o make i t p o s s i b l e t o remove the r a c k f o r r e p a i r and m o d i f i c a t i o n . The m i c r o p r o c e s s o r a r c h i t e c t u r e s u p p o r t s a s y s t e m w i t h between one and s i x t e e n r a c k s , and t h e o p e r a t i n g s y s t e m d e s i g n can s c h e d u l e a mass s p e c t r o m e t e r of a d e q u a t e s t a b i l i t y t o a n a l y s e a l l t h e r a c k s e a c h day. A l l o w i n g f o r downtime, weekends, and h o l i d a y s , our l a b o r a t o r y would have t h e c a p a b i l i t y of p r o d u c i n g a b o u t 4000 a n a l y s e s e a c h month, a f i g u r e e n t i r e l y a d e q u a t e f o r any f o r s e e a b l e n e e d s . Sec 2.1.2 29 2.1.3 The Mass S p e c t r o m e t e r L i n e A l t h o u g h , a f t e r e q u i l i b r a t i o n , t h e C 0 2 has a DEL v a l u e r e l a t e d t o t h e water sample, i t i s not y e t s u i t a b l e f o r a d m i t t a n c e t o t h e mass s p e c t r o m e t e r . The gas must be " c l e a n e d " , m a i n l y of water v a p o u r , b e f o r e i t e n t e r s t h e h i g h vacuum o f t h e m e a s u r i n g s y s t e m . T r a d i t i o n a l l y a vapo u r t r a p i s u s e d t o c o o l t h e C 0 2 below t h e 1 i q u i f i c a t i o n t e m p e r a t u r e of any c o n d e n s a b l e c o n t a m i n a t e s p r e s e n t i n t h e g a s . The most c o n v e n i e n t (and l e a s t e x p e n s i v e ) scheme i s t o p a s s t h e C 0 2 t h r o u g h s u c h a t r a p a s i t e n t e r s t h e mass s p e c t r o m e t e r i n l e t l i n e 1 . The v a p o u r t r a p , and t h e m a n i f o l d t h a t e n a b l e s t h e samples t o p a s s from t h e r a c k s t o t h e i n l e t l i n e c a n be r e g a r d e d a s l o g i c a l l y and p h y s i c a l l y g r o u p e d . T h i s c o l l e c t i o n o f hardware t h a t i s r e s p o n s i b l e f o r t r a n s p o r t i n g t h e e q u i l i b r a t e d gas t o t h e mass s p e c t r o m e t e r i s termed t h e mass s p e c t r o m e t e r l i n e . 2.1.4 G e n e r a l S e r v i c e s - The Main L i n e Common o p e r a t i o n s a r e p e r f o r m e d on b o t h t h e sample r a c k s and t h e mass s p e c t r o m e t e r l i n e . T y p i c a l l y t h e s e a r e t h e e v a c u a t i o n of g a s e s , t h e a d m i t t a n c e of C 0 2 , and a s s o c i a t e d p r e s s u r e t e s t i n g . T h e r e i s l i t t l e p o i n t i n d u p l i c a t i n g t h e s e e x p e n s i v e s e r v i c e s f o r t h e mass s p e c t r o m e t e r l i n e and e a c h r a c k , e s p e c i a l l y a s s u c h s e r v i c e s a r e i n f r e q u e n t l y u s e d . Under s o f t w a r e c o n t r o l a common f a c i l i t y can be e f f i c i e n t l y s h a r e d by th e whole s y s t e m w i t h l i t t l e o r no l o s s of t h r o u g h p u t . The hardware n e c e s s a r y t o p r o v i d e s u c h s e r v i c e s i s termed 1 T h e r e i s no p o i n t i n r e m o v i n g water v a p o u r b e f o r e t h e e q u i l i b r a t e d C 0 2 i s s t o r e d i n t h e r e s e r v o i r s . ( s e e s e c t i o n 2.2.5) Sec 2.1.4 30 t h e main l i n e . I t c o n s i s t s of a vacuum pump, a C 0 2 c y l i n d e r (and r e g u l a t o r ) , p r e s s u r e g a u ges, and a d i s t r i b u t i o n m a n i f o l d . The pump, and t h e C 0 2 , a r e c o n n e c t e d o r i s o l a t e d f r o m t h e m a n i f o l d u s i n g e l e c t r i c a l l y o p e r a t e d v a l v e s . The p r e s s u r e gauges a r e p e r m a n e n t l y c o n n e c t e d . 2.1.5 I n t e r c o n n e c t i o n s H a v i n g d e f i n e d t h r e e b a s i c components i t r e m a i n s t o c o n n e c t them t o g e t h e r i n a manner t h a t not o n l y a l l o w s t h e s y s t e m t o f u n c t i o n , but a l s o p r o v i d e s t h e a b i l i t y t o add and remove r a c k s w i t h o u t i n t e r f e r e n c e . Such a scheme i s shown i n f i g u r e 2.1. E a c h r a c k i s c o n n e c t e d t o t h e m a i n l i n e and t h e mass s p e c t r o m e t e r l i n e by a c o r r e s p o n d i n g s o l e n o i d d r i v e n v a l v e (V.MNL and V.MSL r e s p e c t i v e l y ) . A s w a g e l o c k t u b i n g c o n n e c t o r i s i n s t a l l e d between t h e s e s o l e n o i d s and t h e r a c k body. P r o v i d e d t h e two v a l v e s a r e c l o s e d t h e r a c k may be be d i s c o n n e c t e d w i t h o u t a f f e c t i n g t h e r e s t of t h e s y s t e m . The c l o s u r e o f t h e two s o l e n o i d s i s f o r c e d by d r i v i n g them, v i a an e l e c t r i c a l c o n n e c t o r , from w i t h i n t h e r a c k . In o r d e r t o t u r n a wrench on .the s w a g e l o c k f i t t i n g , t h e s o l e n o i d c o n n e c t o r must f i r s t be removed. T h e r e i s no d i r e c t c o n n e c t i o n between t h e main and mass s p e c t r o m e t e r l i n e s . The l a t e r must be e v a c u a t e d by pumping i t t h r o u g h a r a c k . However s i n c e b o t h t h e r a c k and t h e mass s p e c t r o m e t e r l i n e must be a t vacuum b e f o r e a sample i s t r a n s f e r r e d f r o m i t s h o l d i n g r e s e r v o i r t o t h e mass s p e c t r o m e t e r , t h e n s u c h a c o n n e c t i o n has l i t t l e d i s a d v a n t a g e . I t i s p o s s i b l e t h a t t h e need f o r a d i r e c t r o u t e w i l l a r i s e i f more a d v a n c e d t e s t i n g p r o c e d u r e s a r e i n t r o d u c e d , o r i f i t becomes n e c e s s a r y t o Sec 2.1.5 31 p e r i o d i c a l l y c l e a n t h e v a p o u r t r a p . In s u c h a c a s e t h e e x t r a co2 vacuum pump inlet line F i g u r e 2.1 M e c h a n i c a l O r g a n i s a t i o n of t h e Sample L i n e p l u m b i n g i s n o t d i f f i c u l t t o a d d . Sec 2.1.5 32 S e p a r a t e l y c o n n e c t i n g t h e r a c k t o b o t h t h e main and mass s p e c t r o m e t e r l i n e s i s n e c e s s a r y f o r two r e a s o n s . F i r s t l y , i t a l l o w s a r e a s o n a b l e d e g r e e of p a r a l l e l i s m . One r a c k c a n send a sample t o t h e mass s p e c t r o m e t e r w h i l e a n o t h e r s i m u l t a n e o u s l y u s e s t h e m a i n l i n e . F o r a m i n o r i n c r e a s e i n c o s t and c o m p l e x i t y t h e s y s t e m i s more e f f i c i e n t l y u t i l i s e d . The s e c o n d r e a s o n i s more i m p o r t a n t . In o r d e r t o pump gas r a p i d l y t h e m a i n l i n e m a n i f o l d must be of c o n s i d e r a b l e d i a m e t e r and volume. I f s e p a r a t e c o n n e c t i o n s were not made t h e sample gas would have t o e xpand i n t o b o t h t h e main l i n e and mass s p e c t r o m e t e r l i n e s . The l a r g e volume would t h e n r e d u c e sample p r e s s u r e t o an u n u s a b l e v a l u e . F i n a l l y i t i s i n t e r e s t i n g t o n o t e t h e e q u i v a l e n c e of t h i s i n t e r c o n n e c t i o n s y s t e m w i t h t h a t o f t h e p a r a l l e l bus s t r u c t u r e i n m i c r o p r o c e s s o r a r c h i t e c t u r e . B o t h e n a b l e u n i t s t o be added t o ,and d e l e t e d from, t h e bus i n d e p e n d e n t l y of t h e o p e r a t i o n of o t h e r s . I t i s t h e employment of p a r a l l e l s t r u c t u r e s i n any form t h a t makes m o d u l a r s y s t e m s w o r k a b l e and c o n v e n i e n t . 2.2 THE SAMPLE RACKS 2.2.1 Rack O v e r v i e w T h r e e m a j o r d e c i s i o n s have been t a k e n t h a t g i v e t h e p r e s e n t sample r a c k s a u n i q u e d e s i g n . They have b r o u g h t a d v a n t a g e s , but a l s o new p r o b l e m s . The c h o i c e o f a s ymmetric geometry t h a t c o u l d a s s u r e e q u a l pumpdown, and hence f r a c t i o n a t i o n of t h e w ater s a m p l e s , i s Sec 2.2.1 33 r e s p o n s i b l e f o r t h e c i r c u l a r c o n f i g u r a t i o n t h a t f i n a l l y e v o l v e d . A l t h o u g h c o n v e n i e n t f o r t h e above r e a s o n , and a l s o f o r a c e r t a i n c o m p a c t n e s s , t h e r e a r e p r o b l e m s o f m a c h i n i n g and a c c e s s . The d e c i s i o n t o use sample r e s e r v o i r s , r a t h e r t h a n s e n s i t i v e s t a b l e t e m p e r a t u r e c o n t r o l l e r s , has e a s e d t h e r e s t r i c t i o n s o f t e m p e r a t u r e c o n s t a n c y . D i s a d v a n t a g e s a r i s e f r o m t h e e x t r a s p a c e , and c o s t , i n c u r r e d by t h e r e s e r v o i r s and t h e i r a s s o c i a t e d s o l e n o i d s . In common w i t h p r e v i o u s p r e p a r a t i o n s y s t e m s t h e samples (and r e s e r v o i r s ) must be k e p t a t e q u a l t e m p e r a t u r e . A r a c k must be d e s i g n e d t o accommodate an a r e a where s u c h a c o n d i t i o n i s met. F i n a l l y , t h e use of m a g n e t i c s t i r r e r s i n p l a c e of a r a c k s h a k i n g mechanism p r o b a b l y a l l o w e d more fr e e d o m w i t h t h e shape, s i z e and mass of t h e r a c k t h a n c o u l d o t h e r w i s e have been p o s s i b l e but t h e a c t u a l s t i r r i n g mechanism, tho u g h e l e g a n t and s i m p l e , was not a r r i v e d a t e a s i l y . S a t i s f y i n g t h e s e demands r e q u i r e d a good d e a l of compromise and i n t e r a c t i o n so t h e f o l l o w i n g s e c t i o n s a r e more d e s c r i p t i v e t h a n d e d u c t i v e . An o v e r a l l p i c t u r e o f t h e r a c k o r g a n i s a t i o n i s f i r s t p r e s e n t e d t o i d e n t i f y t h e r e l a t i o n s h i p of t h e v a r i o u s components b e f o r e t h e y a r e d i s c u s s e d . No d e t a i l e d m e c h a n i c a l d e s c r i p t i o n i s g i v e n as i t was f e l t i r r e l e v a n t t o t h i s t h e s i s . 2 . 2 . 2 Rack O r g a n i s a t i o n The a r r a n g e m e n t and i n t e r c o n n e c t i o n of t h e v a r i o u s components w i t h i n t h e r a c k i s b e s t u n d e r s t o o d by r e f e r r i n g t o f i g u r e 2 . 1 . F o r r e a s o n s d i s c l o s e d e a r l i e r , s i x t e e n sample Sec 2 . 2 . 2 34 f l a s k s a r e d i s t r i b u t e d c i r c u l a r l y a r o u n d a c e n t r a l p o i n t 1 . E a c h sample f l a s k i s c o n n e c t e d t o a s t a i n l e s s s t e e l r e s e r v o i r u s i n g t u b i n g and a s o l e n o i d v a l v e (V.SMP). L i k e w i s e e v e r y r e s e r v o i r i s i s o l a t e d f r o m t h e common c e n t r a l p o i n t by a n o t h e r s o l e n o i d (V.RSV). From t h e c e n t r a l d i s t r i b u t o r a l i n e l e a d s out of t h e r a c k t o a s w a g e l o c k t u b i n g c o n n e c t o r . T h i s l i n k s t h e r a c k t o two s o l e n o i d s w h i c h c a n c o n n e c t t h e c e n t r a l d i s t r i b u t e r t o t h e main and mass s p e c t r o m e t e r l i n e s ( s e e s e c t i o n 2 . 1 . 5 ) . A l l t h e sample f l a s k s and r e s e r v o i r s a r e p h y s i c a l l y l o c a t e d i n a d u c t t h r o u g h w h i c h a f a n c i r c u l a t e s a i r ( i n an a t t e m p t t o m a i n t a i n e q u a l t e m p e r a t u r e o v e r a l l s a m p l e s ) . The a i r d u c t i s f o r m e d by a c i r c u l a r w a l l , and a t o p and b o t t o m r i m . F o u r c l e a r p l e x i g l a s s d o o r s c l i p a r o u n d t h e e x t r e m e p e r i m e t e r o f t h e two r i m s t o c o m p l e t e t h e e n c l o s u r e , but s t i l l a l l o w c o n v e n i e n t a c c e s s t o t h e sample f l a s k s . The d o o r s a r e h e l d and s e p a r a t e d by f o u r s m a l l s e c t i o n s of aluminum p l a t e . T h e s e p r o v i d e c o r r i d o r s t h r o u g h w h i c h t h e v a r i o u s s e r v i c e s e n t e r and l e a v e . They a r e a l s o a c o n v e n i e n t p l a c e t o mount e l e c t r i c c o n n e c t o r s and i n d i c a t o r lamps. The empty s e c t i o n of a i r d u c t b e h i n d them can j u s t accommodate a s m a l l f a n . 2.2.3 The T e m p e r a t u r e P r o b l e m The p r e c i s i o n of a sample p r e p a r a t i o n l i n e d epends l a r g e l y upon t h e r e p e a t a b i l i t y of t h e C 0 2 / H 2 0 e q u i l i b r a t i o n c o n d i t i o n s . In p a r t i c u l a r t h e t e m p e r a t u r e between samples must no t d i f f e r by 1 E a c h sample p o s i t i o n i n t h e r a c k has been l a b e l l e d w i t h a h e x a d e c i m a l d i g i t (0-9, A - F ) , f o r c o m p u t i n g c o n v e n i e n c e . Sec 2.2.3 35 any s i g n i f i c a n t a m o u n t 1 . The r e s t r i c t i o n s on t e m p e r a t u r e s t a b i l i t y a r e worsened by t h e t r a d i t i o n a l a p p r o a c h t o a u t o m a t e d sample p r e p a r a t i o n and a n a l y s i s . U s u a l l y t h e C 0 2 and w a t e r r e m a i n i n e q u i l i b r i u m u n t i l t h e gas c a n be a d m i t t e d t o t h e mass s p e c t r o m e t e r . S e v e r a l h o u r s may e l a p s e between t h e a n a l y s i s of t h e f i r s t and l a s t s a m p l e s , and t e m p e r a t u r e c o n d i t i o n s must be c o n s t a n t d u r i n g t h i s t i m e . By i n c l u d i n g s e v e r a l known s t a n d a r d s t h r o u g h o u t t h e r a c k t h e c o n s t a n c y c o n d i t i o n c o u l d p o s s i b l y be r e l a x e d . However a c c u r a t e i n t e r p o l a t i o n between t h e s t a n d a r d s i s u n c e r t a i n f o r c o n d i t i o n s o f random t e m p e r a t u r e f l u c t u a t i o n and n o n - c o n s t a n t a n a l y s i s t i m e . A s t a b l e and s e n s i t i v e t e m p e r a t u r e c o n t r o l l e r i s s t i l l n e e d e d . 2.2.4 U s i n g Sample R e s e r v o i r s C o n s t a n t t e m p e r a t u r e d u r i n g a n a l y s i s i s not n e c e s s a r y i f a l l t h e e q u i l i b r a t e d C 0 2 samples a r e s i m u l t a n e o u s l y i s o l a t e d from t h e w a t e r i n t h e sample t u b e s and s t o r e d p e n d i n g a n a l y s i s . P r o v i d e d t h a t t h e t e m p e r a t u r e d i f f e r e n c e between any two samples i s a l w a y s w i t h i n p r e s c r i b e d l i m i t s , a l l s a m p l e s w i l l v a r y i d e n t i c a l l y . The DEL v a l u e s of t h e e q u i l i b r a t e d gas above t h e unknown samples and t h e known s t a n d a r d s t o w h i c h t h e y a r e compared change e q u a l l y , c a n c e l l i n g t h e t e m p e r a t u r e i n s t a b i l i t y . S uch a scheme i s e a s i l y i m p l e m e n t e d by p r o v i d i n g r e s e r v o i r s i n w h i c h t o s t o r e t h e e q u i l i b r a t e d gas (see f i g u r e 2 . 2 ) . By o p e n i n g t h e V.RSV and V.SMP s o l e n o i d s , a i r i n t h e r e s e r v o i r and above t h e w a t e r sample i s removed. C a r b o n d i o x i d e gas can t h e n 1 S e c t i o n 1.3.1, e q u a t i o n 1.4d, p r e s c r i b e s a t e m p e r a t u r e d i f f e r e n c e of ±0.05°C f o r an e q u i l i b r a t i o n r e p r o d u c t i b i l i t y o f ± 0 . 0 1 % O . Sec 2.2.4 36 be a d m i t t e d t o t h e tu b e and r e m a i n s t h e r e w h i l e a m a g n e t i c sample preparation unit (i). 0 v.smpli) to central distribution manifold. 0 y.rsv(i) stirrer bar sample, reservoir -A tube 'holder sample tube water /sample stirrer motor F i g u r e 2.2 The Sample P r e p a r a t i o n U n i t s t i r r e r m i x e s t h e w a t e r . When e q u i l i b r a t i o n . i s c o m p l e t e t h e r e s e r v o i r i s e v a c u a t e d t h e n i s o l a t e d . The C 0 2 gas i s s t o r e d by o p e n i n g V.SMP u n t i l t h e gas p r e s s u r e between t h e sample t u b e and th e r e s e r v o i r e q u a l i s e s . The gas can r e m a i n i n t h e r e s e r v o i r , u n a f f e c t e d by t h e p r e s c e n c e of t h e water sample, u n t i l i t i s a n a l y s e d . 2.2.5 R e - e q u i l i b r a t i o n i n t h e R e s e r v o i r s Even t h o u g h t h e V.SMP s o l e n o i d e f f e c t i v e l y i s o l a t e s t h e C 0 2 gas f r o m t h e sample, some water i s i n e v i t a b l y t r a n s f e r r e d i n t h e for m of v a p o u r . B e c a u s e p r e s s u r e s have been a l l o w e d t o s t a b i l i s e t h e n t h e p a r t i a l p r e s s u r e of t h e w a t e r w i l l be c l o s e t o i t s s a t u r a t e d v a p o u r p r e s s u r e a t t h a t t e m p e r a t u r e . A d s o r p t i o n i s o t h e r m s on s i l v e r and g l a s s s u r f a c e s i n d i c a t e t h a t Sec 2.2.5 37 under s u c h c o n d i t i o n s f i l m s form up t o 100 m o l e c u l e s t h i c k ( M c H a f f i e & L e h n e r , 1925). The f i r s t few l a y e r s mask t h e e f f e c t of s u r f a c e f o r c e s , so t h e f i l m b e haves v e r y l i k e t h e b u l k l i q u i d . I f t h e r e s e r v o i r i s a t a d i f f e r e n t t e m p e r a t u r e from t h e sample t h e n r e - e q u i l i b r a t i o n o f t h e s t o r e d C 0 2 o c c u r s , i n t r o d u c i n g an e r r o r i n t o t h e measured DEL v a l u e . An e s t i m a t e of t h e e f f e c t c a n be made u s i n g e q u a t i o n s 1.3 and 1.4b, and by e v a l u a t i n g p from t y p i c a l p r e s s u r e s and v o l u m e s 1 . I f t h e s e p a r a t i o n f a c t o r f o r b u l k l i q u i d i s a l s o r e p r e s e n t a t i v e f o r t h e a d s o r b e d f i l m t h e n an e r r o r of 0.01°/oo r e s u l t s when t h e t e m p e r a t u r e d i f f e r e n c e between sample and r e s e r v o i r i s 0.9°C. Such a l a r g e d i f f e r e n c e i s u n l i k e l y t o e x i s t but p r e c a u t i o n s have been t a k e n i n t h e m e c h a n i c a l l a y o u t t o m i n i m i s e t h e p o s s i b i l i t y . F i r s t l y , b o t h samples and r e s e r v o i r s a r e l o c a t e d i n c l o s e p r o x i m i t y i n c a s e a s p a t i a l t e m p e r a t u r e d i f f e r e n c e i s s i g n i f i c a n t . S e c o n d l y , p o t e n t i a l h e a t s o u r c e s have been l o c a t e d as f a r as p o s s i b l e from t h e r e s e r v o i r s . The most l i k e l y s o u r c e s a r e t h e V.RSV s o l e n o i d s . T h e s e w i l l r e m a i n on u n t i l t h e i n l e t l i n e a c c e p t s a sample. The t i m e i s b o t h l o n g and v a r i a b l e so t h e t e m p e r a t u r e r i s e becomes s i g n i f i c a n t and u n p r e d i c t a b l e . The s o l e n o i d s a r e t h e r e f o r e l o c a t e d t o w a r d s t h e c e n t e r of t h e r a c k and a r e s e p a r a t e d from t h e r e s e r v o i r s by a t l e a s t 10 i n c h e s of 1/4 i n c h s t a i n l e s s s t e e l t u b i n g . Any h e a t t r a n s f e r s h o u l d be n e g l i g i b l e . P l a c i n g t h e s e s o l e n o i d s c l o s e t o 1 f> w i l l be t h e p a r t i a l p r e s s u r e o f water v a p o u r d i v i d e d by t h a t o f t h e C 0 2 i n t h e s ample. When t h e sample t u b e and t h e r e s e r v o i r a r e of e q u a l v o l u m e s . T y p i c a l l y t h e s e w i l l be 24 and 740 r e s p e c t i v e l y , g i v i n g a v a l u e f o r p o f 0.0032. Sec 2.2.5 38 t h e c e n t e r a l s o m i n i m i s e s t h e volume o f t h e common d i s t r i b u t o r p o i n t , h e l p i n g c o n s e r v e sample g a s , and d e c r e a s i n g pump down t ime. 2.2.6 The Sample F l a s k A s s e m b l y The sample f l a s k a s s e m b l y c o n s i s t s of two components. T h e r e must be a f l a s k , or t u b e , w h i c h c o n t a i n s t h e w a t e r sample w h i l e i t i s e q u i l i b r a t i n g , and a t u b e h o l d e r t h a t b o t h s u p p o r t s and c o n n e c t s t h e t u b e i n t o t h e r a c k . The t u b e h o l d e r s h o u l d be d e s i g n e d t o make r a p i d m o u n t i n g of t h e t u b e a s i m p l e o p e r a t i o n . The t u b e must be c a p a b l e o f h o l d i n g a vacuum i n d e f i n i t e l y , and be t r a n s p a r e n t . T h i s e n a b l e s t h e o p e r a t o r t o c h e c k sample volume, m o n i t o r t h e m a g n e t i c s t i r r e r s , and watch f o r sample s p l a s h d u r i n g pumpdown. The volume o f t h e a s s e m b l y must be l a r g e enough t o d e l i v e r t h e r e q u i r e d amount of gas a t t h e mass s p e c t r o m e t e r . The maximum s i z e w i l l be l i m i t e d by what i s a v a i l a b l e , what f i t s i n t h e a l l o c a t e d s p a c e , and t o a l e s s e r e x t e n t t h e r a t i o o f t h e number of C 0 2 and water m o l e c u l e s . I f t h i s i s t o o l a r g e t h e n t h e a p p r o p r i a t e c o r r e c t i o n f a c t o r s may be u n c e r t a i n ( s e e e q u a t i o n 1.3). Most l i n e s use f l a s k v olumes from 50 t o 100 c c . F i n a l l y i t i s i m p o r t a n t t o p o i n t o u t t h a t c o m m e r c i a l l y a v a i l a b l e f i t t i n g s u s u a l l y r e s u l t i n s i g n i f i c a n t c o s t s a v i n g s , even when t h e y r e q u i r e m o d i f i c a t i o n . The sample a s s e m b l y u s e d i s shown i n f i g u r e 2.3. The sample t u b e i s s i m p l y a one i n c h d i a m e t e r p y r e x t e s t t u b e , a p p r o x i m a t e l y s i x i n c h e s i n l e n g t h . T h e s e have t h e a d v a n t a g e s of t r a n s p a r e n c y , s t r e n g t h u n d e r vacuum, and c h e m i c a l i n e r t n e s s . The r o u n d e d b o t t o m makes i t p o s s i b l e t o s t i r sample volumes as Sec 2.2.6 39 s m a l l as 2.0 c c e f f e c t i v e l y . The c o s t i s so low t h a t t u b e s top plate & mounting flange scale inches 0 2 welds Cajon Ultra-torr fitting (SS-16-UT-A-20) o-ring seal stainless steel tubing. knurled compression ring. Pyrex test tube 1inch diameter. 6inch length. F i g u r e 2.3 The Sample F l a s k A s s e m b l y c o u l d be d i s c a r d e d a f t e r u s e . A m o d i f i e d C a j o n U l t r a - T o r r f i t t i n g f o rms t h e t u b e h o l d e r . The t e s t t u b e i s c o n n e c t e d by i n s e r t i n g i t i n t o t h e body o f t h e f i t t i n g . A vacuum t i g h t c o n n e c t i o n i s made when a hand t i g h t e n e d k n u r l e d r i n g c l a m p s an O - r i n g a r o u n d t h e o u t s i d e of t h e t u b e . In our e x p e r i e n c e t h e s e f i t t i n g s have n e v e r l e a k e d , e ven when u s e d on t h e h i g h vacuum o f t h e mass s p e c t r o m e t e r . The open end o f t h e U l t r a - T o r r f i t t i n g i s s e a l e d by w e l d i n g a s t a i n l e s s s t e e l p l a t e a c r o s s i t . A l e n g t h of 1/4 i n c h s t a i n l e s s s t e e l t u b i n g , w e l d e d i n t o a h o l e b o r e d i n t h e s i d e of t h e f i t t i n g , a l l o w s g a s t o e n t e r and l e a v e t h e a s s e m b l y . The p l a t e a l s o d o u b l e s as a m o u n t i n g b r a c k e t t h a t s u s p e n d s t h e tube a s s e m b l y f r o m t h e t o p r i m o f t h e r a c k c h a s s i s . Sec 2.2.6 40 The t o t a l volume of t h e sample f l a s k a s s e m b l y has been measured a t a p p r o x i m a t e l y 6 5 c c . The p r e s s u r e w i t h i n t h e tube s h o u l d n o t e x c e e d t h a t of t h e a t m o s p h e r e s u r r o u n d i n g i t . P o s i t i v e p r e s s u r e s w i l l f o r c e t h e t e s t t u b e from t h e U l t r a - T o r r f i t t i n g , and i n c r e a s e t h e p o s s i b i l i t y of t h e g l a s s t e s t tube e x p l o d i n g . As i t s t a n d s th e a s s e m b l y i s q u i t e a d e q u a t e but some c h a n g e s c o u l d be made i n f u t u r e v e r s i o n s . F o r a s t a r t , i t has been f o u n d t h a t m i n u a t u r e s t i r r e r b a r s a r e a v a i l a b l e and work e x t r e m e l y w e l l . The neck o f t h e sample t u b e c o u l d t h e r e f o r e be much n a r r o w e r , p o s s i b l y a r o u n d 3/8 of an i n c h . S m a l l e r U l t r a - T o r r f i t t i n g s c o u l d be u s e d . The whole a s s e m b l y would be c h e a p e r , l i g h t e r , and more compact. The t u b e s c o u l d be s t a n d a r d l a b o r a t o r y f l a s k s , or hand blown i f n e c e s s a r y . They would be much s q u a t t e r e n a b l i n g t h e h e i g h t of t h e sample r a c k s t o be d e c r e a s e d s i g n i f i c a n t l y . L a s t l y t h e use of N a l g e n e as a f l a s k m a t e r i a l would be w o r t h i n v e s t i g a t i n g . The h i g h s u r f a c e t e n s i o n of t h e p o l y m e r makes i t h a r d e r f o r w ater d r o p l e t s t o a d h e r e t o t h e t u b e w a l l s . T hese c a n r e s u l t i n s i g n i f i c a n t DEL e r r o r s i f t h e y e q u i l i b r a t e a t a d i f f e r e n t t e m p e r a t u r e t o t h e r e s t of t h e sample, as has been p r e v i o u s l y d i s c u s s e d . 2.2.7 The R e s e r v o i r s - C o n s t r u c t i o n and Volume The r e s e r v o i r c o n s t r u c t i o n shown i n f i g u r e 2.4 i s s i m p l e and s t r a i g h t f o r w a r d . B e c a u s e no c o m m e r c i a l i t e m o f t h e r e q u i r e d shape and volume c o u l d be f o u n d i t was n e c e s s a r y t o machine p a r t s from s u i t a b l e s t a i n l e s s s t e e l s t o c k , and t o have them w e l d e d t o g e t h e r . T h i s p r o v e d a d v a n t a g e o u s . I t l e d t o t h e d e s i g n o f a s e l f s u p p o r t i n g c o n f i g u r a t i o n t h a t f i t t e d n e a t l y Sec 2.2.7 41 i n t o t h e r a c k ' s a i r d u c t . s c a l e : inches I I I 0 1 2 1/4* stainless steel - tubing. F i g u r e 2.4 The c a p a c i t y of t h e r e s e r v o i r was c h o o s e n t o m a x i m i s e th e sample p r e s s u r e a t t h e mass s p e c t r o m e t e r . The optimum v a l u e d e r i v e d f r o m a c o n s i d e r a t i o n of t h e B o y l e gas law i s not a c r i t i c a l one. L a r g e c h a n g e s i n t h e volume o f t h e r e s e r v o i r make l i t t l e d i f f e r e n c e i n t h e end p r e s s u r e of t h e gas a t t h e mass s p e c t r o m e t e r i n l e t l i n e . F o r t h e r e g i o n s o f i n t e r e s t l i t t l e w o u ld have been g a i n e d i f t h e volume o f t h e r e s e r v o i r e x c e e d e d t h a t o f t h e s ample. C o n s e q u e n t l y r e s e r v o i r c a p a c i t y was s e t a t 6 5 c c . A s s u m i n g t h a t s a m p l e s a r e e q u i l i b r a t e d w i t h C 0 2 a t a t m o s p h e r i c p r e s s u r e , and t h a t t h e volume of t h e i n l e t l i n e does not e x c e e d 50cc, a p p r o x i m a t e l y 25 m e t r e s o f 1/4 i n c h o.d. s t a i n l e s s s t e e l t u b i n g c a n be u s e d t o c o n n e c t t h e r a c k s t o t h e mass s p e c t r o m e t e r b e f o r e t h e sample becomes u n u s a b l e (a p r e s s u r e Sec 2.2.7 sta in less steel pipe. 1.25" dia. s c h e d u l e 40. we lds end c a p s - m a c h i n e d from 1/8* stainless s t e e l pbte. R e s e r v o i r C o n s t r u c t i o n 42 below 5cm of Hg). The use o f 1/8 i n c h t u b i n g , and s e p a r a t e d pumping m a n i f o l d s c o u l d i n c r e a s e t h i s beyond any f o r s e e a b l e s h o r t f a l l , b u t i s n o t l i k e l y t o be n e c e s s a r y . 2.2.8 Sample A g i t a t i o n To m i n i m i s e t h e c o m p l e t i o n t i m e o f t h e r e a c t i o n c o n t i n u o u s a g i t a t i o n o f t h e water samples i s n e c e s s a r y d u r i n g e q u i l i b r a t i o n ( s e c t i o n 1.3.3). T r a d i t i o n a l l y s a m p l e s have been mixed by o s c i l l a t i n g t h e sample r a c k as a s i n g l e u n i t . U s u a l l y a s y s t e m u s i n g e c c e n t r i c cams and an e l e c t r i c motor i s employed ( R o e t h e r , 1 9 7 0 ) but r e c e n t l y M i c r o m a s s (1978) have u s e d s o l e n o i d s t o shake t h e r a c k from s i d e t o s i d e . Any s h a k i n g s y s t e m has f u n d a m e n t a l d r a w b a c k s . F o r a u t o m a t e d o p e r a t i o n a f l e x i b l e vacuum c o n n e c t i o n must be u s e d ; t h i s may f a i l . C o n t i n u o u s v i b r a t i o n , i n any form, s e v e r e l y t e s t s t h e d u r a b i l i t y o f a l l components, whether m e c h a n i c a l o r e l e c t r o n i c . An ^ i n t e n s i v e m a i n t e n a n c e program i s mandatory f o r r e l i a b l e o p e r a t i o n . T h e r e a r e o t h e r p r o b l e m s . N o i s e can c r e a t e an i r r i t a t i n g work e n v i r o n m e n t f o r t h e o p e r a t o r , and t h e m e c h a n i c a l c o m p l e x i t i e s can be a major p r o j e c t f o r t h e d e s i g n e r . O p t i m i s i n g t h e s h a k i n g m o t i o n i s no t r i v i a l t a s k . B o t h f r e q u e n c y and a m p l i t u d e must be a d j u s t e d t o m a x i m i s e t h e r e a c t i o n r a t e w i t h o u t s p l a s h i n g any water o n t o t h e s i d e s of t h e sample t u b e . M a g n e t i c s t i r r e r s seem t o s u f f e r none o f t h e s e d i s a d v a n t a g e s . They a r e q u i e t , v i b r a t i o n f r e e , and m e c h a n i c a l l y s i m p l e . Even a t low s p i n r a t e s t h e v o r t e x g e n e r a t e d by t e f l o n - e n c a s e d s t i r r e r b a r s i n t h e sample seems p a r t i c u l a r l y e f f i c i e n t . A d r o p of i n k p l a c e d on t h e s u r f a c e i s c o m p l e t e l y mixed w i t h i n Sec 2.2.8 43 t w enty s e c o n d s . Sample s p l a s h i s n o n - e x i s t e n t no m a t t e r how r a p i d l y t h e s t i r r e r r o t a t e s . 2.2.9 The M a g n e t i c S t i r r e r s The s t i r r i n g s y s t e m r e l i e s on a r o t a t i n g m a g n e t i c f i e l d t o c o u p l e w i t h s m a l l t e f l o n e n c a s e d magnets i n t h e sample t u b e s . U s u a l l y t h e f i e l d i s g e n e r a t e d by r o t a t i n g a s t r o n g magnet w i t h a s m a l l e l e c t r i c m o t or. However t h e s i z e and expe n s e o f c o m m e r c i a l l y a v a i l a b l e u n i t s was u n a c c e p t a b l e , t h e c o s t o f a s s e m b l i n g s t i r r e r s of s i m i l i a r d e s i g n would be p r o h i b i t i v e , and t h e r e were f e a r s t h a t d i f f e r e n c e s i n t h e e f f i c i e n c i e s of t h e mo t o r s c o u l d g e n e r a t e u n c o n t r o l l a b l e t e m p e r a t u r e g r a d i e n t s between s a m p l e s . I n s t e a d of e l e c t r i c m o t o r s a s o u r c e o f compact and non- e x p e n s i v e water t u r b i n e s t i r r e r s was l o c a t e d . I t was f e l t t h a t t e m p e r a t u r e g r a d i e n t s would not be a p r o b l e m w i t h t h e s e d e v i c e s b e c a u s e o f t h e r a p i d f l o w of water t h r o u g h them. In p r a c t i c e o t h e r p r o b l e m s d e v e l o p e d . F i r s t l y t h e p l u m b i n g n e c e s s a r y t o s u p p l y an a d e q u a t e f l o w r a t e was cumbersome, and volume o f water u s e d was .high enough t o r e q u i r e a r e c i r c u l a t i n g pump. More s e r i o u s l y , PVC t u r b i n e b e a r i n g s i n t h e s t i r r e r s p r o v e d u n r e l i a b l e and i n c a p a b l e of s u s t a i n e d o p e r a t i o n . When t h e r a c k was l o a d e d w i t h i d e n t i c a l s amples s i g n i f i c a n t d e v i a t i o n s i n DEL c o u l d be a t t r i b u t e d t o t h e d i f f e r i n g s p i n r a t e s o f t h e f a l t e r i n g s t i r r e r s . I t became o b v i o u s t h a t a more r e l i a b l e s y s t e m was a b s o l u t e l y n e c e s s a r y , and t h a t t h e s t i r r e r s s h o u l d s p i n i n s y n c h r o n y . A f t e r d i s c u s s i o n w i t h o t h e r s i n our g r o u p two a l t e r n a t i v e s a r o s e . One was t o c o u p l e t h e s t i r r e r s w i t h a t o o t h e d b e l t Sec 2.2.9 44 d r i v e . The o t h e r i n v o l v e d c o n s t r u c t i o n o f a s y n c h r o n o u s e l e c t r i c m o t o r . The s e c o n d a p p r o a c h p r o v e d b o t h f e a s i b l e and s i m p l e . A f t e r some e n c o u r a g i n g e x p e r i m e n t s t h e f i n a l d e s i g n shown i n f i g u r e 2.5 was a d o p t e d . E a c h motor on t h e r a c k i s a s s e m b l e d from r e a d i l y a v a i l a b l e p a r t s . A l a r g e s t e e l washer forms t h e b a s e , s t e e l b o l t s and n u t s t h e p o l e p i e c e s , and r e e d r e l a y c o i l s t h e f i e l d w i n d i n g s . M a c h i n i n g i s l i m i t e d t o f o u r h o l e s d r i l l e d i n t h e b a s e washer. A s s e m b l y i s c o m p l e t e d w i t h i n m i n u t e s . 5/16" steel reed relay 2"x 5/16" steel F i g u r e 2.5 S c h e m a t i c D i a g r a m showing C o n s t r u c t i o n of t h e M a g n e t i c S t i r r e r s The ' s e c r e t ' of t h e s t i r r e r s i s n o t t h e c o n s t r u c t i o n of t h e motor but t h e manner i n w h i c h t h e m a g n e t i c f i e l d s a r e p r o d u c e d . The c o i l s on o p p o s i t e p a i r s of p o l e s a r e w i r e d t o g e n e r a t e a f i e l d between them. The f i e l d may be r e v e r s e d by r e v e r s i n g t h e d i r e c t i o n o f c u r r e n t w i t h a s i m p l e s o l i d s t a t e s w i t c h . By u t i l i s i n g two s u c h s w i t c h e s i t i s p o s s i b l e t o g e n e r a t e a s e q u e n c e t h a t r o t a t e s t h e m a g n e t i c f i e l d i n e i g h t s e p a r a t e Sec 2.2.9 45 s t e p s . The c i r c u i t r y n e e d ed t o g e n e r a t e t h e d r i v e s e q u e n c e r e q u i r e d o n l y t h r e e i n t e g r a t e d c i r c u i t p a c k a g e s , f o u r t r a n s i s t o r s , s e v e r a l r e s i s t o r s and c a p a c i t o r s . Two s o l e n o i d d r i v e r p a c k a g e s and t h e t r a n s i s t o r s a r e u s e d t o s w i t c h t h e c o i l c u r r e n t s , a f o u r - b i t J o h n s o n c o u n t e r g e n e r a t e s t h e c o r r e c t s w i t c h s e q u e n c e , and s p a r e p a r t s o f t h e d r i v e c h i p s a r e u s e d as an o s c i l l a t o r t o c l o c k t h e J o h n s o n c o u n t e r . F i n a l l y t h e low e n e r g y c o n s u m p t i o n o f t h e a g i t a t i o n s y s t e m i s one of i t s most s t r i k i n g a s p e c t s . Whereas t h e p r e v i o u s scheme needed a 120 watt motor t o pump an a d e q u a t e s u p p l y o f w a t e r , t h e p r e s e n t power r e q u i r e m e n t i s a b o u t two o r d e r s of m a g n i t u d e l o w e r . No p r o b l e m s c an a r i s e from d i f f e r e n t i a l h e a t i n g i n t h e f i e l d w i n d i n g s . 2.3 THE MAIN LINE 2.3.1 The Main L i n e M a n i f o l d The m a n i f o l d a l l o w s t h e r a c k s t o be c o n n e c t e d t o t h e vacuum pump and t h e C 0 2 c y l i n d e r . I t s h o u l d be of s u f f i c i e n t d i a m e t e r t o a l l o w r a p i d pump down, and c a p a b l e o f s u s t a i n i n g vacuums below t h e 10 m i l l i t o r r l e v e l . Compared t o t h e h i g h vacuum s y s t e m s needed i n t h e mass s p e c t r o m e t e r t h e s e s p e c i f i c a t i o n s were e a s i l y met u s i n g s t a n d a r d one i n c h c o p p e r p i p e and f i t t i n g s . E n t i r e l y a d e q u a t e j o i n s were made w i t h l e a d / t i n s o l d e r . The t u b i n g was e a s i l y m a c h i n e d t o t a k e a v a r i e t y of f i t t i n g s and t h e geometry of t h e m a n i f o l d c o u l d be c h a n g e d i n t h e l a b w i t h o u t a s p e c i a l t r i p t o t h e w e l d i n g shop. Sec 2.3.1 46 Some d o u b t s m i g h t be r a i s e d when c o n s i d e r i n g t h e r a t h e r r e a c t i v e n a t u r e o f t h e c o p p e r but s u c h a p o s s i b i l i t y i s u n l i k e l y t o c a u s e p r o b l e m s . C a r b o n d i o x i d e i s o n l y i n c o n t a c t w i t h t h e m a n i f o l d on i t s way t o t h e sample t u b e s , and t h e n o n l y f o r one m i n u t e . In any c a s e t h e gas i s d r y and u n l i k e l y t o r e a c t . Even i f i t d o e s , any s h i f t i n i t s DEL s h o u l d a f f e c t b o t h s t a n d a r d s and s a m p l e s e q u a l l y and c o n t r i b u t e no e r r o r t o t h e f i n a l r e s u l t s . 2.3.2 The Vacuum Pump P r e v i o u s c a l c u l a t i o n s showed t h a t r e s i d u a l p r e s s u r e s of 10 m i l l i t o r r would c a u s e no s i g n i f i c a n t e r r o r s , - even when t h e r e s i d u a l gas was e n t i r e l y C 0 2 . Such c o n d i t i o n s a r e w e l l w i t h i n t h e c a p a b i l i t i e s of any d o u b l e - s t a g e r o t a r y vacuum pump. More i m p o r t a n t l y , t h e pump must be c a p a b l e of p a s s i n g r a t h e r l a r g e amounts o f water v a p o u r and a i r w i t h o u t c o n t a m i n a t i o n of t h e pump o i l . G e n e r a l l y t h e l a r g e r t h e pump chambers a r e and t h e more o i l t h e r e i s , t h e l e s s a p r o b l e m c o n t a m i n a n t s become. A b a l l a s t v a l v e i s v a l u a b l e as i t a l l o w s a i r t o p u r g e t h e pump chambers, and t o s t r i p t h e water m o l e c u l e s from t h e o i l . F o r t h e above r e a s o n s an o l d model Welch pump was p r e s s e d i n t o s e r v i c e . A l t h o u g h b u l k y by modern s t a n d a r d s i t was known t o be t r o u b l e f r e e , and c o u l d h a n d l e t h e water v a p o u r . F i n d i n g a s o l e n o i d t o i s o l a t e t h e vacuum pump from t h e m a n i f o l d p r e s e n t e d some p r o b l e m s . T h e r e a r e many k i n d s w h i c h c a n a d e q u a t e l y s e a l a one i n c h d i a m e t e r p i p e ; t h e r e a r e few t h a t open o r c l o s e a g a i n s t a p r e s s u r e o f o v e r one a t m o s p h e r e . T h i s Sec 2.3.2 47 r e q u i r e s a p l u n g e r - t y p e s o l e n o i d t o p u l l w i t h a f o r c e of o v e r f i v e k i l o g r a m s , so a b u t t e r f l y o r d o o r t y p e mechanism i s u s u a l l y u s e d , p o s s i b l y p n e u m a t i c a l l y d r i v e n . I n s t e a d o f r e s o r t i n g t o s u c h e x p e n s i v e c o m p l i c a t i o n s a r a t h e r s i m p l e r method was i m p l e m e n t e d . T h i s u s e d an a i r a d m i t t a n c e v a l v e (Edwards model SVA-25) c o n n e c t e d i n t h e r e v e r s e of t h e u s u a l manner. H i g h p r e s s u r e s i n t h e m a n i f o l d p u s h t h e p l u n g e r a g a i n s t i t s s e a t i n g , h e l p i n g t o m a i n t a i n a good s e a l . The s o l e n o i d t h a t o p e r a t e s t h e p l u n g e r i s t o t a l l y i n c a p a b l e of o p e r a t i n g a g a i n s t p r e s s u r e s above two o r t h r e e p s i so i t i s n e c e s s a r y t o b y p a s s t h e l a r g e S o l e n o i d w i t h a n o t h e r t h a t has a s m a l l e r o r i f i c e . T h i s can o p e r a t e a g a i n s t p r e s s u r e s o f o v e r 100 p s i , and w i l l e v a c u a t e t h e m a n i f o l d u n t i l t h e l a r g e p l u n g e r can open. In p r a c t i c e t h i s o c c u r s a f t e r a p p r o x i m a t e l y f i v e s e c o n d s . 2.3.3 P r e s s u r e Gauges Two gauges have been p r o v i d e d on t h e s y s t e m t o m o n i t o r e v a c u a t i o n o f t h e r a c k s and a d m i t t a n c e of C 0 2 . The l o w e r r a n g e gauge i s a s t a n d a r d t h e r m o c o u p l e t y p e . I t g i v e s r e l i a b l e r e a d i n g s f r o m 5 t o 500 m i l l i t o r r and i s u s e f u l f o r e v a l u a t i n g t h e r e m o v a l of r e s i d u a l gas from t h e r a c k s , and f o r d e t e c t i n g s m a l l l e a k s . The h i g h e r range measures a b s o l u t e p r e s s u r e s from 5 t o 1500 t o r r . T h i s c a n m o n i t o r pump down of t h e w ater s a m p l e s , and a d m i t t a n c e of C 0 2 t o t h e sample t u b e s . B e c a u s e r e l i a b l e a b s o l u t e gauges of t h i s r a n g e a r e e x t r e m e l y e x p e n s i v e , a p i e z o e l e c t r i c gauge p r e s s u r e t r a n s d u c e r was u s e d . The e n t i r e t r a n s d u c e r , n o r m a l l y a t a t m o s p h e r i c p r e s s u r e , has been p l a c e d i n an o - r i n g s e a l e d chamber t h a t can be e v a c u a t e d under computer Sec 2.3.3 48 c o n t r o l . The p r e s s u r e p o r t c o n n e c t s t o t h e vacuum m a n i f o l d t o measure a b s o l u t e p r e s s u r e a g a i n s t t h e z e r o r e f e r e n c e . The r e a d i n g s from b o t h gauges a r e v i s i b l e t o t h e o p e r a t o r on two m e t e r s , and a r e a v a i l a b l e t o t h e c o n t r o l l i n g m i c r o p r o c e s s o r t h r o u g h two a n a l o g u e - t o - d i g i t a l c o n v e r t e r c h a n n e l s . 2.3.4 The C 0 2 S u p p l y C a r b o n d i o x i d e i s p i p e d d i r e c t l y from t h e same c y l i n d e r t h a t s u p p l i e s t h e r e f e r e n c e s i d e of t h e mass s p e c t r o m e t e r i n l e t l i n e . A s t a n d a r d r e g u l a t o r i s u s e d t o m a i n t a i n a s m a l l p o s i t i v e p r e s s u r e i n t h e d i s t r i b u t i o n l i n e ( a p p r o x i m a t e l y 5 p s i g ) . A d m i t t a n c e t o t h e m a n i f o l d i s v i a a s m a l l s o l e n o i d ( S k i n n e r t y p e B2DX70). 2.4 THE MASS SPECTROMETER LINE 2.4.1 The Gas L i n e s The mass s p e c t r o m e t e r l i n e t r a n s p o r t s gas samples from t h e r a c k s t o t h e i n l e t l i n e . T h e r e a r e t h r e e main components; a m a n i f o l d t h a t c o n n e c t s a l l r a c k s t o a p e l t i e r c o o l e d v a p o u r t r a p , t h e t r a p i t s e l f , and i t s c o n n e c t i o n t o t h e mass s p e c t r o m e t e r i n l e t l i n e . The volume t h r o u g h o u t has been kept as low as p o s s i b l e t o c o n s e r v e sample g a s . Gas f l o w s t o t h e i n l e t l i n e a l o n g a p p r o x i m a t e l y 1.5 m e t r e s of s m a l l b o r e s t a i n l e s s s t e e l t u b i n g (1.6mm i . d . ) . E v a c u a t i o n t i m e s would be e x c e s s i v e l y l o n g i f i t were n o t f o r t h e low Sec 2.4.1 49 volume of t h i s s e c t i o n , and t h e d r y n e s s of t h e gas p a s s i n g t h r o u g h i t . Much h i g h e r r e s i d u a l p r e s s u r e s can be t o l e r a t e d b e f o r e c o n t a m i n a t i o n and r e - e q u i l i b r a t i o n e r r o r s become a t a l l n o t i c e a b l e . More c a r e i s r e q u i r e d w i t h t h e m a n i f o l d p r e c e d i n g t h e v a p o u r t r a p . I t s t u b i n g must be l a r g e enough t o pump away a d s o r b e d w a t e r d u r i n g t h e t i m e between a n a l y s e s , but must be s m a l l enough t o c o n s e r v e sample gas volume. The c u r r e n t c o n f i g u r a t i o n u s e s a b o u t one metre of s t a i n l e s s s t e e l t u b e , w i t h an i n s i d e d i a m e t e r of 0.32 m i l l i m e t r e s ( 1 / 8 " ) , t o c o n n e c t t h e r a c k and t h e t r a p . T h e mass s p e c t r o m e t e r l i n e i s pumped f o r t e n m i n u t e s between s a m p l e s , and t h e r e i s no i n d i c a t i o n of e r r o r from water a d s o r b e d on i t s s u r f a c e s . 2.4.2 A P e l t i e r C o o l e d Vapour T r a p The r e m o v a l of c o n d e n s i b l e c o n t a m i n a n t s from vacuum s y s t e m s i s an o l d p r o b l e m , and many methods have e v o l v e d t o meet i t . U n f o r t u n a t e l y , a v a i l a b l e c o m m e r c i a l t r a p s l a c k e d i n s e v e r a l a s p e c t s , and i t p r o v e d n e c e s s a r y t o d e s i g n s o m e t h i n g more s u i t a b l e . T h e r e were t h r e e i m p o r t a n t c r i t e r i a t o meet: a s m a l l i n t e r n a l volume, r e l i a b l e u n a t t e n d e d o p e r a t i o n , and t h e a b i l i t y t o f r e e z e away water v a p o u r w i t h o u t l i q u e f y i n g any o f t h e C 0 2 . The b a s i c t r a p i s m a c h i n e d from a s m a l l s t a i n l e s s s t e e l b l o c k ( F i g u r e 2 . 6 ) . A b l i n d , 3/8" d i a m e t e r , h o l e forms t h e i n t e r n a l c a v i t y . T h i s has been t a p p e d and s e a l e d w i t h two C a j o n U l t r a - T o r r o - r i n g f i t t i n g s . T h e s e m i n i m i s e t h e r m a l c o n d u c t i o n between t h e t r a p and t h e r e s t of t h e l i n e by a l l o w i n g c o n n e c t i o n s t o be made w i t h 1/4" d i a m e t e r g l a s s t u b i n g . The t o p C a j o n f i t t i n g has been b o r e d t h r o u g h so t h e i n l e t t u b e can Sec 2.4.2 50 p r o t r u d e i n t o t h e b o t t o m of t h e c a v i t y . T h i s f o r c e s t h e gas t o F i g u r e 2.6 P e l t i e r C o o l e d V a p o u r T r a p A s s e m b l y f l o w i n a t h i n l a y e r o v e r t h e c o l d s t a i n l e s s s t e e l s u r f a c e on i t s way t o t h e e x i t p o r t . Not o n l y does t h e gas c o o l f a s t e r , b ut s m a l l i c e p a r t i c l e s s h o u l d f a l l t o t h e b o t t o m o f t h e t r a p and r e m a i n t h e r e . F o u r t h e r m o - e l e c t r i c c o o l i n g modules ( M e l c o r , CP 1.4-71- Sec 2.4.2 51 06L) r e f r i g e r a t e t h e b l o c k . The modules a r e an e x t r e m e l y r u g g e d and compact a r r a y of t h e r m o c o u p l e j u n c t i o n s t h a t o p e r a t e t h r o u g h a phenomenon known as t h e P e l t i e r e f f e c t . E l e c t r i c power, d i s s i p a t e d i n t h e j u n c t i o n s , pumps h e a t f r o m one f a c e of t h e module t o t h e o t h e r . The c o l d f a c e s of f o u r c o o l i n g modules a r e cemented t o t h e s t a i n l e s s s t e e l b l o c k w i t h a h e a t - s i n k compound. T h i s a s s e m b l y i s t h e n s a n d w i c h e d between two l a r g e b r a s s h e a t s i n k s , and t h e a i r s p a c e i n s i d e i s p a c k e d w i t h a foam i n s u l a t i o n . Tap w ater f l o w s t h r o u g h h o l e s b o r e d i n t h e h e a t s i n k s t o keep them and t h e o u t e r f a c e s of t h e modules a t a p p r o x i m a t e l y 10°C. The modules a r e w i r e d i n s e r i e s so t h e y may be d r i v e n f r o m t h e 24 v o l t s o l e n o i d power s u p p l y . Power c o n s u m p t i o n i s a r o u n d 100 w a t t s . The s u r f a c e t e m p e r a t u r e of t h e s t a i n l e s s s t e e l b l o c k has been measured a t a c o n s t a n t -25°C, even when wet gas i s p a s s i n g t h r o u g h t h e t r a p . T h e r e i s a b s o l u t e l y no i n d i c a t i o n of water a r r i v i n g a t t h e mass s p e c t r o m e t e r , nor do t h e r e a p p e a r t o be any "memory" e f f e c t s a s s o c i a t e d w i t h w ater a d s o r b e d by t h e t r a p and t h e m a n i f o l d . Sec 2.4.2 CHAPTER I I I . HARDWARE ORGANIZATION AND OPERATION 52 3.1 SYSTEM ORGANIZATION A l t h o u g h t h e r e i s n o t h i n g p a r t i c u l a r l y i n n o v a t i v e i n t h e d e s i g n o f t h e e l e c t r o n i c s h a r d w a r e , i t s c o n s t r u c t i o n was n e c e s s a r y t o implement t h e i d e a s d e s c r i b e d i n t h i s t h e s i s . T h i s c h a p t e r p r e s e n t s t h e o v e r a l l o r g a n i s a t i o n of t h e m i c r o p r o c e s s o r c o n t r o l l e r ( f i g u r e 3.1) and g i v e s a n o n - t e c h n i c a l d e s c r i p t i o n o f i t s component p a r t s . O t h e r s who seek a more d e t a i l e d t e c h n i c a l e x p l a n a t i o n may f i n d i t i n A p p e n d i x I . I f o u n d i t c o n v e n i e n t t o use a p r e - a s s e m b l e d m i c r o p r o c e s s o r s y s t e m know as t h e U n i v e r s i t y K i t b o a r d . A l t h o u g h o r i g i n a l l y i n t e n d e d f o r u n i v e r s i t y l e v e l t u t o r i a l s i n m i c r o p r o c e s s o r d e s i g n t h e b o a r d a d a p t s e a s i l y t o o t h e r t a s k s , and comes w i t h an i m p r e s s i v e a r r a y of hardware d e v i c e s and s o f t w a r e t o o l s . 3.1.1 System Buses I t i s e v i d e n t from f i g u r e 3.1 t h a t t h e v a r i o u s p a r t s o r modules of t h e s y s t e m communicate w i t h e a c h o t h e r e l e c t r i c a l l y u s i n g a p a r a l l e l b us. The bus may be d i v i d e d i n t o t h r e e s e p a r a t e p a r t s . 1) The u n b u f f e r e d TTL l e v e l bus on t h e U n i v e r s i t y K i t b o a r d . T h i s bus i s a d e q u a t e when c o m m u n i c a t i n g w i t h a l l o n - b o a r d p a r t s b u t must be b u f f e r e d i f t h e s y s t e m i s expanded. 2) The TTL l e v e l e x p a n s i o n bus on t h e e x p a n s i o n b o a r d i s u s e d t o i n t e r f a c e TTL l e v e l d e v i c e s t h a t t h e U n i v e r s i t y K i t does not Sec 3.1.1 53 p r o v i d e ( s u c h as t h e a n a l o g u e t o d i g i t a l c o n v e r t e r (ADC) and piezo-electric interrupt control lines sound disk. system i/o port {) 11mS intrpt 1 user i/o port 200mS intrpt 7 T micro- processor TMS9980A I UNIBUG rom TTL BUS expansion interface ft •s 3 t_ t_ a i % ui 3 XI Ul o E o a. eprom 1. a 3 u « u a TTL EXPANSION BUS ram tty interface / \ 7 \ 7 cmos bus interface eproms 28,3 adc channel 1 0 Qp7 \ O O O O O o o o o o pressure gouges cmos bus 4>-interrupt iinfl thermo BBB piezo CMOS BUS. rack 0 J up to sixteen racks F i g u r e 3.1 System O r g a n i s a t i o n 2. inlet line controller master control board. v.vac -»• v. lek v. ref v.co2 c.pel e x t r a EPROM). 3) CMOS l e v e l e x p a n s i o n bus t h a t i s u s e d t o communicate w i t h Sec 3.1.1 54 " n o i s y " d e v i c e s . T h e s e a r e p r i m a r i l y any modules a s s o c i a t e d w i t h s o l e n o i d d r i v e r s w h i c h t e n d t o c r e a t e l a r g e s u r g e s and s p i k e s i n any s i g n a l l i n e s w i t h i n r e a s o n a b l e p r o x i m i t y . CMOS c i r c u i t r y i s l e s s s u s c e p t i b l e t o t h i s i n t e r f e r e n c e b e c a u s e i t i s c a p a b l e of o p e r a t i n g a t a h i g h e r v o l t a g e l e v e l (12 v o l t s as o p p o s e d t o 5 v o l t s ) . The u s u a l p e n a l t y i n s p e e d of s u c h CMOS d e v i c e s i s u n i m p o r t a n t h e r e , a s a r e t h e c o n c u r r e n t a d v a n t a g e s o f low power. 3.1.2 System M o d u l e s The h ardware may be b r o k e n down i n t o t h e f o l l o w i n g i m p o r t a n t p a r t s . 1) The m i c r o p r o c e s s o r (TMS 9980A) - a 16 b i t machine w i t h a 2 MHz c l o c k . 2) Random A c c e s s Memory (RAM) - up t o IK b y t e s f o r program v a r i a b l e s . 3) Read O n l y Memory (ROM) - The UNIBUG m o n i t o r and EPROM f o r u s e r p r o g r a m s . 4) I n p u t / O u t p u t P o r t s . a) System I/O p o r t - c o n t r o l s t h e k e y b o a r d , d i s p l a y , v i s u a l and a c o u s t i c i n d i c a t o r s . b) U s e r I/O p o r t - i s a 16 b i t programmable I/O p o r t t h a t d o u b l e s a s an i n t e r r u p t i n t e r f a c e . c) A s y n c h r o n o u s C o m m u n i c a t i o n s C o n t r o l l e r - s u i t a b l e f o r o p e r a t i n g a t e l e t y p e . 5) Bus i n t e r f a c e - t o b u f f e r and expand t h e s y s t e m from t h e o n b o a r d b u s . 6) A s i x t e e n c h a n n e l , i n t e r r u p t d r i v e n , a n a l o g u e - t o - d i g i t a l Sec 3.1.2 55 c o n v e r t e r . 7) CMOS bus i n t e r f a c e and e x p a n s i o n - l e v e l t r a n s l a t i o n , h a n d s h a k i n g and i n t e r r u p t s . 8> M a s t e r c o n t r o l b o a r d - h a n d l e s sample p r e p a r a t i o n f u n c t i o n s u s e d by a l l r a c k s . T h i s i n c l u d e d c o m m u n i c a t i o n w i t h t h e i n l e t c o n t r o l l e r , t h e vacuum pump, t h e p r e s s u r e r e f e r e n c e , t h e p e l t i e r v a p o u r t r a p , and t h e c a r b o n d i o x i d e c y l i n d e r . 9) Rack c o n t r o l b o a r d s - c o n t r o l a l l LEDs and s o l e n o i d s ; s e n s e d o o r s w i t c h e s and t h e r e l a y power s u p p l y f o r e a c h r a c k . 3.1.3 System Memory Map W i t h t h e e x c e p t i o n of t h e t h r e e I/O p o r t s a l l t h e s y s t e m modules c a n be c o n s i d e r e d as p a r t of memory. The memory map of t h e c u r r e n t s y s t e m i s shown i n T a b l e 3.1, but b e c a u s e t h e hardware has been p r o v i d e d w i t h a d d r e s s i n g s w i t c h e s i t i s p o s s i b l e t o r e l o c a t e t h e r a c k s , t h e m a s t e r c o n t r o l b o a r d , and the a n a l o g u e t o d i g i t a l c o n v e r t e r . T h i s would a l l o w t h e a d d i t i o n o f a n o t h e r EPROM. The m a s t e r c o n t r o l b o a r d u s e s two words ( s t a t u s and c o n t r o l P h y s i c a l D e v i c e Memory A d d r e s s RAM EPROM.1 EPROM.2 EPROM.3 RACKS MASTER ADC unused unused 0000 t o 07FF 0800 t o 0FFF 1000 t o 17FF 1800 t o 1FFF 2000 t o 20FF 2100 t o 21FF 2200 t o 2203 2204 t o 2FFF 3000 t o 3FFF T a b l e 3.1 System Memory Map Sec 3.1.3 56 r e g i s t e r s ) but t h e s e a r e s e l e c t e d w i t h o n l y t h e two l e a s t s i g n i f i c a n t b i t s o f t h e CMOS a d d r e s s b u s . Thus t h e m a s t e r c o n t r o l b o a r d i n e f f i c i e n t l y o c c u p i e s a l l of t h e memory shown i n t a b l e 3.1. Such r e d u n d a n c y i s n o t uncommon i n m i c r o p r o c e s s o r d e s i g n . U s u a l l y s a v i n g s i n t h e d e c o d i n g c i r c u i t r y a r e g r e a t when not a l l o f t h e memory sp a c e i s needed. 3.1.4 M o d u l a r i t y I t i s i m p o r t a n t t o d e s i g n t h e c o m p l e t e sample l i n e p r e p a r a t i o n s y s t e m w i t h a l a r g e e x p a n s i o n c a p a b i l i t y . I t s h o u l d be p o s s i b l e t o c o n s t r u c t new r a c k s a s t h e y a r e needed and t o c o n n e c t them i n t o t h e s y s t e m w i t h o u t making any m e c h a n i c a l , h ardware or s o f t w a r e c h a n g e s . T h i s need i s f u l f i l l e d by u s i n g a b u f f e r e d , p a r a l l e l I/O bus on w h i c h t h e r a c k s may be p l a c e d , and by u s i n g s w i t c h e s t o s e t up t h e a d d r e s s of e a c h r a c k . 3.2 THE MICROPROCESSOR (TM9980) The U n i v e r s i t y B o a r d i s b u i l t a r o u n d t h e Te x a s I n s t r u m e n t s TM9980A m i c r o p r o c e s s o r . I t s i n s t r u c t i o n s e t i s c o m p a t i b l e w i t h t h e TI 990/9900 f a m i l y of m i c r o c o m p u t e r s and p r o c e s s o r s but t h e r e were s e v e r a l f e a t u r e s t h a t made i t s c h o i c e v e r y a t t r a c t i v e . 1) A 16 b i t c e n t r a l p r o c e s s i n g u n i t . The a b i l i t y of any m i c r o p r o c e s s o r t o o p e r a t e d i r e c t l y on a 16 b i t word e n h a n c e s s o f t w a r e c a p a b i l i t y two ways. a) Any a d d r e s s i n t h e ran g e from 0 t o 65,535 can be r e f e r e n c e d d i r e c t l y . When p r o c e s s o r o p e r a t i o n s a r e Sec 3.2 57 l i m i t e d t o an 8 b i t word t h e c o r r e s p o n d i n g range i s u s u a l l y 256 b y t e s . R e f e r e n c e s t o s u b r o u t i n e s , o r I/O a r e o f t e n f u r t h u r away, so t h e r e i s c o n s t a n t s h u f f l i n g o f h i g h and low b y t e s between EPROM and r e g i s t e r s b) A r i t h m e t i c and l o g i c a l o p e r a t i o n s on 16 b i t word i n v o l v e s e v e r a l s t e p s w i t h an 8 b i t p r o c e s s o r . T h e s e a r e a c c o m p l i s h e d w i t h one i n s t r u c t i o n i n t h i s m a c h i n e , and t h i s a l l o w s c o n v e n i e n t m a n i p u l a t i o n of b l o c k s o f s i x t e e n s a m p l e s . To l i m i t s amples t o b l o c k s o f e i g h t was not p r a c t i c a l . 2) An 8 b i t , m u l t i p l e x e d d a t a b u s . O p e r a t i o n s on 16 b i t words u s u a l l y r e q u i r e a 16 b i t d a t a bus i f o p t i m a l s p e e d i s t o be a t t a i n e d . By s a c r i f i c i n g s p e e d i t i s p o s s i b l e t o r e d u c e t h e bus s i z e and t o g a i n i n terms of h a r d w a r e c o s t and c o m p l e x i t y . In t h e TM9980, memory c o n t e n t s a r e r e a d and w r i t t e n i n two c y c l e s , one 8 b i t b y t e a t a t i m e . The i n s t r u c t i o n c y c l e t a k e s a p p r o x i m a t e l y t w i c e as l o n g t o e x e c u t e but t h i s i s o f no c o n s e q u e n c e i n oxygen i s o t o p e sample p r e p a r a t i o n . However w i t h bus i n t e r f a c e s t o be p r o v i d e d on s i x t e e n r a c k s t h e s a v i n g s i n w i r i n g and components a r e c o n s i d e r a b l e . 3) Workspace P o i n t e r . U s u a l l y machine o p e r a t i o n s t a k e p l a c e i n an i n t e r n a l r e g i s t e r s e t . T h i s p r o c e s s o r c o n t a i n s no i n t e r n a l work r e g i s t e r s but u s e s a p o i n t e r t o d e f i n e a b l o c k o f RAM t h a t i s e q u i v a l e n t . The c o n t e x t i n w h i c h t h e CPU works i s t h e r e f o r e e a s i l y c h a n g e d by c h a n g i n g w o r k s p a c e p o i n t e r s . T h i s has a l l o w e d t h e d e s i g n of a s i m p l e , y e t e l e g a n t way o f s c h e d u l i n g t a s k s ( s e e C h a p t e r 4 ) . Sec 3.2 58 A d d i t i o n a l l y t h e c h i p has t h e f o l l o w i n g f e a t u r e s w h i c h make l i f e c o n s i d e r a b l y e a s i e r f o r t h e hardware d e s i g n e r and programmer. 1) S i x p r i o r i t i s e d i n t e r r u p t s s i m p l i f y d e t e c t i o n and s e r v i c e i n b o t h a hardware and a s o f t w a r e s e n s e . 2) An a d d r e s s a b l e memory of 16 k i l o b y t e s i s more t h a n a d e q u a t e f o r most n e e d s . 3) An a d d r e s s a b l e s i n g l e b i t I/O i n t e r f a c e , s e p a r a t e f r o m memory mapped I/O a l l o w s t i m e s , t e l e t y p e s , k e y b o a r d s , d i s p l a y s , LEDs, and i n t e r r u p t s t o be e a s i l y r e f e r e n c e d , t e s t e d , and ch a n g e d . T h i s i s e s p e c i a l l y t r u e g i v e n t h a t t h e i n t e r f a c e s t o a l l t h e s e d e v i c e s a l r e a d y e x i s t on t h e U n i v e r s i t y K i t b o a r d . On t h e whole a p o w e r f u l i n s t r u c t i o n s e t , s i x d i f f e r e n t a d d r e s s i n g modes, and t h e e x t e n s i v e o n - b o a r d i n t e r f a c i n g have made a p p l i c a t i o n of t h i s b o a r d p a r t i c u l a r l y e a s y and c l e a n . 3.3 RANDOM ACCESS MEMORY RAM i s u s e d t o s t o r e d a t a ( b o t h i n p u t and o u t p u t ) , and t e m p o r a r y and immediate r e s u l t s of program e x e c u t i o n . The U n i v e r s i t y K i t b o a r d has p r o v i s i o n f o r 1028 b y t e s (512 words) of RAM w h i c h i s q u i t e a d e q u a t e t o s y s t e m n e e d s . RAM has t h e d i s a d v a n t a g e t h a t a power f a i l u r e w i l l d e s t r o y any i n f o r m a t i o n s t o r e d w i t h i n i t , but b a t t e r y backup c o u l d be p r o v i d e d i f r e q u i r e d . Sec 3.3 59 3.4 EPROM MEMORY A l l p r o g r a m i s s t o r e d w i t h i n e r a s e a b l e / p r o g r a m m a b l e r e a d o n l y memory. T h i s i s p r o v i d e d u s i n g t h r e e INTEL2716 c h i p s w i t h a c a p a c i t y o f 1024 words e a c h . One c h i p i s on t h e U n i v e r s i t y K i t b o a r d and two more have been added t o t h e TTL e x p a n s i o n b us. An e x t r a INTEL2716 c o u l d be adde d i f f u r t h u r d e c o d i n g c i r c u i t r y was d e s i g n e d , and i f t h e a d d r e s s e s o f t h e ADC, t h e CMOS bus, and th e m a s t e r b o a r d were c h a n g e d . EPROM's a r e e r a s e d by r e m o v i n g them from t h e i r s o c k e t s and p l a c i n g them under s t r o n g u l t r a v i o l e t l i g h t f o r a b o u t t h i r t y m i n u t e s . They a r e re-programmed i n t h i s l a b o r a t o r y u s i n g a Pro Log Programmer and a Model 74 I n t e r d a t a c o m p u t e r . M a c h i n e code i s g e n e r a t e d f r o m a c r o s s a s s e m b l e r on t h e u n i v e r s i t y s u p p o r t e d Amdahl computer, and i s t r a n s f e r r e d a c r o s s an HDLC l i n k t o t h e model 74 i n our l a b o r a t o r y . I am much i n d e b t e d t o R.D. R u s s e l l f o r h i s work i n i m p l e m e n t i n g t h e l i n k . W i t h o u t i t my t a s k would have been e x t r e m e l y l a b o r i o u s . The c r o s s a s s e m b l e r was w r i t t e n i n t h e GASS l a n g u a g e f o r t h e Department of E l e c t r i c a l E n g i n e e r i n g . However, i t was d e f i c i e n t i n s e v e r a l r e s p e c t s and I had t o r e w r i t e e x t e n s i v e s e c t i o n s of t h e code t o remove some a n n o y i n g bugs and implement s e v e r a l c o n v e n i e n t enhancements. A s e p a r a t e s u b r o u t i n e was needed t o p r o d u c e a s u i t a b l e o b j e c t f i l e f o r t r a n s f e r t o t h e Model 74 m i n i c o m p u t e r . Sec 3.4 60 3.5 THE SYSTEM I/O PORT As w i t h a l l U n i v e r s i t y K i t b o a r d components a more c o m p r e h e n s i v e d e s c r i p t i o n w i l l be f o u n d i n t h e U s e r s G u i d e ( T e x a s I n s t r u m e n t s , 1979). The s y s t e m I/O p o r t i s b a s e d a r o u n d a programmable s y s t e m s i n t e r f a c e (TMS9901), and i n t e r f a c e s t o t h e CPU t h r o u g h t h e c o m m u n i c a t i o n s r e g i s t e r u n i t (CRU). The s y s t e m I/O p o r t c o n t r o l s t h e f o l l o w i n g s y s t e m p a r t s . 1) The d i s p l a y t i m e r w h i c h g e n e r a t e s a p e r i o d i c i n t e r r u p t e v e r y 1 ms. 2) The a l p h a m e r i c k e y b o a r d c an be u s e d t o i n p u t UNIBUG commands. 3) The t e n d i g i t , s e v e n segment LED d i s p l a y on w h i c h UNIBUG ROM ca n t r a n s l a t e a l l ASCII c h a r a c t e r s t o se v e n segment c o d e s . 4) A p i e z o e l e c t r i c sound d i s c w h i c h f l e x e s whenever a v o l t a g e i s a p p l i e d t o i t . P u l s i n g t h e SPKDRV l i n e of t h e s y s t e m I/O p o r t g e n e r a t e s a t o n e o f t h e p u l s e f r e q u e n c y . The sample l i n e o p e r a t i n g s y s t e m u s e s t h e 1 ms t i m e r t o r e f r e s h r a c k r e g i s t e r s and t o c o n t r o l t h e sound d i s c . UNIBUG u s e s t h e t i m e r t o s e n s e t h e k e y b o a r d and t o d r i v e t h e d i s p l a y . 3.6 THE USER I/O PORT T h i s o p e r a t e s i n an i d e n t i c a l manner t o t h e s y s t e m I/O p o r t , b u t m a i n t a i n s a d i f f e r e n t CRU a d d r e s s . T h e r e a r e two i m p o r t a n t f u n c t i o n s d e d i c a t e d t o t h e u s e r I/O p o r t i n t h e c u r r e n t s y s t e m . 1) I t s i n t e r n a l t i m e r i s s e t t o g e n e r a t e an i n t e r r u p t e v e r y 200 ms. T h i s p e r i o d i c s i g n a l keeps t r a c k of r e a l t i m e . Sec 3.6 61 2) A l l i n t e r r u p t s a r e i n p u t t o t h e s y s t e m t h r o u g h t h e u s e r I/O p o r t ( s e e s e c t i o n s 4.13, 4.14, & 4.15 f o r a d e s c r i p t i o n of i n t e r r u p t o p e r a t i o n s ) . 3.7 THE SERIAL COMMUNICATION PORT T h i s p o r t c o n s i s t s o f an a s y n c h r o n o u s c o m m u n i c a t i o n s c o n t r o l l e r (TMS9902), and v a r i o u s d r i v e r s c a p a b l e o f RS-232-C o r 20mA c u r r e n t l o o p o p e r a t i o n . In t h e p r e s e n t c o n f i g u r a t i o n t h e o n - b o a r d o p t i o n s have been w i r e d t o d r i v e a 20 mA t e l e t y p e c u r r e n t l o o p . 3.8 BUS EXPANSION INTERFACE A l l a d d r e s s , d a t a and c o n t r o l l i n e s a r e a v a i l a b l e a t t h e bus e x p a n s i o n i n t e r f a c e . F o r a c o m p r e h e n s i v e t a b u l a t i o n of p i n o u t s and c h a r a c t e r i s t i c s , r e f e r t o t h e U s e r s G u i d e ( T e x a s I n s t r u m e n t s , 1979). 3.9 THE ANALOGUE-TO-DIGITAL CONVERTER The a n a l o g u e - t o - d i g i t a l c o n v e r t e r i s b a s e d upon t h e INTERSIL ICL8052/ICL1704-12 p a i r ( I n t e r s i 1 , 1 9 8 1 ) and f e a t u r e s a 10 v o l t i n p u t range w i t h 12 b i t s o f a c c u r a c y , p l u s p o l a r i t y and o v e r r a n g e i n d i c a t i o n ( a c t u a l l y e q u i v a l e n t t o a 13 b i t b i n a r y number). An o n - c h i p r e f e r e n c e v o l t a g e and c l o c k s i m p l i f y d e s i g n and c o n s e r v e b o a r d s p a c e . A u t o - z e r o i n g c o m p e n s a t e s f o r any i n t e r n a l a m p l i f i e r o f f s e t d r i f t s . Any one o f s i x t e e n s i n g l e - ended i n p u t s c a n be s e l e c t e d t h r o u g h an INTEL IH6116 Sec 3.9 62 m u l t i p l e x e r . The programmer i n i t i a t e s a c o n v e r s i o n c y c l e by w r i t i n g t h e c h a n n e l number of t h e i n p u t t o be measured t o t h e ADC memory a d d r e s s . When, a f t e r a p p r o x i m a t e l y 20mS, t h e c o n v e r s i o n i s c o m p l e t e , an ADC i n t e r r u p t w i l l be g e n e r a t e d . T h i s c a u s e s t h e m i c r o p r o c e s s o r t o t e m p o r a r i l y abandon i t s c u r r e n t t a s k , and t o b e g i n e x e c u t i o n of an i n t e r r u p t s e r v i c e r o u t i n e . The s e r v i c e r o u t i n e must r e a d t h e c o n v e r s i o n from t h e o u t p u t b u f f e r s o f t h e ADC and s t o r e i t i n some s p e c i f i e d l o c a t i o n . The ADC c i r c u i t has been d e s i g n e d t o r e s e t t h e i n t e r r u p t l i n e and t o r e i n i t i a l i s e t h e c o n v e r t e r d u r i n g t h e r e a d c y c l e , t h u s a l l o w i n g t h e i n t e r r u p t e d t a s k t o be resumed once t h e d a t a a r e s t o r e d . 3.10 THE CMOS EXPANSION BUS A p a r a l l e l bus s t r u c t u r e e n a b l e s t h e m i c r o p r o c e s s o r t o communicate w i t h a m a s t e r c o n t r o l c e n t e r ( f o r t h e vacuum pump, C 0 2 c y c l i n d e r e t c . ) and up t o s i x t e e n r a c k s . However t h e r a c k s w i l l be s p a t i a l l y s e p a r a t e d i n an e l e c t r i c a l l y n o i s y e n v i r o n m e n t . I n d u c e d v o l t a g e s c a n u n p r e d i c t a b l y a p p e a r on t h e t h e bus l i n e s and r e s u l t i n u n f o r e s e e n p r o c e s s i n g e r r o r s . In su c h a s i t u a t i o n CMOS l o g i c , o p e r a t i n g on a 12 v o l t s u p p l y has a t l e a s t f i v e t i m e s t h e n o i s e immunity o f e q u i v a l e n t TTL c i r c u i t r y so i t s c h o i c e i s o b v i o u s . The i n h e r e n t s l o w n e s s of th e CMOS d e v i c e s i s n o t a d i s a d v a n t a g e i n t h e c u r r e n t a p p l i c a t i o n . The bus i s a c c e s s e d v e r y i n f r e q u e n t l y , and a s i m p l e h a n d s h a k i n g scheme c o m p e n s a t e s f o r any bus d e l a y s . Sec 3.10 63 3.10.1 Bus I n t e r r u p t s A s i m p l e i n t e r r u p t s t r a t e g y has been u s e d f o r t h e CMOS bus. When any d e v i c e a t t a c h e d t o t h e bus r e q u e s t s p r o c e s s o r s e r v i c e i t l o w e r s t h e CMOS bus i n t e r r u p t r e q u e s t l i n e . The u s e r must p r o v i d e s o f t w a r e t o i d e n t i f y t h e s o u r c e of t h e r e q u e s t , r e s e t t h e i n t e r r u p t f l a g , and e x e c u t e an a p p r o p r i a t e s e r v i c e r o u t i n e . G i v e n t h e extreme i m p r o b a b i l i t y o f s i m u l t a n e o u s i n t e r r u p t s p r i o r i t y e n c o d i n g schemes a r e c o m p l e t e l y u n w a r r a n t e d . Most i n t e r r u p t s w i l l be g e n e r a t e d from m i c r o s w i t c h e s mounted i n t h e r a c k s . As w i t h most m e c h a n i c a l s w i t c h e s t h e s e bounce when c h a n g i n g p o s i t i o n and t a k e a l o n g t i m e t o s e t t l e . I t i s p o s s i b l e f o r t h e m i c r o p r o c e s s o r t o p o l l t h e s w i t c h p o s i t i o n between b o u n c e s , and t o m i s s t h e i n t e r r u p t i n g r a c k . Some form of s w i t c h d e b o u n c i n g must be i n c o r p o r a t e d t o p r e v e n t t h i s p o s s i b i l i t y . T h e r e a r e v a r i o u s s o f t w a r e s o l u t i o n s t o t h e p r o b l e m b u t t h e s e t e n d t o o c c u p y t h e p r o c e s s o r w h i l s t w a i t i n g f o r t h e bounce t o s u b s i d e . I n s t e a d I have u s e d a c i r c u i t i n c o r p o r a t i n g a r e t r i g g e r a b l e m o n o s t a b l e . I t p r e v e n t s bus i n t e r r u p t s from r e a c h i n g t h e m i c r o p r o c e s s o r u n l e s s t h e s w i t c h has been s t e a d y f o r 10 ms. As t h e bounce p e r i o d i s n e a r e r 1 ms, th e i n t e r r u p t r e q u e s t w i l l be d e l a y e d u n t i l 10 ms a f t e r t h e s w i t c h s e t t l e s . 3.11 THE SAMPLE RACK HARDWARE 3.11.1 Rack Hardware O r g a n i s a t i o n The r a c k hardware i s o r g a n i s e d i n t o f u n c t i o n a l modules o p e r a t i n g i n p a r a l l e l f r o m t h e CMOS b u s . P h y s i c a l l y t h e modules Sec 3.11.1 64 a r e w i r e d on p r i n t e d c i r c u i t c a r d s t h a t p l u g i n t o edge cmos expansion bus *L ,̂ ^ • i • » to other racks. 81 V 2V F i g u r e 3.2 4<- 4<- control address (6,7,8,9) re status register reg 1 ? control register rackO? rack select logic rack control board reg 2 ? reservoir solenoid register reg 3 ?| sample solenoid register >» •O i o to expansion slots on rack chassis Rack R e g i s t e r & Hardware O r g a n i s a t i o n c o n n e c t o r s on a c i r c u l a r c h a s s i s . The CMOS bus i s b r o u g h t i n t o t h e r a c k on r i b b o n c a b l e and i s w i r e d a c r o s s t h e back of e a c h edge c o n n e c t o r . The c i r c u l a r c h a s s i s mounts i n t h e c e n t e r of Sec 3.11.1 65 t h e r a c k on f i v e p u s h - f i t c o n n e c t o r s . These p r o v i d e t h e n e c e s s a r y e l e c t r i c a l c o n n e c t i o n s t o t h e s o l e n o i d s , t h e p h y s i c a l c h a s s i s m o u n t i n g , and a l l o w t h e c h a s s i s t o be e a s i l y removed f o r r e p a i r and m o d i f i c a t i o n . Of t h e s i x c a r d p o s i t i o n s , t h r e e a r e c u r r e n t l y u s e d , so t h e r e i s ample room f o r e x p a n s i o n . The bus o r g a n i s a t i o n i s shown i n f i g u r e 3.2. Rack r e g i s t e r s a r e s e l e c t e d w i t h t h e a i d o f f o u r s i g n a l s p r o d u c e d by t h e r a c k s e l e c t l o g i c on t h e r a c k c o n t r o l b o a r d ( f i g u r e 3 . 2 ) . The s i g n a l s become a c t i v e o n l y when t h e r a c k f i e l d of t h e a d d r e s s bus ( f i g u r e 3.3) e q u a l s t h e r a c k number as s e t by s w i t c h e s mounted on t h e r a c k c o n t r o l b o a r d . The f o u r l o g i c l i n e s d e t e r m i n e t h e n a t u r e of t h e c y c l e ( r e a d or w r i t e ) and t h e b y t e t o be a c c e s s e d ( h i g h o r l o w ) . The r a c k s e l e c t l o g i c a l s o h a n d l e s t h e g e n e r a t i o n of i n t e r r u p t s and t h e bus r e a d h a n d s h a k i n g p r o t o c o l . The o t h e r two b o a r d s d r i v e t h e sample and r e s e r v o i r s o l e n o i d s , and a r e e l e c t r i c a l l y i d e n t i c a l . T h e i r a d d r e s s i s s e t u s i n g board-mounted s w i t c h e s . T h i s f l e x i b i l i t y i s handy f o r s e t u p and s e r v i c i n g b u t c a r e must be t a k e n n o t t o d u p l i c a t e r e g i s t e r a d d r e s s e s . 3.11.2 Rack R e g i s t e r A d d r e s s i n g The memory a d d r e s s word o f t h e sample l i n e s y s t e m has been d i v i d e d i n t o f i e l d s t o f a c i l i t a t e s o f t w a r e r e a d a b i l i t y and hardware d e c o d i n g . F o r t h e r a c k s , an a d d r e s s has f o u r f i e l d s . The f i r s t s p e c i f i e s t h e memory b l o c k i n w h i c h t h e r a c k s a r e l o c a t e d , t h e s e c o n d s p e c i f i e s t h e page w i t h i n t h a t b l o c k , t h e t h i r d i s t h e r a c k number, and t h e f o u r t h i s t h e r e g i s t e r number (se e f i g u r e 3 . 3 ) . Sec 3.11.2 66 A page o f 256 b y t e s i s c a p a b l e of s u p p o r t i n g s i x t e e n r a c k s , 0 1 2 3 4 5 6 7 8 9 10 11 12 13 1 0 0 0 0 0 R R R R r r r block page rack register 0-F 0-7 F i g u r e 3 . 3 Rack R e g i s t e r A d d r e s s i n g w i t h e i g h t r e g i s t e r s f o r e a c h r a c k . At t h e c u r r e n t l e v e l o n l y f o u r o f t h e s e a r e a s s i g n e d , t h e r e s t b e i n g r e s e r v e d f o r f u t u r e h a r d w a r e e x p a n s i o n s ( f i g u r e 3 . 2 ) . I t s h o u l d be n o t e d t h a t t h e h a r d w a r e d o e s n o t s u p p o r t b o t h r e a d and w r i t e from t h e same r e g i s t e r . I t was f e l t t h a t more a d v a n t a g e s would be g a i n e d by h a v i n g an image of t h e r a c k r e g i s t e r i n RAM, from w h i c h t h e r a c k r e g i s t e r i s c o n t i n u a l l y r e f r e s h e d ( s e e s e c t i o n 4 . 1 7 . 3 ) . T h i s a l l o w s t h e r a c k s t a t e t o be r e s t o r e d even i f i t s h o u l d b e c r e m o v e d t o t a l l y from t h e bus and power s u p p l y . I t a l s o s a v e s on h a r d w a r e , and mates w e l l w i t h t h e sample l i n e o p e r a t i n g s y s t e m . 3 . 1 1 . 3 The Rack S t a t u s R e g i s t e r When r e a d , t h e r a c k s t a t u s r e g i s t e r p r o v i d e s i n f o r m a t i o n a b o u t t h e s t a t u s of t h e a d d r e s s e d r a c k . The f l a g s o f t h e s t a t u s word a r e shown i n f i g u r e 3 . 4 . The f o u r l e a s t s i g n i f i c a n t b i t s m o n i t o r m i c r o - s w i t c h e s s e n s i n g t h e p o s i t i o n o f t h e f o u r d o o r s t h a t e n c l o s e t h e s a m p l e s . The f i f t h i s t r u e when t h e Sec 3 . 1 1 . 3 67 s o l e n o i d power s u p p l y (+24 v o l t ) i s p r e s e n t and f a l s e o t h e r w i s e . LO BYTE 8 10 11 12 13 14 15 24vcng I 24v.on smpcng dorcng door.a d o o r . b d o o r . c door.d F i g u r e 3.4 The Rack S t a t u s R e g i s t e r T h i s a l l o w s t h e p r o c e s s o r t o s e n s e whether a r a c k i s a c t i v e o r p r e s e n t on t h e s y s t e m . I f any o f t h e t h r e e most s i g n i f i c a n t b i t s ( B i t s 8,9,10) a r e s e t , t h e n a bus i n t e r r u p t w i l l be g e n e r a t e d . T h e s e f l a g t h e o r i g i n of t h e bus i n t e r r u p t t o t h e s e r v i c e r o u t i n e e x e c u t e d by t h e c e n t r a l p r o c e s s o r , and a r e a u t o m a t i c a l l y r e s e t a f t e r t h e s t a t u s r e g i s t e r h as been r e a d . Note however, t h a t t h e s e b i t s a r e s e t whenever t h e r e i s a change i n s t a t e s i n c e t h e p r e v i o u s r e s e t . F o r example, i f a d o o r was open t h e DORCNG l i n e w i l l be s e t when t h e d o o r i s c l o s e d . R e a d i n g t h e s t a t u s word r e s e t s t h i s l i n e , but i t w i l l be s e t a g a i n when a d o o r i s opened. The SMPCNG i s i n a c t i v e i n t h e c u r r e n t s y s t e m , and i s p r o v i d e d i n c a s e f u t u r e s y s t e m e x p a n s i o n i n c o r p o r a t e s sample s w i t c h e s and i n t e r f a c e l o g i c on a n o t h e r b o a r d . O p e r a t i n g i n a Sec 3.11.3 68 s i m i l a r manner t o t h e d o o r s i t s h o u l d be s e t whenever a sample t u b e i s i n s e r t e d o r removed from a h o l d e r . 3.11.4 The Rack C o n t r o l R e g i s t e r HI BYTE < 0 < 1 « 2 i < 3 > < 4 > < 5 > < 6 i < 7 > lec .0 lec ti lec J.2 led .4 lec 1.5 lec 1.6 led.3 led.7 LO BYTE 8 9 10 11 12 13 i 14 • < 15 i v.msl v.mnl F i g u r e 3.5 The Rack C o n t r o l R e g i s t e r S e t t i n g a p p r o p r i a t e b i t s i n t h e r a c k c o n t r o l r e g i s t e r o p e r a t e s t h e s o l e n o i d , and l i g h t s t h e f r o n t p a n e l l i g h t e m i t t i n g d i o d e shown i n f i g u r e 3.5. U n a s s i g n e d b i t s a r e s l a t e d f o r f u t u r e r a c k f u n c t i o n s t h a t g i v e more c o n t r o l o v e r t h e f a n s and t h e s t i r r e r s . T e m p e r a t u r e c o n t r o l l e r s a r e a n o t h e r p o s s i b i l i t y . 3.11.5 The S o l e n o i d D r i v e r R e g i s t e r s S e t t i n g a b i t i n a s o l e n o i d d r i v e r r e g i s t e r o p e r a t e s t h e c o r r e s p o n d i n g s o l e n o i d , and opens a v a l v e . The number of t h e Sec 3.11.5 69 s o l e n o i d s p e c i f i e d by manual o p e r a t i o n s c o r r e s p o n d s t o t h e numbering on t h e r a c k , but i s r e v e r s e d f r o m t h e b i t numbering s y s t e m ( b i t #0 i s s o l e n o i d #15 and v i c e v e r s a ) . T h i s made s o f t w a r e f o r manual o p e r a t i o n s much s i m p l e r t o d e s i g n , and i s t r a n s p a r e n t t o t h e o p e r a t o r u s i n g manual c o n t r o l f r o m t h e sample l i n e o p e r a t i n g s y s t e m . 3.12 THE MASTER CONTROL BOARD 3.12.1 M a s t e r C o n t r o l F u n c t i o n s The s y s t e m ' s m a s t e r c o n t r o l b o a r d o p e r a t e s and s e n s e s a l l e quipment t h a t i s s h a r e d amongst t h e r a c k s . P r e v i o u s l y t h e s h a r e d f a c i l i t i e s have been d i v i d e d i n t o two f u n c t i o n a l a r e a s : t h e mass s p e c t r o m e t e r l i n e , and t h e m a i n l i n e . F u n c t i o n s a s s o c i a t e d w i t h t h e m a i n l i n e a l l r e q u i r e t h e o p e r a t i o n of s o l e n o i d s t o p r o v i d e a p a r t i c u l a r s h a r e d s e r v i c e . The s o l e n o i d s c o n n e c t t h e main l i n e t o t h e vacuum pump (V.VAC), t h e C 0 2 c y l i n d e r (V.C02), t h e slow pump r a t e l i n e ( V . L E K ) , and t h e p r e s s u r e gauge r e f e r e n c e chamber ( V . R E F ) . The o n l y d e v i c e p h y s i c a l l y p r e s e n t on t h e mass s p e c t r o m e t e r l i n e i s t h e P e l t i e r c o o l e r , and a c o n t r o l l i n e (C.PEL) i s p r o v i d e d t o power t h i s on and o f f . However c o m m u n i c a t i o n w i t h t h e mass s p e c t r o m e t e r ' s i n l e t l i n e c o n t r o l l e r s h o u l d be l o g i c a l l y i n c l u d e d . T h i s i s e f f e c t e d by c o u p l i n g f o u r TTL l e v e l s i g n a l s f r o m t h e i n l e t l i n e c o n t r o l l e r t o t h e CMOS m a s t e r c o n t r o l b o a r d v i a o p t i c a l i s o l a t o r s ( H e w l e t t P a c k a r d Type 6N136). T h r e e o f t h e l i n e s p r o v i d e i n f o r m a t i o n a b o u t t h e s t a t e o f Sec 3.12.1 70 t h e sample l i n e t o t h e i n l e t l i n e c o n t r o l l e r . The f i r s t f l a g s LO B Y T E 8 9 10 11 12 13 14 i 15 i HI BYTE control LO BYTE i n t e r r u p t f l a g , c . r e q 0 1 2 3 4 5 > < 6 ( 7 C.I *dy c . n o m c . a l n 8 9 10 11 > < 12 13 • i 14 > 15 >el v . l v . r 3k e f v . c .02 v . v a c F i g u r e 3.6 The M a s t e r C o n t r o l and S t a t u s R e g i s t e r s t h e a v a i l a b i l i t y of t h e sample l i n e ( C . A L N - a u t o l i n e ) , t h e s e c o n d i n d i c a t e s no more samples t o a n a l y s e (C.NOM), and t h e t h i r d i s Sec 3.12.1 71 s e t t o i n d i c a t e t h a t a sample i s p r e s e n t i n t h e mass s p e c t r o m e t e r l i n e and r e a d y f o r a n a l y s i s (C.RDY). The f o u r t h l i n e i s a f l a g f r o m t h e i n l e t l i n e r e q u e s t i n g a sample (C.REQ). The i n l e t c o n t r o l l e r w i l l s e t t h i s l i n e when i t needs a new sample, and w i l l r e s e t i t when t o l d a sample i s r e a d y (C.RDY i s s e t ) . The m a s t e r b o a r d g e n e r a t e s a CMOS bus i n t e r r u p t when t h e sample r e q u e s t l i n e i s r a i s e d , and w i l l be r e s e t when t h e ma s t e r s t a t u s r e g i s t e r i s r e a d . Two r e g i s t e r s a r e more t h a n a d e q u a t e f o r a l l t h e common s y s t e m f u n c t i o n s . The b i t d e s i g n a t i o n s f o r t h e s e , t h e m a s t e r s t a t u s , and m a s t e r c o n t r o l r e g i s t e r , a r e shown i n f i g u r e 3.6. On b o a r d l i g h t e m i t t i n g d i o d e s g i v e a v i s u a l i n d i c a t i o n of t h e s t a t e of a l l m a s t e r b o a r d l i n e s . Sec 3.12.1 CHAPTER IV. THE OPERATING SYSTEM 72 4.1 SYSTEM OVERVIEW The s y s t e m s o f t w a r e must be d e s i g n e d t o e x e c u t e a v a r i a b l e number o f a s y n c h r o n o u s t a s k s . B e c a u s e i t i s p o s s i b l e t o r e p r e s e n t a number o f d i f f e r e n t t a s k s by t h e same p r o c e d u r e ( program) u s i n g d i f f e r e n t d a t a , a t a s k i n becomes synonymous w i t h a (program, d a t a ) p a i r . The t a s k s a r e c o n s i d e r e d a s y n c h o n o u s as t h e r e i s u s u a l l y no way of p r e d i c t i n g when t h e s y s t e m w i l l be a s k e d t o e x e c u t e them. The f o l l o w i n g l i s t s s e v e r a l examples of t a s k s . 1. P r o c e s s t h e samples on r a c k ( i ) where i = 0 , 1 , 2 , 3 . . o r 15. 2. M a n u a l l y c o n t r o l r a c k ( i ) where i = 0 , 1 , 2 , 3 . . o r 15. 3. P e r i o d i c p r e s s u r e t e s t i n g . 4. A c c e p t , decode and e x e c u t e u s e r s y s t e m commands. 5. U p d a t e c l o c k s . E x e c u t i o n o b v i o u s l y s h o u l d p r o c e e d as r a p i d l y and as e c o n o m i c a l l y a s p o s s i b l e b u t i t must be remembered t h a t t a s k s a r e l i k e l y t o be c o m p e t i n g f o r t h e f o l l o w i n g r e s o u r c e s : 1. The c e n t r a l p r o c e s s i n g u n i t (CPU). 2. Random a c c e s s memory (RAM). 3. V a r i o u s e x t e r n a l d e v i c e s , i n c l u d i n g : a) The t e l e t y p e and i t s a s s o c i a t e d r o u t i n e s . b) The main vacuum l i n e , t h e vacuum pump, p r e s s u r e gauges and C 0 2 c y l i n d e r . c ) The i n l e t l i n e , and t h e p e l t i e r c o o l e r . Sec 4.1 73 d) The a n a l o g u e - t o - d i g i t a l c o n v e r t e r . I t becomes n e c e s s a r y t o d e s i g n an o p e r a t i n g s y s t e m t o o v e r s e e t h e a l l o c a t i o n o f t h e s e and o t h e r r e s o u r c e s , a n d t o d e v e l o p a g e n e r a l s t r u c t u r e upon w h i c h t h e o p e r a t i n g s y s t e m c a n e f f e c t i v e l y w o r k . 4.2 TMS9980 SOFTWARE TECHNIQUES To u n d e r s t a n d t h e s a m p l e l i n e o p e r a t i n g s y s t e m i t i s n e c e s s a r y t o have some k n o w l e d g e o f t h e methods u s e d by t h e m i c r o p r o c e s s o r t o e x e c u t e i t s i n s t r u c t i o n s . The TMS9980 m i c r o p r o c e s s o r i s w e l l s u i t e d t o t a s k - o r i e n t e d , l i s t - s t r u c t u r e d a p p r o a c h e s , m a i n l y due t o i t s w o r k s p a c e / c o n t e x t s w i t c h c o n c e p t . To e x p l a i n t h e s e i d e a s some b a s i c t e r m i n o l o g y must be i n t r o d u c e d . 4.2.1 W o r k s p a c e P o i n t e r (WP) H i s t o r i c a l l y t h e f i r s t c o m p u t e r s p e r f o r m e d a l l a r i t h m e t i c and l o g i c a l o p e r a t i o n s i n an i n t e r n a l r e g i s t e r known as an a c c u m u l a t o r . B e c a u s e most o f t h e p r o g r a m m i n g e f f o r t u s u a l l y went i n t o f e t c h i n g a n d s t o r i n g a c c u m u l a t o r r e s u l t s , m u l t i p l e a c c u m u l a t o r s were d e v e l o p e d . As p r o g r a m m i n g c o n c e p t s d e v e l o p e d i t became n e c e s s a r y t o b r e a k t a s k s i n t o m o d u l e s o r s u b r o u t i n e s , and t o e n a b l e t h e p r o c e s s o r t o jump between them. T h i s c o n t e x t s w i t c h u s u a l l y meant t h a t a l l t h e m u l t i p l e r e g i s t e r s h a d t o be s a v e d i n a known p l a c e , t h e n r e p l a c e d w i t h new v a l u e s f o r t h e new c o n t e x t . D e s p i t e t h e p r e s e n c e o f s p e c i a l i n s t r u c t i o n s ( e . g . STM i n INTERDATA c o m p u t e r s ) t o l e s s e n p r o g r a m m i n g e f f o r t , a l a r g e amount o f p r o c e s s o r t i m e and b o o k k e e p i n g was s t i l l s p e n t Sec 4.2.1 74 k e e p i n g t r a c k of t h e r e g i s t e r s and p e r f o r m i n g t h e s w i t c h . T e x a s I n s t r u m e n t s has a v o i d e d t h i s p r o b l e m by r e t a i n i n g one i n t e r n a l r e g i s t e r c a l l e d a workspace p o i n t e r t h a t i s l o a d e d w i t h t h e a d d r e s s o f a b l o c k of s i x t e e n c o n t i g u o u s words i n RAM. The b l o c k t h e n behaves as i f i t were 16 g e n e r a l p u r p o s e r e g i s t e r s , but t h e r e a l a d v a n t a g e i s t h a t c h a n g i n g r e g i s t e r s e t s c an be e f f e c t e d s i m p l y by c h a n g i n g t h e workspace p o i n t e r . 4.2.2 The Program C o u n t e r (PC) Any p r o c e s s i n g u n i t works by r e p e a t i n g t h e f o l l o w i n g b a s i c a l g o r i t h m . 1. F e t c h t h e i n s t r u c t i o n a t t h e a d d r e s s i n t h e p r o g r a m c o u n t e r . 2. I n c r e m e n t t h e program c o u n t e r t o g i v e t h e a d d r e s s of t h e n e x t i n s t r u c t i o n . 3. E x e c u t e t h e f e t c h e d i n s t r u c t i o n . The p r o g r a m c o u n t e r i s an i n t e r n a l r e g i s t e r t h a t c o n t a i n s t h e a d d r e s s of t h e n e x t i n s t r u c t i o n t o be e x e c u t e d . 4.2.3 The S t a t u s R e g i s t e r (ST) The s t a t u s r e g i s t e r i s a n o t h e r i n t e r n a l r e g i s t e r w h i c h c o n t a i n s s t a t u s or f l a g b i t s s e t as a r e s u l t of a r i t h m e t i c and l o g i c a l o p e r a t i o n s . These b i t s c an be t e s t e d by c o n d i t i o n a l jump and b r a n c h i n s t r u c t i o n s so t h e v a l u e o f t h e s t a t u s r e g i s t e r d e t e r m i n e s t h e f u t u r e c o u r s e o f program f l o w . The s t a t u s r e g i s t e r a l s o c o n t a i n s f o u r b i t s t h a t c o m p r i s e t h e i n t e r r u p t mask. The i n t e r r u p t mask d e t e r m i n e s w h i c h e x t e r n a l i n t e r r u p t l i n e s w i l l be a l l o w e d t o pre-empt an e x e c u t i n g t a s k . Sec 4.2.3 75 4.2.4 The Program S t a t e V e c t o r (PSV) The p r o g r a m s t a t e v e c t o r i s s i m p l y a l l t h e i n f o r m a t i o n t h a t d e s c r i b e s t h e c u r r e n t s t a t e o f an e x e c u t i n g p r o g r a m . I f a p r o g r a m i s i n t e r r u p t e d t h e n r e s t o r i n g t h e PSV w i l l a l l o w e x e c u t i o n t o p r o c e e d from where i t l e f t o f f . O b v i o u s l y f o r t h e TMS9980 t h e PSV c o n s i s t s o f : a) The w o r k space p o i n t e r so t h e g e n e r a l p u r p o s e r e g i s t e r s may be f o u n d . b) The p r o g ram c o u n t e r so t h e n e x t i n s t r u c i o n may be f o u n d . c) The s t a t u s r e g i s t e r so t h a t f u t u r e c o n d i t i o n a l jumps and i n t e r r u p t s have t h e c o r r e c t i n f o r m a t i o n . 4.2.5 C o n t e x t S w i t c h i n g I w i l l c o n s i d e r a c o n t e x t s w i t c h as a r e - a l l o c a t i o n o f t h e p r o c e s s o r t o a n o t h e r t a s k (a p r o g r a m / w o r k s p a c e p a i r ) . I t i s assumed t h a t t h e o r i g i n a l t a s k w i l l resume e x e c u t i o n a t some l a t e r t i m e , so t h e p r o g ram s t a t e v e c t o r must be s a v e d and l a t e r r e s t o r e d . T h e r e a r e two b a s i c k i n d s of c o n t e x t s w i t c h e s : a) The CPU i s v o l u n t a r i l y r e l i n q u i s h e d by t h e c u r r e n t t a s k . The two i n s t r u c t i o n s t h a t c a u s e a v o l u n t a r y c o n t e x t s w i t c h a r e : i ) The BLWP i n s t r u c t i o n ( B r a n c h and Load Workspace P o i n t e r ) . i i ) The XOP i n s t r u c t i o n ( e x t e r n a l o p e r a t i o n ) . b) The CPU i s p r e - e m p t e d by an e x t e r n a l i n t e r r u p t . T h i s can be e x p l a i n e d by p o i n t i n g out t h a t t h e b a s i c p r o c e s s i n g a l g o r i t h m shown i n s e c t i o n 1.2.2 i s somewhat more c o m p l i c a t e d i n p r a c t i c e . F o r t h e TM9980 t h r e e e x t e r n a l l i n e s a r e r e a d a f t e r e a c h i n s t r u c t i o n i s e x e c u t e d . I f t h e i r b i n a r y v a l u e Sec 4.2.5 76 e x c e e d s t h a t of t h e i n t e r r u p t mask ( s e e s e c t i o n 4.2.3), t h e n t h e CPU w i l l be f o r c e d t o e x e c u t e i n a new c o n t e x t . The c o n t e x t i s s e l e c t e d by u s i n g t h e b i n a r y v a l u e of t h e t h r e e e x t e r n a l i n t e r r u p t l i n e s a s an i n d e x t o l o a d a new wo r k s p a c e p o i n t e r and pr o g r a m c o u n t e r from a d e d i c a t e d t a b l e i n low memory. The main d i f f e r e n c e between a r e l i n q u i s h e d and a pre - e m p t e d t a s k i s t h a t t h e program s t a t e i s known when r e l i n q u i s h i n g so o n l y a p a r t i a 1 PSV need be s a v e d t o resume e x e c u t i o n . P r e - e m p t i o n s on t h e o t h e r hand a r e d e t e r m i n e d by e x t e r n a l s i g n a l s s o t h e s t a t e of t h e machine c an r a r e l y be p r e d i c t e d , and t h e c o m p l e t e PSV must be s a v e d . However t h e a r c h i t e c t u r e of t h e TMS9980 r e q u i r e s s u c h a s m a l l PSV (WP, PC and ST) t h a t t h e r e i s l i t t l e r e a l p o i n t i n d i s t i n g u i s h i n g between t h e two t y p e s . A l l c o n t e x t s w i t c h e s use t h e same b a s i c mechanism ( F i g u r e 4 . 1 ) . The PSV i s s a v e d when t h e workspace p o i n t e r , p rogram c o u n t e r and s t a t u s r e g i s t e r a r e c o p i e d i n t o r e g i s t e r s 13, 14, and 15 o f t h e new w o r k s p a c e . The s w i t c h i s c o m p l e t e d when t h e wo r k s p a c e p o i n t e r and t h e pr o g r a m c o u n t e r a r e l o a d e d w i t h t h e i r new v a l u e s f r o m t h e v e c t o r s p e c i f i n g them. A l l c o n t e x t s w i t c h e s use t h i s v e c t o r t o d e f i n e t h e new wo r k s p a c e p o i n t e r and p r o g r a m c o u n t e r . The v e c t o r i s j u s t two c o n s e c u t i v e memory words s p e c i f y i n g t h e new v a l u e s o f t h e workspace p o i n t e r and t h e program c o u n t e r . F o r t h e BLWP i n s t r u c t i o n t h e s e may s t a r t a t any a d d r e s s , b u t t h e XOP's and i n t e r r u p t s e r v i c e r o u t i n e s r e q u i r e them i n f i x e d , and r e s e r v e d , l o c a t i o n s . R e t u r n i n g f r o m a c o n t e x t s w i t c h i s s i m p l y a c h i e v e d u s i n g t h e RTWP ( r e t u r n w o r k s p a c e p o i n t e r ) i n s t r u c t i o n . I t moves Sec 4.2.5 77 r e g i s t e r s 13, 14 and 15 f r o m t h e c u r r e n t w o r k s p a c e i n t o t h e CPU registers WP PC ST memory old workspace WP & PC loaded ~ with new values 2. from the vector NEW. NEW old program BLWP ©NEW next instruction new WP — new PC - new workspace 7T3~" rH r15 new program old context context vector new context F i g u r e 4.1 C o n t e x t S w i t c h u s i n g BLWP I n s t r u c t i o n w o r k s p a c e p o i n t e r , p r o g r a m c o u n t e r and s t a t u s r e g i s t e r r e s p e c t i v e l y . 4.3 THE TASK CONTROL BLOCK (TCB) I f t h e e x e c u t i o n o f t a s k s i n t h e s y s t e m i s t o be under c o n t r o l of t h e o p e r a t i n g s y s t e m , t h e n i n f o r m a t i o n t o e f f e c t t h i s c o n t r o l must be m a i n t a i n e d somewhere i n RAM. B e c a u s e t a s k Sec 4.3 78 w o r k s p a c e s r e q u i r e b l o c k s of 16 c o n t i g u o u s words i t i s c o n v e n i e n t t o a s s i g n a s i m i l i a r s i z e d b l o c k f o r t a s k c o n t r o l . TYPE tcb= RECORD p f r e : @ t c b ; p x e c : @tcb; ptmr: @tcb; psem:@tcb; p t s k : @ t c b ; p e r r : @ t c b ; wsp:@workspace; rsc:PACKED ARRAY [0..15] OF b o o l e a n ; a b t : b o o l e a n ; n m e : i n t e g e r ; a i m : i n t e g e r ; p r y : i n t e g e r ; wp:dworkspace; p c : @ i n s t r u c t i o n ; s t : r e g i s t e r ; END; N o t e s : 1. The symbol @ d e s i g n a t e s t h e P a s c a l p o i n t e r t y p e and can be r e a d a s " p o i n t s t o " . 2. The t y p e s w o r k s p a c e , i n s t r u c t i o n , and r e g i s t e r a r e not s t a n d a r d P a s c a l t y p e s . However t h e y do g i v e a t r u e i n d i c a t i o n o f t h e t y p e of i n f o r m a t i o n , and c o u l d be d e f i n e d . Program 4.1 P a s c a l s t r u c t u r e o f a t a s k c o n t r o l b l o c k The t a s k c o n t r o l b l o c k c a n be r e p r e s e n t e d by t h e P a s c a l s t r u c t u r e i n program 4.1 and c o n t a i n s t h e f o l l o w i n g i n f o r m a t i o n : 1. L i s t p o i n t e r s w h i c h e n a b l e TCBs t o be l i n k e d t o g e t h e r . 2. The a d d r e s s of t h e t a s k ' s w o r k s p a c e . 3. R e s o u r c e f l a g s w h i c h show t h e r e s o u r c e s c u r r e n t l y r e s e r v e d by t h e t a s k . 4. A f l a g w h i c h an e x e c u t i n g t a s k may r e f e r e n c e t o d e c i d e i f a d e f e r r e d a b o r t has been s e t . 5. The name ( o r r a t h e r t h e number) a s s i g n e d t o t h e t a s k . Sec 4.3 79 The name i d e n t i f i e s t h e t a s k u n i q u e l y i n t h e s y s t e m . 6. The t i m e t h a t t h e t a s k has t o remain i n an i n a c t i v a t e d s t a t e . T h i s v a l u e i s s e t whenever t h e t a s k i s p l a c e d on t h e t i m e r queue ( s e e s e c t i o n 4.10). I t i s d e c r e m e n t e d e a c h s e c o n d , u n t i l z e r o . The w a i t i n g t a s k i s t h e n r e a c t i v a t e d . 7. The p r i o r i t y c u r r e n t l y a s s i g n e d t o t h e t a s k . T h i s i s a s i g n e d i n t e g e r number. 8. The pr o g r a m s t a t e v e c t o r (PSV) i s s t o r e d i n t h r e e c o n t i g u o u s l o c a t i o n s i n t h e TCB (WP, PC and S T ) . T h e r e i s a t p r e s e n t o n l y one s p a r e word i n t h e TCB but more j u d i c i o u s use of t h e l i s t p o i n t e r s c o u l d f r e e up a n o t h e r t h r e e . The t a s k c o n t r o l b l o c k c an be t h o u g h t of as t h e b a s i c b u i l d i n g b l o c k of t h e c o n t r o l s y s t e m s t r u c t u r e . 4.4 LINKED L I S T S The most c o n v e n i e n t and f l e x i b l e way of j o i n i n g TCBs t o g e t h e r t o b u i l d t h e s y s t e m s t r u c t u r e i s t o use l i n k e d l i s t s . B e c a u s e of t h e c o n f u s i o n between a l i n k e d l i s t and t h e f a r more common s t a c k s t r u c t u r e s a b r i e f d e s c r i p t i o n of l i n k e d l i s t p r o c e s s e s i s p r e s e n t e d h e r e . 4.4.1 The H e a d p o i n t e r A l s o c a l l e d t h e l i s t base t h e h e a d p o i n t e r h o l d s t h e a d d r e s s of t h e f i r s t TCB on a l i s t . U s u a l l y a h e a d p o i n t e r i s d e f i n e d f o r e a ch l i s t i n t h e s y s t e m and an empty l i s t i s f l a g g e d by a z e r o v a l u e . Sec 4.4.1 80 4.4.2 The F o r w a r d P o i n t e r The f o r w a r d p o i n t e r i s w i t h i n t h e TCB a t a known p o s i t i o n . I t h o l d s t h e a d d r e s s o f t h e n e x t TCB on t h e l i s t . I f t h e a d d r e s s i s z e r o t h e n i t i s t h e l a s t TCB on t h e l i s t . A s i m p l e f o r w a r d l i n k e d l i s t i s shown i n f i g u r e 4.2. headpointer TCB1 TCB 2 A(tcb1) A(tcb2) «-^_ 0 forward / link / pointer ' I • I task control blocks F i g u r e 4.2 A S i m p l e L i s t S t r u c t u r e 4.4.3 A d v a n t a g e s of L i s t S t r u c t u r e s L i s t s t r u c t u r e s a l l o w a f a r g r e a t e r f l e x i b i l i t y and s i m p l i c i t y t h a n t h e s t a c k s t r u c t u r e s commonly employed. O p e r a t i n g s y s t e m s g e n e r a l l y b e n e f i t from t h e i r i n t r o d u c t i o n f o r many r e a s o n s . 1. T h e r e i s no w h o l e s a l e movement of memory c o n t e n t s . L i s t s t r u c t u r e s a r e c h a n g e d by r e p l a c i n g t h e l i n k p o i n t e r s . 2. I n s e r t i o n s and d e l e t i o n s a r e s i m p l y p e r f o r m e d i n a l i n k e d l i s t by c h a n g i n g t h e v a l u e s of t h e f o r w a r d p o i n t e r s i n t h e a p p r o p r i a t e TCBs. S t a c k o p e r a t i o n s w o u l d r e q u i r e w h o l e s a l e movement of t h e s t a c k c o n t e n t s t o make room f o r new i n s e r t i o n s , o r t o c l o s e t h e gap l e f t by a d e l e t i o n . 3. S e a r c h i n g a l i s t f o r a TCB w i t h a g i v e n keyword i s Sec 4.4.3 81 r e l a t i v e l y s i m p l e . 4. By u s i n g m u l t i p l e f o r w a r d p o i n t e r s i t i s e a s y t o p l a c e one TCB on s e v e r a l l i s t s a t o n c e . T h i s i s i m p o s s i b l e on a s t a c k w i t h o u t making m u l t i p l e c o p i e s . 5. F i n a l l y a l i s t i s an i n h e r e n t l y p o w e r f u l s t r u c t u r e , c a p a b l e o f g r e a t v a r i e t y and f o r m . I n c o r p o r a t i n g head p o i n t e r s i n t o t h e TCB a l l o w s t h e c o n s t r u c t i o n o f s u b - l i s t s , b r a n c h e s , t r e e s , and even p o t e n t i a l l y d a n g e r o u s l o o p s . L i s t p r o c e s s i n g l a n g u a g e s , s u c h as L I S P , a r e t h e " w o r k h o r s e s " of t h e a r t i f i c i a l i n t e l l i g e n c e community. 4.4.4 L i s t O p e r a t i o n s T h e r e i s a b a s i c s e t o f l i s t o p e r a t i o n s t h a t a r e f r e q u e n t l y n e c e s s a r y . They a r e p r e s e n t e d h e r e i n t e r m s of a c a l l t o a P a s c a l p r o c e d u r e , and a s h o r t e x p l a n a t i o n o f t h e i r o p e r a t i o n . F o r a d e t a i l e d u n d e r s t a n d i n g i t i s b e s t t o r e f e r t o t h e l i s t s u b r o u t i n e s i n A p p e n d i x I I . 1. POPL(LIST,NEW,EMPTY): T h i s r o u t i n e removes t h e f i r s t TCB from t h e l i s t t h a t t h e h e a d p o i n t e r " L I S T " marks. I t r e t u r n s a p o i n t e r "NEW" t h a t i s t h e a d d r e s s o f t h e popped TCB. In t h e e v e n t t h a t t h e l i s t was empty t h e b o o l e a n f l a g "EMPTY" i s s e t t o t r u e ( o t h e r w i s e f a l s e ) and "NEW" i s unchanged. T h i s r o u t i n e m i m i c k s t h e u s u a l s t a c k p o p p i n g o p e r a t i o n . 2. PUSHL(LIST,NEW): PUSHL p u t s a NEW TCB on t h e f r o n t of L I S T . I t i s t h e c o mplementary o p e r a t i o n t o POPL b u t must a l w a y s s u c c e e d . Sec 4.4.4 82 3. D E L E T E ( L I ST,NEW,KEY,KEYWORD,NOTFOUND): The a c t i o n of DELETE i s s i m i l i a r t o POPL e x c e p t t h a t i t s e a r c h e s t h r o u g h t h e l i s t u n t i l t h e KEYWORD i s f o u n d . KEY s p e c i f i e s t h e p o s i t i o n of t h e keyword i n t h e TCB and NOTFOUND i s s e t t r u e i f t h e keyword i s n ' t f o u n d ( p o s s i b l y b e c a u s e t h e l i s t i s empty). 4. INSERT(LIST,NEW,KEY): INSERT behaves i n a s i m i l i a r f a s h i o n t o PUSHL, o n l y t h e NEW TCB i s i n s e r t e d b e f o r e t h e f i r s t TCB i t f i n d s w i t h a keyword a t KEY l e s s t h a n i t s own. Thi^s i s handy when i n s e r t i n g t a s k s of e q u a l p r i o r i t y i n t o a queue as i t e n s u r e s t h a t t h e l a t e r a r r i v a l s a r e queued a f t e r t h e e a r l i e r o n e s . I t i s a l s o i m p o r t a n t t o n o t e t h a t t h i s r o u t i n e assumes t h e keyword i s a l r e a d y p r e s e n t i n t h e new TCB. The new TCB i s i n s e r t e d a t t h e end of t h e l i s t i f a l l o t h e r TCBs have l a r g e r keywords. 5. FIND(LIST,NEW,KEY,KEYWORD,NOTFOUND): S e a r c h e s t h e L I S T f o r a KEYWORD a t KEY, and r e t u r n s t h e p o i n t e r t o i t s TCB i n NEW i f f o u n d . NOTFOUND i s s e t t r u e and t h e v a l u e of NEW i s unchanged i f t h e s e a r c h f a i l s . The l i s t s t r u c t u r e i s l e f t unchanged so t h i s r o u t i n e i s handy when t e s t i n g f o r t h e e x i s t e n c e of t a s k s . A l l s y s t e m o p e r a t i o n s so f a r d e v i s e d c a n be p e r f o r m e d u s i n g t h e s e f i v e l i s t o p e r a t i o n s . O t h e r s t h a t c o u l d p o s s i b l y be o f v a l u e would be t h e a b i l i t y t o add and remove TCBs from t h e end o f l i s t s , t h u s s i m u l a t i n g f i r s t i n , f i r s t o u t s t a c k s . The o t h e r i m p o r t a n t p o i n t r e g a r d i n g l i s t o p e r a t i o n s i s t h a t t h e y s h o u l d be i n d i v i s i b l e . T h i s t e r m means t h a t i n t e r r u p t s must not be a l l o w e d t o pre-empt t h e s e r o u t i n e s w h i l e t h e y a r e i n Sec 4.4.4 83 t h e p r o c e s s o f c h a n g i n g l i s t s t r u c t u r e s . I n d i v i s i b i l i t y i s s i m p l y a c h i e v e d by l o a d i n g t h e i n t e r r u p t mask w i t h a z e r o (LIMI 0 i n s t r u c t i o n ) . I n t e r r u p t s a r e t h u s p r e v e n t e d u n t i l a RTWP i n s t r u c t i o n i s e x e c u t e d . T h i s p o i n t a p p l i e s t o any p a r t o f t h e s y s t e m t h a t i s a c t u a l l y m a n i p u l a t i n g t h e s y s t e m s t r u c t u r e s . 4.5 MEMORY MANAGEMENT M i c r o p r o c e s s o r s y s t e m s c o n s i s t of two v e r y d i f f e r e n t t y p e s of memory w i t h d i f f e r e n t p r o p e r t i e s . The f i r s t i s r e a d o n l y memory (ROM) and w h i l e i t i s n o t p o s s i b l e f o r t h e m i c r o p r o c e s s o r t o a l t e r ROM c o n t e n t s e r a s a b l e / p r o g r a m m a b l e t y p e s have been d e v e l o p e d and g i v e n t h e acronym EPROM. U s u a l l y an u l t r a - v i o l e t lamp i s r e q u i r e d t o do t h e e r a s i n g , and s p e c i a l h i g h c u r r e n t d r i v e r s f o r t h e re - p r o g r a m m i n g . The EPROM i s c o n v e n i e n t f o r programs and c o n s t a n t s . The o t h e r form of memory i s known, c o n f u s i n g l y , as random a c c e s s memory (RAM) and i t can o f c o u r s e be r e a d and w r i t t e n . F o r any sy s t e m , a l l d a t a t h a t i s t o be cha n g e d must r e s i d e i n RAM and t h i s i n c l u d e s t a s k c o n t r o l b l o c k s , w o r k s p a c e s , f l a g s , semaphores and c o u n t e r s . C o n s i d e r now t h a t a s y s t e m has t h e p o t e n t i a l t o e x e c u t e a l a r g e number of t a s k s . I t i s e x t r e m e l y u n l i k e l y t h a t a l l t h e s e t a s k s w i l l be i n t h e s y s t e m a t onc e , e s p e c i a l l y t h o s e t h a t o n l y have a s h o r t d u r a t i o n ( s u c h a s p r i n t i n g a m e s s a g e ) . A g i v e n amount of RAM can t h e r e f o r e s u p p o r t a l a r g e r t a s k l o a d i f means a r e d e v i s e d t o d y n a m i c a l l y a l l o c a t e and d e - a l l o c a t e b l o c k s of memory. Sec 4.5 84 4.5.1 The F r e e L i s t (Q.FRE) T h i s i s s i m p l y a l i n k e d l i s t o f b l o c k s of RAM t h a t a r e a v a i l a b l e f o r u s e . One o f t h e main p r o b l e m s o f memory management i s t h e p r o c e s s of f r a g m e n t a t i o n . I f p r o c e s s e s t a k e as much RAM as t h e y r e q u i r e , and i f t h e y r e q u i r e d i f f e r e n t amounts, t h e r e a r e a l w a y s odd b i t s and p i e c e s l e f t o v e r w h i c h a r e i m p o s s i b l e t o u s e . As t i m e i n c r e a s e s t h e number o f t h e f r a g m e n t s i n c r e a s e s u n t i l t h e memory management s y s t e m becomes u n u s a b l e . The s i m p l e s t way t o a v o i d t h i s p r o b l e m i s t o d e t e r m i n e t h e l a r g e s t b l o c k t h a t t h e s y s t e m needs and t o g i v e t h i s t o e v e r y t a s k . T h e r e i s u n d o u b t e d l y some l a c k o f economy w i t h t h e a p p r o a c h but t h e wastage i s not s e r i o u s . F o r t u n a t e l y our s y s t e m u s e s v e r y s i m i l i a r s i z e d b l o c k s f o r a l l i t s p r o c e s s e s . 1. W o rkspaces : a r e 16 words l o n g by n e c e s s i t y . C l e a r l y no o v e r l a p o f w o r k s p a c e s can be a l l o w e d i n a dynamic s i t u a t i o n . 2. T ask C o n t r o l B l o c k s : w i t h a l l p o i n t e r s , f l a g s , names e t c . c o n s i d e r e d a TCB r e q u i r e s 15 words of RAM. T h i s c o u l d be r e d u c e d t o 12. 3. C o n v e r s a t i o n a l B u f f e r s : u s e d t o s t o r e " s e n t e n c e s " from t h e t e l e t y p e f o r f u r t h u r p r o c e s s i n g . At two c h a r a c t e r s p e r word, t h i r t y - t w o c h a r a c t e r s c a n be h e l d i n a s i x t e e n word b u f f e r . T h i s s i z e has p r o v e n v e r y c o n v e n i e n t , and i n any c a s e b u f f e r s a r e r e t u r n e d t o t h e f r e e l i s t r e l a t i v e l y r a p i d l y . The f r e e l i s t i s t h e r e f o r e i n i t i a l i s e d w i t h f o r t y - t w o b l o c k s of RAM e a c h one 16 words l o n g . T h i s i s enough t o s a t i s f y t h e Sec 4.5.1 85 r e q u i r e m e n t s f o r s i x t e e n r a c k t a s k s ( 3 2 ) , two c o n v e r s a t i o n a l b u f f e r s (2) and f o u r o t h e r t a s k s ( 8 ) . PROCEDURE tcbget (VAR new:@tcb;none:boolean); VAR newwp:@workspace; BEGIN popKqf re,new,none); IF NOT none THEN BEGIN popKqfre,newwp,none); IF NOT none THEN new@.wsp:=newwp ELSE pushl(qfre,new) END END Program 4.2 TCBGET - creates a TCB/workspace structure 4.5.2 A l l o c a t i n g and D e - a l l o c a t i n g Memory W i t h t h e c o n s t r u c t i o n of a f r e e l i s t o f e q u a l s i z e d b l o c k s of RAM memory management i s an e x t r e m e l y s t r a i g h t - f o r w a r d p r o c e d u r e . When a b l o c k i s r e q u i r e d i t i s s i m p l y POPLed from t h e f r e e l i s t , and l i k e w i s e r e t u r n e d by u s i n g t h e PUSHL o p e r a t i o n . T h e r e i s no p o i n t i n m a i n t a i n i n g any k i n d of o r d e r i n t h e f r e e l i s t and t h i s t h e r e f o r e r e p r e s e n t s t h e o p t i m a l s t r a t e g y . B e c a u s e new t a s k s commonly r e q u i r e b o t h a TCB and a wo r k s p a c e a p r o c e d u r e has been d e f i n e d t o o b t a i n t h e s e . I t can be f o u n d under t h e name TCBGET i n t h e o p e r a t i n g s y s t e m l i s t i n g ( A p p e n d i x I I ) and i t s o p e r a t i o n i s d e s c r i b e d by t h e P a s c a l p r o c e d u r e i n p r o g r a m 4.2. L i k e w i s e d e c o m p o s i n g t a s k s t r u c t u r e s i s a r e l a t i v e l y common o p e r a t i o n and t h e p r o c e d u r e DISOLV, t h a t does t h i s , i s l i s t e d i n pr o g r a m 4.3. Sec 4.5.2 86 4.6 ACCESSING TASKS PROCEDURE d i s o l v ( V A R t a s k n a m e : i n t e g e r ; n o t f o u n d : b o o l e a n ) ; BEGIN d e l e t e ( q t s k , o l d , t a s k n a m e , n o t f o u n d ) ; IF NOT n o t f o u n d THEN BEGIN IF r a c k t a s k ( t a s k n a m e , r a c k n u m ) THEN BEGIN l e d t a b ( r a c k n u m ) : = 0 ; r c k t a b ( r a c k n u m ) : = 0 END pushMqf r e , o l d ) ; p u s h l ( q f r e , o l d @ . w s p ) END END N o t e s : 1. " R a c k t a s k " i s a c o n v e n i e n t p r o c e d u r e t h a t t e s t s t h e t a s k name t o see i f i t was u s i n g a r a c k . The racknumber i s r e t u r n e d when t h i s i s t r u e . 2. " L e d t a b " and " r a c k t a b " a r e s y s t e m t a b l e s r e s p o n s i b l e f o r r e f r e s h i n g t h e c o n t e n t s o f r a c k r e g i s t e r s . C l e a r i n g t h e s e d e a c t i v a t e s t h e a p p r o p r i a t e r a c k ( s e e s e c t i o n 4.17) P r o g r a m 4.3 DISOLV - d i s s o l v e s t h e TCB/workspace s t r u c t u r e A l t h o u g h most s y s t e m o p e r a t i o n s i n v o l v e moving TCBs between v a r i o u s l i n k e d l i s t s i t sometimes happens t h a t i t i s n e c e s s a r y t o f i n d a TCB when i t s p o s i t i o n i n t h e s y s t e m s t r u c t u r e i s not known. Examples of t h i s e n c o u n t e r e d so f a r a r e : 1. C h e c k i n g f o r t h e e x i s t e n c e of a new t a s k name b e f o r e g e n e r a t i n g i t . A l l o w i n g two TCBs i n t o t h e s y s t e m w i t h t h e same name would be f a t a l . 2. Check f o r t h e e x i s t e n c e o f a t a s k whose p u r p o s e c o n f l i c t s w i t h a new one. The p r i m e example of t h i s i s t h a t t a s k s f o r b o t h manual and a u t o m a t i c c o n t r o l o f t h e same r a c k can i n t e r a c t w i t h c o m p l e t e l y u n f o r e s e e n r e s u l t s . Sec 4.6 87 3. A b o r t i n g t a s k s i s a t r i c k y b u s i n e s s . U n l e s s a t a s k i s i n some known c o n d i t i o n ( s u c h as an e r r o r c o n d i t i o n ) a b o r t s s h o u l d o n l y be p e r f o r m e d by t h e t a s k i t s e l f . T h i s i s made p o s s i b l e by s e t t i n g a f l a g i n t h e TCB w h i c h t h e t a s k c a n t e s t t o c o n d i t i o n a l l y e x e c u t e a s e l f d e s t r u c t p r o c e d u r e ( c a l l e d a d e f e r r e d a b o r t ) . R e s o u r c e d e - a l l o c a t i o n and shutdown i s t h e n p e r f o r m e d i n an o r d e r l y manner. By t e s t i n g f o r e x i s t e n c e of t h e t a s k b e f o r e s e t t i n g t h e f l a g t h e p o s s i b i l i t y o f an o p e r a t o r e r r o r i s m i n i m i s e d . 4.6.1 The R e s i d e n t T a s k L i s t (Q.TSK) I n s t e a d of p e r f o r m i n g an e x t e n s i v e s e a r c h of a l l l i s t s , q u eues and p o i n t e r s i n t h e s y s t e m i t i s much s i m p l e r t o r e t a i n a l l t a s k s c u r r e n t l y a c t i v e on a s p e c i a l l i n k e d l i s t , known as t h e r e s i d e n t t a s k l i s t . A t a s k has i t s TCB PUSHLed h e r e when f i r s t i n t r o d u c e d i n t o t h e s y s t e m , and t h e n DELETEd when f i n i s h e d . In between t i m e a g i v e n t a s k name i s e a s i l y f o u n d by u s i n g t h e FIND o p e r a t i o n . Not o n l y i s t h e e x i s t e n c e of t h e t a s k v e r i f i e d but p a r a m e t e r s i n i t s TCB a r e e a s i l y t e s t e d , a l t e r e d , s e t or c h a n g e d . 4.7 EXECUTION OF TASKS The p r i m a r y f u n c t i o n of any o p e r a t i n g s y s t e m must be t o e x e c u t e t a s k s i n a l o g i c a l f a s h i o n . I t i s r e a s o n a b l e t o e x p e c t t h a t some t a s k s w i l l a l s o have a g r e a t e r p r i o r i t y f o r t h e CPU t h a n o t h e r s . S t r u c t u r e s and r o u t i n e s must be d e v i s e d t o a c c o u n t f o r t h i s . Sec 4.7 88 4.7.1 The E x e c u t i o n Queue (Q.XEC) The s i m p l e s t way of e x e c u t i n g t a s k s l o g i c a l l y i s t o d e f i n e a l i n k e d l i s t of t a s k c o n t r o l b l o c k s t h a t a r e p r i o r i t y o r d e r e d . When t h e CPU becomes a v a i l a b l e t h e h i g h e s t p r i o r i t y t a s k c a n be removed from t h e queue and e x e c u t e d . Our s y s t e m v a r i e s t h e scheme s l i g h t l y . R a t h e r t h a n h a v i n g t h e f i r s t t a s k on t h e e x e c u t i o n queue as t h e h i g h e s t p r i o r i t y t a s k w a i t i n g f o r t h e p r o c e s s o r , i t i s a c t u a l l y t h e t a s k c u r r e n t l y e x e c u t i n g . When i t no l o n g e r r e q u i r e s t h e CPU ( o f i t s own v o l i t i o n or i f i t i s pre-empted) t h e n i t i s e i t h e r POPLed from t h e queue o r has a h i g h e r p r i o r i t y t a s k INSERTed b e f o r e i t . O p e r a t i o n a l w a y s c o n t i n u e s w i t h t h e e x e c u t i o n o f t h e f i r s t t a s k on t h e queue. T h e r e i s t h e q u e s t i o n o f what t o do when t h e e x e c u t i o n queue becomes empty. U s u a l l y t h e p r o c e s s o r i s s e n t i n t o a l o o p o r an i d l e s t a t e t h a t c an be i n t e r r u p t e d i n some f a s h i o n . B e c a u s e our s y s t e m i s d r i v e n by u s e r commands from t e l e t y p e i t makes s e n s e t o e x e c u t e a t i g h t l o o p t h a t m o n i t o r s t h e k e y b o a r d f o r o p e r a t o r i n p u t . Such a program c o u l d e a s i l y be a p a r t o f t h e o p e r a t i n g s y s t e m , but a n e a t e r s o l u t i o n i s t o p l a c e t h e l o o p w i t h i n a low p r i o r i t y t a s k . The t a s k i s f o r e v e r c h e c k i n g t h e t e l e t y p e o r d e c o d i n g commands so i t n e v e r r e a l l y f i n i s h e s , and t h e o p e r a t i n g s y s t e m n e v e r has t o c o n t e n d w i t h an empty e x e c u t i o n queue. T h i s t a s k i s c a l l e d t h e command t a s k (TSKCMD) and i t i s n e c e s s a r i l y t h e l o w e s t p r i o r i t y t a s k i n t h e s y s t e m . A t a s k of l o w e r p r i o r i t y m i g h t n e v e r e x e c u t e . 4.7.2 D i s p a t c h i n g o r A l l o c a t i o n The e x e c u t i o n queue e n s u r e s t h a t t h e h i g h e s t p r i o r i t y t a s k w i l l be a l l o c a t e d t h e CPU a t t h e f i r s t p o s s i b l e o p p o r t u n i t y . Sec 4.7.2 89 However r o u t i n e s must be d e v i s e d t o a c t u a l l y d i s p a t c h t h e t a s k t o t h e p r o c e s s o r . T h i s i s s i m p l y a c h i e v e d by remembering t h a t a t a s k i s e x e c u t e d when i t s p r o g r a m s t a t e v e c t o r i s l o a d e d i n t o t h e a p p r o p r i a t e i n t e r n a l r e g i s t e r s . As a l r e a d y m e n t i o n e d , t h e o n l y p r a c t i c a l way o f d o i n g t h i s i s t o use t h e RTWP i n s t r u c t i o n . D i s p a t c h i n g i s , t h e r e f o r e , a s i m p l e p r o c e d u r e w h i c h moves t h e PSV f r o m t h e f i r s t TCB on t h e e x e c u t i o n queue ( p r o c e d u r e PSVGET) and i n t o r e g i s t e r s 13, 14 and 15 o f t h e s u p e r v i s o r w o r k s p a c e . T h e s e s t e p s a r e f o l l o w e d by t h e RTWP i n s t r u c t i o n . F i g u r e 4.3 s h o u l d c l a r i f y t h e o p e r a t i o n s . execution queue ^ other task of lower priority waiting to execute. psv new WP new PC new ST supervisor workspace r13 rH r15 registers WP PC RTWP instruction loads CPU regs with new context̂ ST F i g u r e 4.3 D i s p a t c h i n g a Task f o r E x e c u t i o n 4.7.3 D e - a l l o c a t i o n The o p e r a t i n g s y s t e m r o u t i n e s a r e u s e d by r e l i n q u i s h i n g t a s k s c a l l i n g them f r o m t h e BLWP i n s t r u c t i o n , o r i n r e s p o n s e t o e x t e r n a l i n t e r r u p t s p r e - e m p t i n g t h e c u r r e n t l y a c t i v e t a s k . In Sec 4.7.3 90 e i t h e r c a s e t h e PSV o f t a s k i s s a v e d i n r e g i s t e r s 13, 14 and 15 of t h e s u p e r v i s o r w o r k s p a c e . I f t h e t a s k i s t o be c o r r e c t l y d i s p a t c h e d a t some l a t e r p o i n t t h e n t h e PSV must be moved from t h e s u p e r v i s o r w o r k s p a c e t o t h e f i r s t TCB on t h e e x e c u t i o n queue b e f o r e any c h a n g e s a r e made i n t h e queue. A p r o c e d u r e PSVSAV has been w r i t t e n t o do t h i s . In some c a s e s no new t a s k s may be i n s e r t e d i n t o t h e e x e c u t i o n queue so t h e r e i s no p o i n t i n w a s t i n g t i m e and memory s a v i n g t h e PSV. As l o n g as t h e t h r e e l a s t r e g i s t e r s o f t h e s u p e r v i s o r w o r k s p a c e a r e not a l t e r e d , t a s k e x e c u t i o n i s s i m p l y resumed u s i n g o n l y t h e RTWP i n s t r u c t i o n . 4.8 STARTING THE SYSTEM (STARTUP) B e f o r e any s y s t e m can f u n c t i o n c o r r e c t l y t h e r e a r e i n e v i t a b l y a whole s e r i e s of d e v i c e s , f l a g s , p o i n t e r s , c o u n t e r s , e t c . t h a t must be i n i t i a l i s e d . Upon e n t r y t h e o p e r a t i n g s y s t e m p e r f o r m s t h e f o l l o w i n g sequence of i n i t i a l i s a t i o n s w h i c h can be s o u g h t i n g r e a t e r d e t a i l i n t h e p r o g ram l i s t i n g and i n t h e i n s t r u c t i o n manual f o r t h e m i c r o p r o c e s s o r ( T e x a s I n s t r u m e n t s , 1979). 4.8.1 S t a r t u p P r o c e d u r e 1. I n i t i a l i s e a p e r i o d i c 200 ms t i m e r i n t h e u s e r I/O p o r t , s e t up t h e i n t e r r u p t v e c t o r , and e n a b l e i t s i n t e r r u p t c a p a b i l i t y . 2. In a s i m i l i a r f a s h i o n , i n i t i a l i s e a 1ms t i m e r i n t h e s y s t e m I/O p a r t . 3. I n i t i a l i s e t h e XOP v e c t o r s ( s e e i n s t r u c t i o n m a n u a l ) . 4. I n i t i a l i s e t h e a n a l o g u e / d i g i t a l c o n v e r t e r h a r d w a r e , p e r m i t Sec 4.8.1 91 i n t e r r u p t s , and s e t i t s i n t e r r u p t v e c t o r . 5. I n i t i a l i s e and allow, i n t e r r u p t s from t h e CMOS e x p a n s i o n bus ( f r o m r a c k s and i n l e t l i n e ) . 6. C r e a t e t h e f r e e l i s t . 7. C l e a r a l l l i s t s and queue h e a d p o i n t e r s . 8. I n i t i a l i s e semaphores. 9. C l e a r r a c k and LED r e f r e s h t a b l e s . 10. I n i t i a l i s e w o r k s pace f o r d i s p l a y t i m e r i n t e r r u p t s e r v i c e r o u t i n e . 11. I n i t i a t e ASCII c l o c k and s e t c u r r e n t prompt o r p r e f i x c h a r a c t e r . 12. I n i t i a t e t h e c l o c k u p d a t e t a s k and p l a c e i t on t h e c l o c k i n t e r r u p t w a i t p o i n t e r . 13. I n i t i a l i s e t h e command t a s k . 14. PUSHL t h e command and c l o c k u p d a t e t a s k s t o t h e r e s i d e n t t a s k l i s t . 15. INSERT t h e command t a s k on t h e e x e c u t i o n queue. 16. D i s p a t c h t o t h e f i r s t t a s k on t h e e x e c u t i o n queue. A f t e r t h i s s e quence i s c o m p l e t e d t h e command t a s k w i l l be e x e c u t e d and w i l l s t a r t s c a n n i n g t h e t e l e t y p e i n p u t p o r t f o r a c h a r a c t e r . I n t e r r u p t s w i l l a r r i v e from t h e c l o c k t i m e r e v e r y 200 ms and t h e c l o c k u p d a t e t a s k w i l l c o n s e q u e n t l y be queued and e x e c u t e d e v e r y s e c o n d . E v e r y 1.0 ms t h e s e r v i c e r o u t i n e f o r t h e d i s p l a y t i m e r i n t e r r u p t w i l l c l e a r r a c k r e g i s t e r s t h u s making s u r e t h a t a l l s o l e n o i d s and c o n t r o l l i n e s a r e o f f o r i n a c t i v e 16 ms a f t e r t h e STARTUP p r o c e d u r e i s e n t e r e d . In t h e p r e s e n t i m p l e m e n t a t i o n t h e sample l i n e o p e r a t i n g s y s t e m (SLOS) i s e n t e r e d u s i n g t h e J command from t h e UNIBUG Sec 4.8.1 92 m o n i t o r ( T e x a s I n s t r u m e n t s , 1978). The m o n i t o r i t s e l f i s e n t e r e d whenever power i s a p p l i e d t o t h e m i c r o p r o c e s s o r b o a r d , o r when t h e b o a r d mounted l o a d s w i t c h i s c l o s e d . A more s a t i s f a c t o r y p r o c e d u r e would be t o e n t e r SLOS d i r e c t l y on power up but t h i s would r e q u i r e c h a n g i n g t h e l o a d v e c t o r i n t h e UNIBUG program. V a r i o u s hardware a p p r o a c h e s c o u l d p o s s i b l y be u s e d but a l l o f t h e s e i n v o l v e making p h y s i c a l c h a n g es t o t h e p r i n t e d w i r i n g on t h e m i c r o p r o c e s s o r a s s e m b l y . These m o d i f i c a t i o n s w i l l be made when t i m e p e r m i t s . 4.9 INTRODUCING NEW TASKS (RELINQ) A f t e r s t a r t up, t h e p r o c e s s o r i s o c c u p i e d w i t h u p d a t i n g t h e t i m e - o f - d a y c l o c k and s c a n n i n g t h e t e l e t y p e p o r t f o r i n p u t commands. At some s t a g e t h e command t a s k w i l l r e c e i v e a u s e r command, t h a t t o be e x e c u t e d must r e s u l t i n t h e g e n e r a t i o n and i n t r o d u c t i o n o f a new t a s k i n t o t h e s y s t e m . In o r d e r t o do t h i s t h e command t a s k must r e l i n q u i s h c o n t r o l of t h e CPU once i t has composed and i n i t i a l i s e d a TCB and w o r k s p a c e . A s y s t e m r o u t i n e RELINQ i s p r o v i d e d e x p r e s s l y f o r t h i s p u r p o s e , but i s i n f a c t u s e f u l f o r i n t r o d u c i n g any t a s k , whether new or j u s t p r e v i o u s l y i n a c t i v e , back i n t o t h e e x e c u t i o n queue. The RELINQ o p e r a t i o n i s shown i n Program 4.3. I t s i m p l y s a v e s th e PSV of t h e r e l i n q u i s h i n g t a s k , i n s e r t s t h e TCB of t h e new t a s k i n t o t h e e x e c u t i o n queue (and t h e r e s i d e n t t a s k l i s t i f not a l r e a d y t h e r e ) , and t h e n d i s p a t c h e s t h e h i g h e s t p r i o r i t y t a s k t o t h e CPU. T h e r e i s t h e added c o m p l i c a t i o n t h a t two t a s k s w i t h t h e same name (b u t u s i n g d i f f e r e n t TCBs) must not be a l l o w e d t o c o - e x i s t . I f t h i s c o n d i t i o n e x i s t s t h e name of t h e new t a s k i s Sec 4.9 93 i n c r e m e n t e d u n t i l i t i s u n i q u e . T h i s p r o v e d c o n v e n i e n t , PROCEDURE r e l i n q ( V A R new:@tcb); CONSTANT t h e - u n i v e r s e - d i e s = f a l s e ; VAR same:@tcb; not f o u n d : b o o l e a n ; BEGIN l i m i ( 0 ) ; I F new=NIL THEN s y s t e m e r r o r ; REPEAT BEGIN f ind(qxec,same,name,new@.name,notfound); IF n o t f o u n d OR same=new THEN BEGIN p s v s a v ; i n s e r t ( q x e c , n e w , p r i o r i t y ) ; p s v g e t ; rtwp END new@.name:nw@.name+1 END UNTIL t h e - u n i v e r s e - d i e s END N o t e s : 1. " S y s t e m e r r o r " i s a d i a g n o s t i c r o u t i n e i n t h e e v e n t o f s y s t e m e r r o r . 2. C o n t r o l l e a v e s t h i s p r o c e d u r e when e i t h e r " s y s t e m e r r o r " or "rtwp" i s e x e c u t e d . 3. The p r o c e d u r e c o u l d r e p e a t i n d e f i n i t e l y i f no u n i q u e new name i s e v e r f o u n d ( i . e . u n t i l t h e u n i v e r s e d i e s ) . Program 4.3 R E L I N G Q u i s h i n g t h e CPU e s p e c i a l l y when l o g g i n g r a c k i n t e r r u p t s , b u t c o u l d p r o v e t r o u b l e s o m e i f t h e t a s k name i s i n c r e m e n t e d t o o f a r ( h i g h l y i m p r o b a b l e ) . 4.10 INACTIVATING TASKS FOR A GIVEN TIME I t i s f r e q u e n t l y t h e c a s e i n a r e a l t i m e s y s t e m t h a t a t a s k a c t i v a t e s s o m e t h i n g e x t e r n a l ( i . e . i n t h e r e a l w o r l d ) and t h e n must w a i t f o r a c e r t a i n t i m e u n t i l i t can p r o c e e d . In our c a s e Sec 4.10 94 common examples i n v o l v e w a i t i n g f o r gas f l o w r a t e s t o s t a b i l i s e d u r i n g t r a n s f e r s t a g e s , o r f o r p r e s s u r e s t o s t a b i l i s e d u r i n g pump down o r l e a k t e s t i n g . As t h e CPU can do n o t h i n g f o r t h e t a s k e x c e p t l o o p c o n t i n u o u s l y , i t i s w a s t e f u l t o use t h i s v a l u a b l e r e s o u r c e i n s u c h a manner. I n s t e a d i t makes a good d e a l more sen s e t o i n a c t i v a t e t h e w a i t i n g t a s k u n t i l i t i s r e a d y t o e x e c u t e a g a i n . In t h e meantime t h e p r o c e s s o r c a n p r o c e e d w i t h o t h e r t a s k s ( u s u a l l y t h e command t a s k ) . 4.10.1 The T i m e r Queue (Q.TMR) S t r u c t u r i n g t h e o p e r a t i n g s y s t e m a r o u n d l i n k e d l i s t s a l l o w s t h e programmer t o c r e a t e as many s p e c i a l p u r p o s e q u e u e s as t h e s y s t e m r e q u i r e s . C o n s e q u e n t l y i t i s e a s y t o d e f i n e a queue on w h i c h t a s k s a r e p l a c e d u n t i l a c e r t a i n t i m e p e r i o d has e l a p s e d . The t i m e r queue can be u p d a t e d a t a c o n v e n i e n t u n i t of t i m e ( e v e r y s e c o n d ) and TCBs c a n be d e l e t e d from i t and r e p l a c e d on t h e e x e c u t i o n queue when t h e i r t i m e has e l a p s e d . As u s u a l i t i s c o n v e n i e n t and s t r a i g h t f o r w a r d t o o r d e r t a s k s i n t e r m s of t h e i r p r i o r i t y . 4.10.2 S e t t i n g t h e A l a r m (WAIT) T a s k s t h a t w i s h t o w a i t f o r a g i v e n p e r i o d o f t i m e e x e c u t e a BLWP t o t h e s u p e r v i s e r / o p e r a t i n g s y s t e m r o u t i n e WAIT, w i t h r e g i s t e r z e r o o f t h e w o r k s p a c e s e t t o t h e t i m e p e r i o d i n s e c o n d s . The WAIT r o u t i n e t r a n s f e r s t h e p e r i o d t o i t s a p p r o p r i a t e p l a c e i n t h e t a s k c o n t r o l b l o c k a f t e r P O P L i n g the b l o c k f r o m t h e e x e c u t i o n queue. The w a i t i n g TCB i s INSERTed i n t o t h e t i m e r queue, and t h e n e x t h i g h e s t p r i o r i t y t a s k on t h e Sec 4.10.2 95 e x e c u t i o n queue i s a l l o c a t e d t h e CPU. The p r o c e d u r e i s s i m p l e and s t r a i g h t f o r w a r d . I t i s shown i n Program 4.4. PROCEDURE wa i t ( V A R t i m e : i n t e g e r ) ; VAR temp:@tcb;empty:boolean; BEGIN l i m i ( 0 ) ; p s v s a v ; p o p l ( q x e c , t e m p , e m p t y ) ; I F empty THEN s y s t e m e r r o r ; temp@.alarm:=time; i n s e r t ( q t m r , t e m p , p r i o r i t y ) ; p s v g e t ; r t w p END P rogram 4.4 P r o c e d u r e t o p l a c e TCB on t i m e r queue 4.10.3 The S y s t e m C l o c k (SRVCLK) The U n i v e r s i t y K i t b o a r d has two i n t e r f a c e d e v i c e s , b o t h of w h i c h have i n t e r n a l , programmable t i m e r s . The t i m e r s g e n e r a t e a p e r i o d i c i n t e r r u p t w h i c h p r e - e m p t s c u r r e n t p r o g ram e x e c u t i o n . In p a r t i c u l a r t h e u s e r I/O p o r t i s i n i t i a l i s e d t o g e n e r a t e an i n t e r r u p t e v e r y 200 ms. T h i s i n t e r r u p t c a u s e s e n t r y t o t h e s e r v i c e r o u t i n e SRVCLK, w h i c h i n t u r n e x e c u t e s t h e f o l l o w i n g a c t i o n s ( P r o g r a m 4.5). 1. R e s e t s and r e - e n a b l e s t h e c l o c k i n t e r r u p t . 2. D e c r e m e n t s a t i c c o u n t e r . T h i s i s s e t t o a v a l u e o f f i v e d u r i n g t h e s t a r t up p r o c e d u r e and t h e r e f o r e r e a c h e s z e r o a f t e r one s e c o n d has e l a p s e d . 3. I f t h e t i c c o u n t e r i s s t i l l p o s i t i v e t h e n an RTWP i n s t r u c t i o n i s e x e c u t e d , c o n t i n u i n g t h e p r e - e m p t e d p r o g r a m . O t h e r w i s e t h e f o l l o w i n g a c t i o n s a r e p e r f o r m e d . 4. Check t h e i n t e r r u p t p o i n t e r f o r t h e c l o c k ( I N T . C L K ) . I f Sec 4.10.3 96 t h i s i s z e r o ( o r empty) t h e n t h e c l o c k u p d a t e t a s k i s busy, and no a c t i o n can be t a k e n , so t h e RTWP s e q u e n c e i s e x e c u t e d . 5. I f however t h e c l o c k u p d a t e t a s k i s r e a d y t h e n t h e p o i n t e r w i l l be n o n - z e r o . The TCB i s i n s e r t e d i n t h e e x e c u t e queue, t h e p o i n t e r i s z e r o e d ( f l a g g i n g t h a t t h e u p d a t e t a s k i s b u s y ) , and t h e h i g h e s t p r i o r i t y t a s k i s d i s p a t c h e d t o t h e CPU. The h i g h e s t p r i o r i t y t a s k i s u s u a l l y t h e c l o c k u p d a t e t a s k i t s e l f , and so w i l l e x e c u t e as soon as t h e c l o c k i n t e r r u p t has been s e r v i c e d . PROCEDURE s r v c l k VAR i n t d k : @ t c b ; t i c c t r : i n t e g e r ; BEGIN l i m i ( 0 ) ; r e s e t c l o c k i n t e r r u p t ; t i c c t r : = t i c c t r - 1 ; IF t i c c t r . 0 THEN rtwp; ELSE IF i n t c l k = N I L THEN rtwp ELSE BEGIN p s v s a v ; q x e c i n s e r t ( q x e c , i n t c l k , p r i o r i t y ) ; i n t c l k : = N I L ; p s v g e t ; rtwp END END Program 4.5 System c l o c k s e r v i c e r o u t i n e (SRVCLK) 4.10.4 The C l o c k Update Task (TSKCUD) P r i m a r i l y d e s i g n e d f o r u p d a t i n g and r e m o v i n g t a s k s from t h e t i m e r queue, i t a c t u a l l y p e r f o r m s two r e l a t e d but i m p o r t a n t f u n c t i o n s . Sec 4.10.4 97 1. A l l messages o u t p u t on t h e t e l e t y p e a r e p r e f i x e d by t h e t i m e s i n c e s y s t e m s t a r t u p . T h i s t i m e i s s t o r e d i n t e r n a l l y i n t h e f o r m o f ASCII c h a r a c t e r s f o r t h e h o u r s , m i n u t e s and s e c o n d s ( t h e f o r m a t i s HHMM:SS) s u i t a b l e f o r d i r e c t o u t p u t t o t h e t e l e t y p e . The c l o c k u p d a t e p e r f o r m s an ASCII i n c r e m e n t o f i t s v a l u e . 2. The t i c c o u n t e r must a l s o be u p d a t e d , b u t t h i s i s s i m p l y a m a t t e r o f s u b t r a c t i n g f i v e f r o m i t s v a l u e . U s i n g t h e t i c c o u n t e r i n t h i s f a s h i o n has two a d v a n t a g e s . I t a l l o w s c l o c k i n t e r r u p t s t o c o n t i n u e even t h o u g h t h e c l o c k u p d a t e i s e x e c u t i n g , and i t i n s u r e s t h a t c l o c k i n t e r r u p t s c a n n o t be " m i s s e d " i f , s a y , t h e c l o c k u p d a t e t a s k happened t o be p r e - empted f o r a r a t h e r l o n g t i m e . T h i s i s why t h e s e r v i c e r o u t i n e f o r t h e i n t e r r u p t s i s a b l e t o RTWP i f t h e u p d a t e t a s k i s n o t r e a d y (INT.CLK i s z e r o ) . The main f u n c t i o n t h o u g h i s f o r t h e c l o c k u p d a t e t a s k t o work i t s way t h r o u g h t h e t i m e r queue d e c r e m e n t i n g t h e a l a r m t i m e s of ea c h TCB i t f i n d s . When su c h a de c r e m e n t r e s u l t s i n a z e r o v a l u e t h e TCB i s DELETEd from t h e t i m e r queue (and t h e e r r o r queue i f t h e r e a s w e l l - see s e c t i o n 4 . 1 1.). The c l o c k u p d a t e t a s k , t h e n R E L I N Q u i s h e s , but b e c a u s e o f i t s h i g h p r i o r i t y c o n t i n u e s p r o c e s s i n g t h e t i m e r queue. In t h i s way t a s k s a r e r e t u r n e d f o r e x e c u t i o n once t h e i r t i m e p e r i o d has e x p i r e d . As m e n t i o n e d b e f o r e t h e c l o c k u p d a t e t a s k a l t e r s t h e s t r u c t u r e of t h e s y s t e m when i t d e l e t e s TCBs from t h e t i m e r (and e r r o r ) q u e u e s , t h e n i n s e r t s them t o t h e e x e c u t i o n queue. N o t h i n g e l s e must be a l l o w e d t o a l t e r s t r u c t u r e d u r i n g t h i s t i m e so a l l i n t e r r u p t s a r e masked o u t t o p r e v e n t t h e p o s s i b i l i t y (See Sec 4.10.4 98 Program 4 . 6 ) . When t h e c l o c k u p d a t e t a s k has f i n i s h e d i t w a i t s f o r t h e n e x t c l o c k i n t e r r u p t on t h e c l o c k w a i t p o i n t e r ( s e e s e c t i o n 4 . 1 3 ). PROCEDURE t s k c u d VAR c u r r , n e w , i n t d k : @ t c b ; t i c c t r , b e e p e r : i n t e g e r ; empty,not f o u n d : b o o l e a n ; BEGIN i n c r e m e n t a s c i i c l o c k ; t i c c t r : = t i c c t r + 5 ; c u r r : = q t m r ; WHILE c u r r = N I L DO BEGIN c u r r d . a i m : = c u r r @ . a i m - 1 ; I F c u r r d . a i m . 0 THEN BEGIN p o p l ( c u r r , n e w , e m p t y ) ; delete(qerr,new,name,new@.name,not found) IF NOT n o t f o u n d THEN b e e p e r : = b e e p e r - 1 ; r e l i n q ( n e w ) END c u r r : = c u r r @ . t m r END w a i t i n t ( i n t c l k ) ; END N o t e s : 1. " I n c r e m e n t a s c i i c l o c k " i s a t e d i o u s p r o c e d u r e w i t h e f f e c t s u g g e s t e d . 2. " B e e p e r " c o n t r o l s t h e r a t e of t h e a u d i b l e a l a r m beep. R e - e x e c u t i n g a t a s k i n an e r r o r c o n d i t i o n r e q u i r e s r e s e t t i n g t h i s . 3. " W a i t i n t " s i t s t h e t a s k on t h e i n t e r r u p t p o i n t e r s p e c i f i e d . P rogram 4.6 The c l o c k u p d a t e t a s k (TSKCUD) 4.11 ERROR CONDITIONS To f u n c t i o n c o r r e c t l y a r e a l o u r s r e q u i r e s a p r e s c r i b e d s e t o f A l t h o u g h i t i s p o s s i b l e t o d e s i g n t i m e p r o c e s s i n g s y s t e m s u c h a s c o n d i t i o n s i n t h e r e a l w o r l d , a t a s k t o behave i n t e l l i g e n t l y Sec 4.11 99 when c o n d i t i o n s v a r y s u c h an u n d e r t a k i n g u s u a l l y r e q u i r e s a good knowledge of t h e most p r o b a b l e f a u l t s and e r r o r s . B e c a u s e s u c h e x p e r i e n c e i s l a c k i n g a t an e a r l y s t a g e of d e v e l o p m e n t , and b e c a u s e i t i s i m p o s s i b l e f o r t h e p r o c e s s o r t o c o r r e c t a l l e r r o r s , t h e n t a s k s f i n d i n g i t i m p o s s i b l e t o p r o c e e d must be i n a c t i v a t e d under t h e f o l l o w i n g c r i t e r i a . 1. F a c i l i t i e s must be p r o v i d e d t o n o t i f y t h e o p e r a t o r t h a t t h e e r r o r has o c c u r r e d . I n f o r m a t i o n must be p r e s e n t e d t o i d e n t i f y t h e e r r o r . 2. The o p e r a t o r must be a b l e t o d e c i d e t h e f a t e of s u c h a t a s k . S h o u l d t h e t a s k be a b o r t e d o r i s i t p o s s i b l e t o e f f e c t some r e c o v e r y a c t i o n ? 3. Some c o n d i t i o n s a r e t e m p o r a r y . An example of t h i s i s t h a t e v a c u a t i n g t h e sample r e s e r v o i r s f a i l s on a p r e s s u r e t e s t . T h i s may be due t o t h e p r e s e n c e of a s m a l l d r o p l e t of water so t h e e v a c u a t i o n would have been s u c c e s s f u l i f i t was t r i e d a g a i n ( o r a number o f t i m e s ) . I t t h e r e f o r e seems r e a s o n a b l e t o p r o v i d e a t i m e out p r o c e d u r e whereby t h e t a s k i n i t i a t e s i t s own r e c o v e r y a c t i o n i f t h e o p e r a t o r does n o t r e s p o n d w i t h i n a g i v e n p e r i o d . 4.11.1 The E r r o r Queue (Q.ERR) As u s u a l i t i s s i m p l e s t t o d e f i n e a p r i o r i t y - o r d e r e d , l i n k e d l i s t of TCBs f o r t a s k s t h a t a r e u n a b l e t o p r o c e e d b e c a u s e e x t e r n a l c o n d i t i o n s a r e not c o r r e c t . The t a s k i t s e l f must " d i s c o v e r " t h e c o n d i t i o n and i s r e s p o n s i b l e f o r p l a c i n g i t s e l f on t h e queue. Sec 4.11.1 100 4.11.2 G e t t i n g on t h e Queue (WAIT.ERR) When a t a s k needs t o w a i t f o r o p e r a t o r i n t e r v e n t i o n i t e x e c u t e s a BLWP t o WAIT.ERR (Pr o g r a m 4. 6 ) . The f o l l o w i n g s t e p s a r e e x e c u t e d . 1. I n c r e a s e t h e b e e p e r r a t e ( I f n o t on, t h e a u d i b l e a l a r m w i l l sound) . 2. I n s e r t t h e c a l l i n g t a s k i n t o t h e e r r o r queue. 3. I f a t i m e out p e r i o d i s s p e c i f i e d ( n o n - z e r o ) t h e n i n s e r t t h e c a l l i n g t a s k i n t o t h e t i m e r queue as w e l l . 4. D i s p a t c h t o t h e h i g h e s t p r i o r i t y t a s k on t h e e x e c u t i o n queue. Note t h a t t h i s r o u t i n e does n o t g e n e r a t e any messages r e g a r d i n g t h e n a t u r e of t h e e r r o r ; i t was f o u n d more p r a c t i c a l t o l e t t h e c a l l i n g t a s k do t h i s . Nor does the r o u t i n e r e l e a s e s any r e s o u r c e s i t has h e l d ; t h i s can be u s e f u l when a r e s o u r c e , s u c h as t h e vacuum pump, i s f o u n d t o be a t f a u l t . Not r e l e a s i n g t h e r e s o u r c e w i l l p r e v e n t o t h e r t a s k s from u s i n g i t . 4.11.3 G e t t i n g O f f t h e E r r o r Queue T h e r e a r e t h r e e d i f f e r e n t ways of g e t t i n g o f f t h e e r r o r queue and two of them a r e i n i t i a t e d by o p e r a t o r commands t o t h e command t a s k ( s e e c h a p t e r 5 ) . 1. In t h e e v e n t t h a t t h e o p e r a t o r f e e l s t h a t t h e r e i s no s i m p l e way o f c o r r e c t i n g t h e e r r o r ( t h e r a c k has t o be d i s m a n t l e d , s a y ) t h e n t h e o p e r a t o r i s s u e s an ABORT command f o r t h e a p p r o p r i a t e t a s k number. T h i s w i l l DELETE t h e t a s k from t h e e r r o r queue, Sec 4.11.3 101 t h e t i m e r queue ( i f t h e r e ) , w i l l d e a l l o c a t e any r e s o u r c e s h e l d , PROCEDURE w a i t e r r ( V A R t i m e : i n t e g e r ) ; VAR temp:@tcb;empty:boolean; BEGIN l i m i ( 0 ) ; p s v s a v ; p o p l ( q x e c , t e m p , e m p t y ) ; IF empty THEN s y s t e m e r r o r ; b eeper:=beeper+1; p u s h l ( q e r r , t e m p ) ; IF time=0 THEN BEGIN temp@.aim:=time; i n s e r t ( q t m r , t e m p , p r i o r i t y ) END p s v g e t ; rtwp END Program 4.6 W a i t i n g f o r e r r o r s (WAIT.ERR) and w i l l r e t u r n t h e TCB and workspace t o t h e f r e e l i s t . 2. I f however t h e f a u l t was s i m p l y c o r r e c t e d ( e . g . o p e n i n g t h a t f o r g o t t e n v a l v e on t h e c a r b o n d i o x i d e c y l i n d e r ) t h e n i s s u i n g t h e RECOVER command (and RETRY, REDO, or RESTART) w i l l DELETE t h e t a s k from t h e e r r o r and t i m e r q u e u e s , and r e - i n s e r t i t i n t o t h e e x e c u t i o n queue. When t h e t a s k f i n a l l y resumes e x e c u t i o n i t w i l l do so w i t h t h e f i r s t i n s t r u c t i o n a f t e r t h e c a l l t o WAIT.ERR. I t i s up t o t h e t a s k i t s e l f t o t a k e a p p r o p r i a t e r e c o v e r y a c t i o n . 3. When t h e o p e r a t o r f a i l s t o r e s p o n d w i t h i n t h e t i m e out p e r i o d t h e c l o c k u p d a t e t a s k i n i t i a t e s t h e a c t i o n s i n (2) a b o v e . Sec 4.11.3 1 02 4.12 RESOURCE MANAGEMENT Any s y s t e m i n e v i t a b l y s h a r e s i t s r e s o u r c e s amongst t h e v a r i o u s t a s k s . So f a r t h e s y s t e m has been d e s i g n e d t o a l l o c a t e two of t h e s e : t h e c e n t r a l p r o c e s s i n g u n i t and b l o c k s of random a c c e s s memory. T h e r e a r e however a number o f e x t e r n a l r e s o u r c e s w h i c h must not be u s e d s i m u l t a n e o u s l y . 1. The t e l e t y p e and i t s a s s o c i a t e d r o u t i n e s c a n o n l y be u s e d by one t a s k a t a t i m e . Even i f i t was p o s s i b l e t o r e - e n t e r t h e t e l e t y p e XOPs, messages would be c o n f u s i n g l y m i x e d t o g e t h e r . 2. The main vacuum l i n e i s u s e d f o r e v a c u a t i o n , t r a n s f e r of C 0 2 , and f o r p r e s s u r e measurement. O b v i o u s l y c o m p e t i n g t a s k s s h o u l d not be a l l o w e d t o change any o f t h e s e c o n d i t i o n s . 3. The mass s p e c t r o m e t e r l i n e t o t h e i n l e t c o n t r o l l e r must l i k e w i s e be d e d i c a t e d t o one t a s k a t a t i m e i f sample m i x i n g and c o n t a m i n a t i o n a r e t o be a v o i d e d . The p e l t i e r c o o l e r and t h e i n l e t l i n e c o n t r o l l e r can be g r o u p e d i n w i t h t h i s r e s o u r c e . 4. The a n a l o g u e / d i g i t a l c o n v e r t e r s h o u l d not be r e - i n i t i a l i s e d u n t i l i t has d e l i v e r e d a r e q u e s t e d r e s u l t . 4.12.1 Semaphores and t h e C r i t i c a l S e c t i o n I t i s u s u a l t o t e r m th e a r e a of a t a s k t h a t u p d a t e s o r u s e s common r e s o u r c e s as t h e c r i t i c a l s e c t i o n ( C S ) , (Shaw, 1974, pg 59) and many d i f f e r e n t schemes have e v o l v e d t o p r o v i d e t h e p r o t e c t i o n needed. The most g e n e r a l and e a s i l y i m p l e m e n t e d a p p r o a c h , f i r s t d e v e l o p e d by D i j k s t r a (1965, 1968), u s e s two semaphore p r i m i t i v e s t o e n s u r e m u t u a l e x c l u s i o n of t h e c r i t i c a l s e c t i o n . I f S i s a semaphore Sec 4.12.1 103 v a r i a b l e t h e n t h e f o l l o w i n g two o p e r a t i o n s a r e d e f i n e d : 1. V ( S ) : t h i s s i m p l y i n c r e a s e s S by 1 i n a s i n g l e i n d i v i s i b l e a c t i o n ( i . e . no i n t e r r u p t s ) . 2. P(S) : d e c r e m e n t s S by 1 u n l e s s S=0 i n w h i c h c a s e t h e t a s k p r o c e e d s no f u r t h u r u n t i l i t c a n ( i e u n t i l a V ( S ) i s e x e c u t e d by a n o t h e r t a s k ) . I t i s p o s s i b l e t o p r o t e c t an i n d e f i n i t e number o f c r i t i c a l s e c t i o n s u s i n g t h e code i n p r o g r a m 4.7. PROCEDURE s y s t e m VAR m u t e x : i n t e g e r ; BEGIN mutex:=1; • • • PROCEDURE t a s k ; BEGIN • • • • • • P ( m u t e x ) ; c r i t i c a l s e c t i o n i j V ( m u t e x ) ; • • • • • • END • • • { t a s k i } • • * END {system} Program 4.7 U s i n g semaphore p r i m i t i v e s S e c t i o n t o p r o t e c t a C r i t i c a l The i n i t i a l v a l u e o f t h e semaphore v a r i a b l e i s a c t u a l l y a measure of t h e number o f u n i t s of t h e r e s o u r c e t h a t a r e a v a i l a b l e . A l t h o u g h a l l r e s o u r c e s i n our s y s t e m s h o u l d be i n i t i a l i s e d t o one, an i m p o r t a n t e x c e p t i o n c o u l d be t h e s o l e n o i d power s u p p l y . W i t h a bank of s o l e n o i d s c o n s u m i n g a p p r o x i m a t e l y 4 A, t h e n a power s u p p l y c a p a b l e o f s u p p l y i n g Sec 4.12.1 1 04 20 A c o u l d be p r o t e c t e d f r o m o v e r use by i n i t i a l i s i n g a semaphore t o 5. The p r i m i t i v e P(S) i s u s e d e v e r y t i m e a bank of s o l e n o i d s i s a c t i v a t e d ; and V(S) a f t e r t h e y a r e de- a c t i v a t e d . T h i s i s an example of t h e " p r o d u c e r - c o n s u m e r p r o b l e m " t h a t D i j k s t r a ' s semaphores were d e s i g n e d t o s o l v e . The p r i m i t i v e s V(S) and P(S) have been i m p l e m e n t e d f o r t h e sample l i n e o p e r a t i n g s y s t e m a s t h e p r o c e d u r e s RELESE and RESERV r e s p e c t i v e l y , but b e f o r e d e s c r i b i n g t h e s e r o u t i n e s t h e r e i s t h e e v e r p r e s e n t i s s u e o f s t r u c t u r e t o s o l v e . 4.12.2 Semaphore S t r u c t u r e - t h e Semaphore T a b l e (SEMTAB) D i j k s t r a ' s semaphore p r i m i t i v e s a r e c o n c e p t u a l l y s i m p l e (and e l e g a n t ) but i m p l e m e n t i n g them r e q u i r e s t h e f o l l o w i n g i n f o r m a t i o n . 1. A p l a c e t o s t o r e t h e v a l u e of t h e semaphore, o r t h e number of a v a i l a b l e r e s o u r c e u n i t s . 2. The p r i m i t i v e P(S) r e q u i r e s t h a t t h e c a l l i n g t a s k w a i t u n t i l t h e v a l u e of S i s p o s i t i v e . I t i s e a s i e s t t o d e f i n e a l i s t of TCBs t h a t a r e w a i t i n g t o use t h e semaphore's r e s o u r c e . In t h a t c a s e a p l a c e i s needed f o r t h e semaphore w a i t l i s t head p o i n t e r . 3. I t i s a l s o e x t r e m e l y c o n v e n i e n t t o keep t a b s on t h e r e s o u r c e s c u r r e n t l y h e l d by a t a s k . F o r t h i s r e a s o n a word i n t h e t a s k ' s TCB i s a l l o c a t e d f o r r e s o u r c e f l a g s . When a f l a g i s s e t i t s c o r r e s p o n d i n g r e s o u r c e i s i n use by t h e t a s k . A semaphore i s c o n v i e n t l y t h o u g h t o f as a p a i r o f words, t h e f i r s t t h e number o f r e s o u r c e u n i t s a v a i l a b l e , and t h e s e c o n d t h e a d d r e s s of t h e f i r s t TCB on i t s w a i t l i s t . A l l t h e semaphores a r e g r o u p e d t o g e t h e r i n a semaphore t a b l e and Sec 4.12.2 105 t h e p o s i t i o n of a semaphore i n a t a b l e c o r r e s p o n d s t o a b i t i n t h e TCB word a s s i g n e d t o r e s o u r c e f l a g s . In t h i s way semaphores can be r e f e r r e d t o by name when w r i t i n g A s sembly l a n g u a g e p r o g r a m s , y e t c a n a l s o be i n s e r t e d and d e l e t e d from t h e semaphore t a b l e a t w i l l . The a p p r o p r i a t e b i t f l a g i s e a s i l y c a l c u l a t e d f r o m t h e semaphore CALCBIT ( s e e t h e o p e r a t i n g s y s t e m l i s t i n g i n A p p e n d i x I I ) . The P a s c a l s t r u c t u r e f o r t h e semaphore t a b l e i s i n P rogram 4.8. TYPE semaphore= RECORD u n i t s : i n t e g e r ; w a i t l i s t : i n t e g e r ; END; CONSTANT semmax=4; { i n c u r r e n t i m p l e m e n t a t i o n } VAR semtab:ARRAY[1..semmax]OF semaphore; Program 4.8 Semaphore s t r u c t u r e (SEMTAB) 4.12.3 R e s e r v i n g a R e s o u r c e (RESERV) T h i s r o u t i n e i s e n t e r e d by a t a s k w i s h i n g unimpeded use of t h e named r e s o u r c e ( p a s s e d as an argument - t h e a d d r e s s of a s e m a p h o r e ) . The f o l l o w i n g s t e p s a r e e x e c u t e d . (Program 4.9) 1. The number of r e s o u r c e u n i t s i s d e c r e m e n t e d . 2. I f t h e r e s u l t of (1) i s p o s i t i v e or z e r o , t h e n no o t h e r t a s k s a r e u s i n g t h e r e s o u r c e so i t i s p e r m i s s i b l e t o p r o c e e d . The a p p r o p r i a t e r e s o u r c e f l a g i s s e t i n t h e t a s k s TCB and e x e c u t i o n c o n t i n u e s w i t h an RTWP i n s t r u c t i o n . 3. I f however s t e p (1) g e n e r a t e s a n e g a t i v e number o f u n i t s Sec 4.12.3 106 t h e n t h e r e s o u r c e i s u n a v i l a b l e . A f t e r s a v i n g t h e PSV f o r t h e c a l l i n g t a s k i t s TCB i s POPLed f r o m t h e e x e c u t i o n queue t h e n INSERTed i n t o t h e semaphore w a i t queue. The f i r s t t a s k on t h e e x e c u t i o n queue i s t h e n d i s p a t c h e d t o t h e CPU i n t h e u s u a l manner. I t may be u s e f u l t o n o t e h e r e t h a t t h i s scheme d i f f e r s s l i g h t l y from D i j k s t r a ' s i n t h a t t h e number o f r e s o u r c e u n i t s c a n be n e g a t i v e . However t h i s makes no r e a l d i f f e r e n c e t o semaphore o p e r a t i o n and i s sometimes u s e f u l when e x a m i n i n g t h e s t a t e of t h e w a i t l i s t s . The m a g n i t u d e of a n e g a t i v e semaphore i n d i c a t e s t h e number o f t a s k s w a i t i n g t o use t h a t r e s o u r c e . 4.12.4 R e l e a s i n g a R e s o u r c e (RELESE) When a t a s k has f i n i s h e d u s i n g a r e s o u r c e i t s h o u l d be r e l e a s e d f o r use by o t h e r t a s k s u s i n g a BLWP @RELESE i n s r u c t i o n . The p r o c e d u r e i s e q u i v a l e n t t o t h e P(S) p r i m i t i v e e x c e p t t h a t i t c h e c k s t o see i f any t a s k s a r e w a i t i n g t o use t h a t r e s o u r c e . I f t h e y a r e , i t POPLs t h e h i g h e s t p r i o r i t y one from t h e semaphore w a i t queue and INSERTS i t i n t o t h e e x e c u t i o n queue. The h i g h e s t p r i o r i t y t a s k t h e n b e g i n s e x e c u t i n g . The e q u i v a l e n t P a s c a l p r o c e d u r e i n Program 4.9 s h o u l d be s e l f e x p l a n a t o r y . 4.12.5 U s i n g RESERV and RELESE R e s e r v i n g and r e l e a s i n g r e s o u r c e s i s u s u a l l y a m a t t e r of c a l l i n g RESERV, u s i n g t h e r e s o u r c e , t h e n c a l l i n g RELESE when f i n i s h e d ( w i t h t h e a p p r o p r i a t e semaphore a d d r e s s of c o u r s e ) . However when s e v e r a l r e s o u r c e s a r e h e l d by two o r more t a s k s Sec 4.12.5 1 07 c o n c u r r e n t l y i t i s p o s s i b l e t o a r r i v e a t a c i r c u l a r w a i t PROCEDURE r e s e r v ( V A R sa:@semaphore); VAR e m p t y : b o o l e a n ; temp:@tcb; s n u m : i n t e g e r ; BEGIN l i m i ( 0 ) ; s a @ . u n i t s : = s a @ . u n i t s - 1 ; IF s a d . u n i t s . 0 THEN BEGIN p s v s a v ; p o p l ( q x e c , t e m p , e m p t y ) ; IF empty THEN s y s t e m e r r o r ; i n s e r t ( s a @ . w a i t l i s t , t e m p , p r i o r i t y ) ; p s v g e t ; r t w p END ELSE BEGIN c a l c b i t ( s a , s n u m ) ; q x e c @ . r s c [ s n u m ] : = t r u e ; rtwp END END Program 4.8a R e s e r v i n g r e s o u r c e s (RESERV) c o n d i t i o n known a f f e c t i o n a t e l y a s d e a d l o c k . A s i m p l e c a s e of t h i s f o r two t a s k s i s shown i n f i g u r e 4.3 where t a s k A h o l d s t h e main l i n e and r e q u i r e s t h e t e l e t y p e , w h i l e t a s k B h o l d s t h e t e l e t y p e b ut c a n n o t r e l e a s e i t u n t i l i t g e t s t h e main l i n e . C l e a r l y t h i s c o n d i t i o n i s i m p o s s i b l e t o e x i t , hence t h e name d e a d l o c k . Not o n l y i s d e a d l o c k d i s a s t r o u s , but i t i s a l s o common. Many methods have e v o l v e d t o d e t e c t and p r e v e n t i t (Shaw, 1978, C h a p t e r 8) but t h e most p e r t i n e n t i n our c a s e i s f o r t h e programmer t o o r d e r r e s o u r c e c a l l s so t h a t t h e c o n d i t i o n n e v e r o c c u r s . In t h e example shown i n f i g u r e 4.3 d e a d l o c k would be p r e v e n t e d i f b o t h t a s k s a l w a y s a s k e d f o r t h e Sec 4.12.5 108 m a i n l i n e f i r s t . S i m i l a r l y i f a c r i t i c a l s e c t i o n r e q u i r e s PROCEDURE r e l e s e ( V A R sa:@semaphore); VAR temp:@tcb; e m p t y : b o o l e a n ; s n u m : i n t e g e r BEGIN l i m i ( 0 ) ; c a l c b i t ( s a , s n u m ) ; q x e c @ . r s c [ s n u m ] : = f a l s e ; { r e s e t r e s o u r c e f l a g } s a @ . u n i t s : = s a @ . u n i t s + 1 ; IF s a @ . u n i t s . 0 THEN BEGIN p o p l ( s a @ . w a i t l i s t , t e m p , e m p t y ) ; IF empty THEN s y s t e m e r r o r ; t e m p . r s c [ s n u m ] : = t r u e ; { s e t r e s o u r c e f l a g } p s v s a v ; i n s e r t ( q x e c , t e m p , p r i o r i t y ) p s v g e t ; rtwp END ELSE rtwp END Program 4.9 R e l e a s i n g r e s o u r c e s (RELESE) s e v e r a l r e s o u r c e s a t once t h e n d e a d l o c k i s a v o i d e d by r e q u e s t i n g r e s o u r c e s i n t h e sample l i n e s y s t e m i n t h e f o l l o w i n g o r d e r . 1. The mass s p e c t r o m e t e r l i n e . (S.MSL) 2. The main l i n e . (S.MNL) 3. The t e l e t y p e . (S.TTY) 4. The a n a l o g u e / d i g i t a l c o n v e r t e r . (S.ADC) I m p o r t a n t l y t h e y must be RELESEd i n t h e r e v e r s e o r d e r . Sec 4.12.5 109 4.13 WAITING FOR INTERRUPTS (WAIT.INT) TASK A RESERV main line open vacuum pump valve WAIT 10 minutes RESERV teletype Task A is blocked until task B RELESEs the teletype. task inactive task active •execute task B• •10 minutes later. F i g u r e 4.4 An Example of D e a d l o c k TASK B RESERV teletype RESERV main line Task £ is blocked until task A RELESEs the main line. D e v i c e s i n t h e r e a l w o r l d a r e u s u a l l y v e r y slow t o r e s p o n d t o t h e CPU. In some c a s e s i n t e r r u p t s a r e c o m p l e t e l y a s y n c h r o n o u s and no p r e d i c t i o n c an be made ab o u t t h e i r a r r i v a l . To a v o i d u n n e c e s s a r y use of t h e CPU under t h e s e c o n d i t i o n s i t i s n e c e s s a r y t o d e f i n e p o i n t e r s on w h i c h t a s k TCBs c a n be p l a c e d w h i l e w a i t i n g f o r an i n t e r r u p t from a p a r t i c u l a r s o u r c e . The p r o c e d u r e i n p r o g r a m 4.10 i s b a s i c a l l y v e r y s t r a i g h t f o r w a r d . The c a l l i n g t a s k i s removed from t h e e x e c u t i o n queue, i s p l a c e d on t h e i n t e r r u p t p o i n t e r Sec 4.13 110 s p e c i f i e d , and t h e n e x t h i g h e s t p r i o r i t y t a s k i s e x e c u t e d . A t p r e s e n t i n t e r r u p t p o i n t e r s e x i s t f o r t h r e e s o u r c e s : t h e i n l e t c o n t r o l l e r ( I N T . I N L ) , a n a l o g u e - t o - d i g i t a l c o n v e r t e r (INT.ADC) and t h e c l o c k t i m e r ( I N T . C L K ) . PROCEDURE w a i t i n t ( V A R i n t p t r : @ t c b ) ; VAR temp:@tcb; e m p t y : b o o l e a n ; BEGIN l i m i ( 0 ) ; p s v s a v ; p o p l ( q x e c , t e m p , e m p t y ) ; IF empty THEN s y s t e r n e r r o r ; i n t p t r : = t e m p ; p s v g e t ; rtwp END Program 4.10 W a i t i n g f o r I n t e r r u p t s (WAIT.INT) Removing TCBs from t h e i n t e r r u p t p o i n t e r s i s a c t u a l l y a f u n c t i o n of t h e a p p r o p r i a t e i n t e r r u p t s e r v i c e r o u t i n e (ISR) but i n g e n e r a l once t h e s o u r c e of t h e i n t e r r u p t i s d e t e r m i n e d i t s p o i n t e r i s c h e c k e d f o r t h e p r e s e n c e of a w a i t i n g t a s k ( t h e p o i n t e r i s n o n - z e r o ) . I f a t a s k i s w a i t i n g t h e n i t i s i n s e r t e d i n t h e e x e c u t i o n queue and t h e h i g h e s t p r i o r i t y t a s k i s d i s p a t c h e d t o t h e CPU. 4.14 SERVICING INTERRUPTS The TMS9980 has s i x l e v e l s o r p r i o r i t i e s of i n t e r r u p t s o f w h i c h f o u r a r e i m m e d i a t e l y a c c e s s i b l e t o t h e u s e r . E a c h l e v e l has a d e d i c a t e d v e c t o r i n RAM i n w h i c h i s s p e c i f i e d t h e workspace and e x e c u t i o n a d d r e s s of t h e i n t e r r u p t s e r v i c e Sec 4.14 111 r o u t i n e . An i n t e r r u p t e f f e c t i v e l y c a u s e s a BLWP t o be e x e c u t e d f r o m t h i s v e c t o r a f t e r t h e c u r r e n t i n s t r u c t i o n i s c o m p l e t e d . I t a l s o f o r c e s e x e c u t i o n of t h e f i r s t i n s t r u c t i o n i n t h e ISR e n a b l i n g t h e i n t e r r u p t mask t o be s e t , and hence p r e v e n t i n g p r e - e m p t i o n o f t h e r o u t i n e . The t a b l e i s shown i n more d e t a i l i n t h e RAM d e f i n i t i o n s e c t i o n o f t h e o p e r a t i n g l i s t i n g ( A p pendix I I ) , and i n t h e U n i b u g U s e r s Manual (T e x a s I n s t r u m e n t s , 1978). 4.15 SERVICING CMOS BUS INTERRUPTS (SRVBUS) I n t e r r u p t s a r r i v i n g f r o m t h e CMOS bus c a n have one of two s o u r c e s . 1. A sample r e q u e s t from t h e i n l e t l i n e c o n t r o l l e r . 2. As a r e s u l t of a change i n t h e s t a t e of a d o o r s w i t c h or r e l a y power s u p p l y on a r a c k . The r o u t i n e f i r s t t e s t s f o r t h e i n l e t l i n e c o n t r o l l e r i n t e r r u p t . I f t h i s was t h e s o u r c e t h e n i t w i l l queue t h e t a s k w a i t i n g on i t s w a i t p o i n t e r ( I N T . I N L ) . When t h i s p o i n t e r i s empty n o t h i n g e l s e i s done and t h e pr e - e m p t e d t a s k r e g a i n s t h e CPU a f t e r an RTWP i n s t r u c t i o n i s e x e c u t e d . I f t h e i n l e t l i n e was not t h e i n t e r r u p t s o u r c e e a c h of th e s i x t e e n r a c k s t a t u s words a r e t e s t e d i n t u r n . The f i r s t r a c k f o u n d w i t h i t s i n t e r r u p t f l a g s e t w i l l queue a t a s k t h a t l o g s t h e e v e n t on t h e t e l e t y p e (TSKLOG). T h i s t a s k g e n e r a t e s a message i n d i c a t i n g t h e r a c k number and i t s s t a t u s word t h e n F INISHes ( s e e A p p e n d i x I I ) . A f t e r i n s e r t i n g t h e l o g t a s k i n t o t h e e x e c u t i o n queue t h e u s u a l d i s p a t c h p r o c e d u r e i s Sec 4.15 1 1 2 e x e c u t e d . Note t h a t t h i s scheme i s not t h e b e s t way t o h a n d l e s e q u e n t i a l i n t e r r u p t s b e c a u s e of t h e r e t u r n as soon as one r a c k has been f o u n d c a u s i n g t h e c o n d i t i o n . S e q u e n t i a l i n t e r r u p t s a r e of s u c h low p r o b a b i l i t y however t h a t t h e r e i s no r e a l a d v a n t a g e i n d e s i g n i n g f o r them. PROCEDURE s r v b u s VAR rnum:0..15; new:@tcb; BEGIN l i m i ( 0 ) ; IF i n t e r r u p t ( m a s t e r ) THEN BEGIN p s v s a v ; i n s e r t ( q x e c , i n t i n l , p r i o r i t y ) ; p s v g e t ; rtwp END ELSE FOR rnum:=0 TO 15 DO IN IF i n t e r r u p t ( r a c k [ r n u m ] ) THEN BEGIN c r e a t e l o g t a s k ( n e w , r n u m ) ; p s v s a v ; i n s e r t ( q x e c , n e w p r i o r i t y ) ; p s v g e t ; rtwp END rtwp END Program 4.11 CMOS Bus i n t e r r u p t s e r v i c e r o u t i n e (SRVBUS) 4.16 USING THE ANALOGUE-TQ-DIGITAL CONVERTER T h i s i s most c o n v e n i e n t l y a c c e s s e d by e x e c u t i n g t h e i n s t r u c t i o n BL dADCGET ( s e e A p p e n d i x I I f o r argument s p e c i f i c a t i o n s ) . T h i s r o u t i n e RESERVs t h e t e l e t y p e , Sec 4.16 1 13 i n i t i a l i s e s i t s c h a n n e l number ( f r o m 0 t o 15), w a i t s f o r an ADC i n t e r r u p t , r e a d s t h e ADC v a l u e f r o m t h e o u t p u t l a t c h e s ( r e s e t t i n g t h e i n t e r r u p t a t t h e same t i m e ) and s t o r e s i t i n t h e w o r kspace of t h e w a i t i n g t a s k . When t h e w a i t i n g t a s k resumes e x e c u t i o n i t RELESEs t h e ADC f o r o t h e r u s e r s . B o t h t h e ADCGET and t h e i n t e r r u p t s e r v i c e r o u t i n e a r e l i s t e d i n Program 4.12. One f u r t h u r p o i n t i s t h a t t h e v a l u e i n i t i a l l y e x t r a c t e d from t h e ADC c o n t a i n s two f l a g s i n d i c a t i n g p o l a r i t y and o v e r f l o w ( I n t e r s i l , 1981). ADCGET t e s t s t h e s e and a l t e r s t h e v a l u e t o g i v e a c o r r e c t 2's complement i n t e g e r , and f l a g s an o v e r f l o w i f i t o c c u r r e d . 4.17 CHANGING RACK REGISTERS The r a c k hardware r e g i s t e r s have been d e s i g n e d t o r e s e m b l e p a r t of memory, and i t i s q u i t e f e a s i b l e t o s e t them by w r i t i n g a word t o t h e a p p r o p r i a t e a d d r e s s . However i n t h e i n t e r e s t s of hardware s i m p l i c i t y i t i s n o t p o s s i b l e t o r e a d from t h e s e r e g i s t e r s and many c o n v e n i e n t machine o p e r a t i o n s w i l l t h e r e f o r e f u n c t i o n i n c o r r e c t l y (SOC, SZB, s h i f t s and a r i t h m e t i c o p e r a t i o n s ) . As w e l l , i t i s p o s s i b l e t o l o s e t h e c o n t e n t s of t h e s e r e g i s t e r s i n t h e e v e n t of a power f a i l u r e on a r a c k and i t was t h e r e f o r e f e l t t h a t an a d v a n t a g e c o u l d be g a i n e d by h o l d i n g an image of t h e r a c k r e g i s t e r s somewhere i n RAM. R e a l i s i n g t h a t t h e image c o u l d be a l t e r e d f a r more c o n v e n i e n t l y t h a n t h e r e g i s t e r s t h e m s e l v e s , a s t r u c t u r e and a p r o c e s s were d e v i s e d t o c o n t i n u a l l y r e f r e s h t h e r a c k r e g i s t e r s from RAM. Sec 4.17 4.17.1 The Rack R e f r e s h T a b l e (RCKTAB) PROCEDURE a d c g e t ( V A R c h a n n e l : 0 . . 1 5 ; v a l u e : i n t e g e r ; o v e r f l o : b o o l e a n ) BEGIN d e v a d c : = c h a n n e l { s e t c h a n n e l number} r e s e r v ( s a d c ) ; w a i t i n t ( i n t a d c ) ; r e l e s e ( s a d c ) ; c o r r e c t ( v a l u e ) { c o r r e c t s i g n and t e s t f o r o v e r f l o w } END PROCEDURE s r v a d c BEGIN l i m i ( 0 ) ; IF i n t a d c = N I L THEN s y s t e m e r r o r v a l u e : = d e v a d c ; {get adc v a l u e } p s v s a v ; i n s e r t ( q x e c , i n t a d c , p r i o r i t y ) ; i n t a d c : = N I L ; p s v g e t ; r t w p END Program 4.12 G e t t i n g ADC v a l u e s 1 (ADCGET & SRVADC) The r a c k r e f r e s h t a b l e i s a b l o c k o f s i x t e e n words i n RAM. E a c h word h o l d s t h e a d d r e s s of ( o r " p o i n t s t o ") an image of t h e r a c k r e g i s t e r s . I have termed t h i s t h e r a c k s t a t e v e c t o r (RSV) . I f a t a b l e e n t r y i s z e r o t h e n t h e c o r r e s p o n d i n g r a c k i s i n a c t i v e . The RSV can be c o n v e n i e n t l y h e l d i n t h e w o r kspace of t h e t a s k u s i n g t h e r a c k . The p o i n t e r t o t h e RSV i s i n i t i a l i s e d by t h e t a s k when i t f i r s t e x e c u t e s , and i s c l e a r e d as i t F I N I S H e s . 4.17.2 The LED T a b l e (LEDTAB) E i g h t LEDs a r e p r o v i d e d i n a c o n s p i c u o u s l o c a t i o n on t h e r a c k f r o n t p a n e l and t h e s e can be s e t by w r i t i n g ones t o t h e a p p r o p r i a t e b i t s of t h e r a c k c o n t r o l word. As w e l l a Sec 4.17.2 1 15 f a c i l i t y t o f l a s h LEDs a t t h e same r a t e a t w h i c h t h e a u d i b l e a l a r m b e e p s has been p r o v i d e d by s e t t i n g b i t s i n t h e a p p r o p r i a t e e n t r y of t h e LED t a b l e . T h i s i s a b l o c k o f 16 b y t e s (8 b i t s each) of RAM, one b y t e b e i n g d e d i c a t e d t o e a c h r a c k . 4.17.3 R e f r e s h i n g t h e Racks (SRVDSP) E v e r y 1 ms t h e d i s p l a y t i m e r p r e -empts t h e c u r r e n t l y e x e c u t i n g t a s k and e x e c u t e s i t s s e r v i c e r o u t i n e . The d i s p l a y s e r v i c e r o u t i n e c o n v e n i e n t l y h a n d l e s a number of j o b s and o p e r a t e s i n a s e n s e t h a t i s i n d e p e n d e n t of t h e o p e r a t i n g s y s t e m . I t has i t s own d e d i c a t e d w o r k s p a c e , has no TCB, and a l t e r s none of t h e s y s t e m s t r u c t u r e , but p e r f o r m s t h e f o l l o w i n g j o b s . 1. Sounds t h e a u d i b l e a l a r m a t t h e r a t e d e t e r m i n e d by " b e e p e r " . 2. F l a s h e s t h e LEDs marked i n t h e LED t a b l e , a t a r a t e d e pendent on " b e e p e r " . Note however t h a t LEDs can a l w a y s be made t o f l a s h even i f t h e a u d i b l e a l a r m i s s i l e n t . 3. R e f r e s h e s one r a c k e v e r y 1 ms f r o m t h e c o n t e n t s of t h e r a c k s t a t e v e c t o r . I f t h e r a c k t a b l e e n t r y i s z e r o i t c l e a r s t h e r a c k r e g i s t e r . 4. B e s i d e s t h e r a c k r e g i s t e r s , t h e m a s t e r c o n t r o l word i s r e f r e s h e d e v e r y 1 ms from i t s c o r r e s p o n d i n g RAM image, as w e l l . The scheme has p r o v e n e x t r e m e l y c o n v e n i e n t b e c a u s e of t h e e a s e i t a l l o w s f o r a l t e r i n g r a c k r e g i s t e r s . The o t h e r a p p r o a c h would be t o w r i t e r o u t i n e s s p e c i f i c a l l y f o r t h i s p upose, b u t by t h e t i m e code and argument l i s t s a r e c o n s i d e r e d s u c h r o u t i n e s would not o n l y be u n e c o n o m i c a l i n Sec 4.17.3 1 1 6 terms o f EPROM s p a c e , b ut a l s o f o r t h e i r awkwardness. PROCEDURE f i n i s h VAR f i n , n e w : @ t c b ; rnum:0..15; empty,nameunknown:boolean; BEGIN l i m i ( 0 ) ; p o p l ( q x e c , f i n , e m p t y ) ; I F empty THEN s y s t e m e r r o r ; d i s o v ( q t s k , f in,name,f in@.name,nameunknown); rnum:=0 IF nameunknown THEN s y s t e m e r r o r ; WHILE a n y f l a g s e t ( f i n @ . r s c ) DO BEGIN IF f i n @ . r s c [ r n u m ] THEN BEGIN s e m t a b [ r n u m . u n i t s : = s e m t a b [ r n u m ] . u n i t s + 1 ; IF s e m t a b [ r n u m ] . u n i t s . 0 THEN BEGIN p o p l ( s e m t a b f r n u m ] . w a i t l i s t , n e w , e m p t y ) ; IF empty THEN s y s t e m e r r o r ; n e w @ . r s c [ r n u m ] : = t r u e ; i n s e r t ( q x e c , n e w , p r i o r i t y ) ; END rnum:=rnum+1 END p s v g e t ; rtwp END N o t e s : 1. " A n y f l a g s e t " i s a b o o l e a n f u n c t i o n . I t r e t u r n s a v a l u e of t r u e i f i t f i n d s any t r u e f l a g s i n t h e p a c k e d a r r a y i n t h e argument l i s t . P rogram 4.13 F i n i s h i n g T a s k s (FINISH) D e t a i l e d o p e r a t i o n of SRVDSP i s b e s t u n d e r s t o o d by r e f e r r i n g t o t h e l i s t i n g of t h e o p e r a t i n g s y s t e m ( A p p e n d i x I I ) . I t i s a s t r a i g h t f o r w a r d a p p l i c a t i o n o f v a r i o u s f l a g s t o p u l s e t h e p i e z o - e l e c t r i c t r a n s d u c e r , and c o n t i n u o u s l y i n c r e m e n t e d i n d e x e s t o e n t e r t h e r a c k and LED t a b l e s . Sec 4.17.3 1 17 4.18 FINISHING TASKS (FINISH) When a t a s k has f i n i s h e d i t must be a b l e t o i n f o r m t h e o p e r a t i n g s y s t e m o f t h e f a c t . I t s r e s o u r c e s can t h e n be d e a l l o c a t e d , i t s TCB and w o r k s p a c e r e t u r n e d t o t h e f r e e l i s t , and t h e CPU a s s i g n e d t o t h e n e x t p e n d i n g t a s k . T h e s e o p e r a t i o n s a r e a l l a c c o m p l i s h e d by e x e c u t i n g a BLWP @FINISH i n s t r u c t i o n ( P rogram 4.13). Sec 4.18 CHAPTER V. THE OPERATOR INTERFACE 5.1 A DEFINITION Our sample p r e p a r a t i o n l i n e has been p r e s e n t e d as an a l m o s t s e l f - c o n t a i n e d s y s t e m , c a p a b l e o f o p e r a t i n g i n an u n a t t e n d e d mode, w i t h a minimum of human i n t e r v e n t i o n . Under n o r m a l c o n d i t i o n s t h i s i s t r u e , but t h e r e a r e many i n s t a n c e s where t h e human o p e r a t o r must p l a y a more s i g n i f i c a n t r o l e . T h e r e a r e , f o r example, t e s t i n g p r o c e d u r e s t h a t c a n be i n t r o d u c e d a t t h e o p e r a t o r ' s d i s c r e t i o n , and i t i s sometimes n e c e s s a r y t o a b o r t t a s k s , e i t h e r b e c a u s e t h e y have been i n t r o d u c e d i n a d v e r t e n t l y , or b e c a u s e t h e y a r e no l o n g e r n e e ded. O v e r r i d i n g manual c o n t r o l i s v i t a l , and may a l l o w t h e o p e r a t o r t o a v o i d a r e c u r r e n t e r r o r by m a n u a l l y s t e p p i n g t h r o u g h t h e t r o u b l e s o m e p r o c e d u r e . In s u c h c a s e s i t i s u s e f u l t o p r o v i d e a number of e n t r y p o i n t s t o t h e p r e p a r a t i o n a l g o r i t h m , and t o a l l o w t h e o p e r a t o r t h e power of c o n t i n u i n g p r o c e s s i n g a t any one o f them. Manual o v e r r i d e s a l s o p e r m i t new p r o c e d u r e s t o be t e s t e d and r e f i n e d b e f o r e c o m m i t t i n g them t o u n a t t e n d e d o p e r a t i o n . The sample l i n e t h e r e f o r e r e q u i r e s a s o p h i s t i c a t e d c h a n n e l o f c o m m u n i c a t i o n between i t s c o n t r o l l e r and t h e human o p e r a t o r . U n f o r t u n a t e l y , b o t h p a r t i c i p a n t s speak d i f f e r e n t l a n g u a g e s , and i t i s n e c e s s a r y t o b r i d g e t h e gap w i t h b o t h hardware d e v i c e s , and s o f t w a r e p r o t o c o l s . T h i s i s t h e o p e r a t o r i n t e r f a c e . Sec 5.1 119 5.2 IDEAS T h e r e i s much c o n j e c t u r e as t o t h e form o f any o p e r a t o r i n t e r f a c e , but i t i s h a r d n o t t o be i m p r e s s e d w i t h t h e i d e a s i n X e r o x ' s S t a r I n f o r m a t i o n S ystem ( S m i t h , I r b y , e t . a l . , 1 9 8 2 ) . A v e r y u s e f u l i n t e r f a c e c o u l d be c o n s t r u c t e d i f t h e Xerox p r o c e d u r e s were a d a p t e d f o r our s y s t e m . F o r example, manual c o n t r o l o f a r a c k would be t h r o u g h m a n i p u l a t i o n o f i t s s c h e m a t i c d i a g r a m as d i s p l a y e d on a g r a p h i c s t e r m i n a l . S o l e n o i d s c o u l d be s e l e c t e d by p o s i t i o n i n g a c u r s o r o v e r t h e a p p r o p r i a t e s o l e n o i d i n t h e s c h e m a t i c , and c o u l d be o p e r a t e d by p r e s s i n g a b u t t o n on t h e c u r s o r p o s i t i o n i n g d e v i c e (commonly c a l l e d " t h e mouse"). Such a s c e n a r i o e n j o y s t h e d i r e c t n e s s and r e a d i b i l i t y o f c u s t o m i s e d "mimic" p a n e l s , but i n t h e f l e x i b i l i t y of a s o f t w a r e e n v i r o n m e n t . I t i s h a r d t o s e t t l e f o r a n y t h i n g l e s s . 5.3 PRACTICALITIES The o p e r a t o r i n t e r f a c e s u g g e s t e d above r e q u i r e s e x p e n s i v e hardware d e v i c e s , and would need many programmer-months t o b r i n g o n - l i n e . T h e r e i s a l s o a d e f i n i t e need f o r s i m i l i a r i n t e r f a c e s on t h e i n l e t l i n e , t h e mass s p e c t r o m e t e r , and even t h e m e a s u r i n g s y s t e m . Such d u p l i c a t i o n i s not o n l y e x p e n s i v e , but i s l i k e l y t o be i n t i m i d a t i n g from t h e o p e r a t o r ' s p o i n t of v i e w . I n s t e a d , a c e n t r a l i s e d i n t e r f a c e i s r e q u i r e d , and a more g e n e r a l i s e d s e t o f s o f t w a r e t o o l s must be w r i t t e n t o run i t . At t h e hardware l e v e l a c o m p a t i b l e s e t o f i n t e r f a c e s and p r o t o c o l s must be d e f i n e d t o l i n k a l l components of t h e c o m p l e t e oxygen i s o t o p e a n a l y s i s s y s t e m . Such an u n d e r t a k i n g r e q u i r e s a c o m p l e t e r e - Sec 5.3 1 20 a p p r a i s a l and r e - o r g a n i s a t i o n of t h e s y s t e m , and i s o b v i o u s l y w e l l beyond t h e s c o p e o f t h i s t h e s i s . In any c a s e , t h e sample p r e p a r a t i o n l i n e has been d e s i g n e d w i t h an eye t o w a r d s i t s use i n o t h e r l a b o r a t o r i e s , and w i t h o t h e r mass s p e c t r o m e t e r s . To a i d i n t h e s e e n d s , c o m m u n i c a t i o n w i t h t h e h o s t s y s t e m has been kept d e l i b e r a t e l y s i m p l e . Under s u c h c o n d i t i o n s , t h e o p e r a t o r i n t e r f a c e must be p a r t and p a r c e l of t h e sample l i n e i t s e l f , and c a n n o t r e l y on t h e e x i s t e n c e of a n o t h e r m a c h i n e . F i n a l l y , i t must be p o i n t e d out t h a t t h e t a s k o r i e n t e d n a t u r e of t h e sample l i n e o p e r a t i n g s y s t e m a l l o w s d i f f e r e n t o p e r a t o r i n t e r f a c e s t o be u s e d i n d i f f e r e n t s i t u a t i o n s . The one d e s c r i b e d i n t h e f o l l o w i n g p a r a g r a p h s i s u n i v e r s a l l y u s e f u l f o r a s t a n d - a l o n e s y s t e m , but may be r e p l a c e d i f , f o r example, t h e u s e r s would r a t h e r h a n d l e t h e human end from a n o t h e r m a c h i n e . 5.4 DESIGNING THE INTERFACE 5.4.1 C h o o s i n g I n p u t and O u t p u t D e v i c e s An o p e r a t o r i n t e r f a c e r e l i e s h e a v i l y upon t h e d e v i c e s t h a t t r a n s f e r i n f o r m a t i o n between t h e human and t h e m a c h i n e . Those e m p l o y i n g v i s u a l g r a p h i c s p r o b a b l y r e s u l t i n t h e c l e a r e s t and f r i e n d l i e s t c o m m u n i c a t i o n , but as p o i n t e d out e a r l i e r , o t h e r c o n s i d e r a t i o n s do not make t h i s c u r r e n t l y p r a c t i c a l . A v i a b l e a l t e r n a t i v e i s t h e a n t i q u e , but s t i l l u s e f u l , t e l e t y p e . The f a m i l i a r l a y o u t of i t s s t a n d a r d t y p e w r i t e r k e y b o a r d s h o u l d p r o v e u n i n t i m i d a t i n g t o most o p e r a t o r s , and t h e f l e x i b i l i t y t o i n t e r p r e t k e y s t r o k e s i n s o f t w a r e a l l o w s t h e Sec 5.4.1 121 programmer t o w r i t e n a t u r a l - f e e l i n g command l a n g u a g e s . F u r t h e r m o r e , e v e r y t e l e t y p e i s e q u i p p e d w i t h a p r i n t head t h a t c a n be made t o s e r v e a d u a l p u r p o s e . By e c h o i n g k e y s t r o k e s on t h e p r i n t e r , a d e g r e e o f f e e d b a c k i s p r o v i d e d t h a t c a n o n l y enhance t h e c o n f i d e n c e of t h e o p e r a t o r i n h i s a b i l i t y t o c o n t r o l t h e s y s t e m . W i t h s u i t a b l e s o f t w a r e , e r r o r s i n a command s e n t e n c e c an be seen and c o r r e c t e d b e f o r e s u b m i t t i n g i t t o t h e s y s t e m . The o t h e r p u r p o s e i s t o t y p e messages o r i g i n a t i n g f r o m t h e s y s t e m . T h e s e m i g h t be i n immediate r e s p o n s e t o some i n p u t , or c o u l d be r e p o r t s i s s u e d some t i m e l a t e r , m a r k i n g p r o g r e s s o r e r r o r s d u r i n g p r o c e s s i n g . The n e c e s s i t y of a permanent p r i n t e d r e c o r d c a n n o t be o v e r e m p h a s i s e d . D u r i n g u n a t t e n d e d o p e r a t i o n , e r r o r , t e s t , and p r o g r e s s r e p o r t s can be p r i n t e d and a v a i l a b l e f o r l a t e r e x a m i n a t i o n . When combined w i t h t h e e c h o e d k e y b o a r d i n p u t , s u c h a r e c o r d p r o v i d e s v a l u a b l e d a t a , n ot o n l y f o r t h e d e t e c t i o n and c o r r e c t i o n of e r r o r s , but t o g u i d e f u t u r e s y s t e m d e v e l o p m e n t . A more modern, v i d e o t y p e , d i s p l a y c o u l d be u s e d t o c o n t r o l t h e sample l i n e but i t would be n e c e s s a r y t o p r o v i d e a p r i n t e r f o r permanent r e c o r d s . On t h e whole, a t e l e t y p e i s t h e l e a s t e x p e n s i v e of t h e a v a i l a b l e o p t i o n s , and i s t h e e a s i e s t t o implement. I t s c h o i c e was made e a s i e r , i n t h i s c a s e , by t h e a v a i l a b i l i t y o f one i n our l a b o r a t o r y , of t h e e x i s t e n c e o f a s u i t a b l e i n t e r f a c e on t h e m i c r o p r o c e s s o r b o a r d , and o f t h e a b i l i t y t o a c c e s s i n p u t and o u t p u t r o u t i n e s a l r e a d y r e s i d e n t w i t h i n t h e UNIBUG m o n i t o r program. In a d d i t i o n t o t h e t e l e t y p e , two o t h e r forms of o u t p u t a r e imp l e m e n t e d t o a t t r a c t t h e o p e r a t o r s a t t e n t i o n . E i g h t l i g h t Sec 5.4.1 1 22 e m i t t i n g d i o d e s a r e mounted on t h e f r o n t p a n e l o f t h e p r o t o t y p e r a c k . T h e s e can be programmed t o l i g h t , o r f l a s h , i n any s e q u e n c e , and g i v e an i n s t a n t v i s u a l i n d i c a t i o n of t h e r a c k s t a t u s . S i m i l a r l y a s m a l l p i e z o - e l e c t r i c sound d i s k i s mounted on t h e p r o c e s s o r b o a r d , and has been u t i l i s e d a s a 500Hz a u d i b l e a l a r m . Whenever e r r o r s r e q u i r i n g o p e r a t o r a t t e n t i o n o c c u r , t h e a l a r m " b e e p s " u n t i l t h e o p e r a t o r r e s p o n d s . The r a t e a t w h i c h t h e a l a r m beeps i n c r e a s e s w i t h t h e number o f o u t s t a n d i n g e r r o r s , and g i v e s an i m p r e s s i o n of u r g e n c y a s t h e y b u i l d up. 5.4.2 D e v e l o p i n g a " N a t u r a l " Command Language When f a c e d w i t h t h e t a s k of p r o v i d i n g u n s k i l l e d o p e r a t o r c o m m u n i c a t i o n t h r o u g h a t y p e w r i t e r k e y b o a r d t h e r e a r e two b a s i c a p p r o a c h e s . The f i r s t i s commonly known a s a m e n u - d r i v e n command mode, and i t has t h e a d v a n t a g e of b e i n g s e l f - d o c u m e n t i n g . The u s e r i s p r e s e n t e d w i t h a l i s t of numbered c h o i c e s ( t h e menu) and, a f t e r r e a d i n g t h r o u g h i t , can s e l e c t one of them by e n t e r i n g i t s number on t h e k e y b o a r d . However, t h e method becomes cumbersome when a slow o u t p u t d e v i c e , . s u c h as a t e l e t y p e , must be u s e d t o d i s p l a y t h e menu. T h i s i s e s p e c i a l l y t r u e of s y s t e m s r e q u i r i n g l a r g e , and c o m p l i c a t e d , menus. The s e c o n d a p p r o a c h i s t h e r e f o r e more p r a c t i c a l f o r our p u r p o s e s . I t r e q u i r e s t h e programmer t o d e f i n e a command l a n g u a g e u s i n g a s e t of command words ( t h e v o c a b u l a r y ) , and a s e t o f r u l e s f o r c o m b i n i n g them (a grammar). System o p e r a t i o n s can t h e n be i n i t i a t e d by e n t e r i n g command s e n t e n c e s a t t h e k e y b o a r d . U n f o r t u n a t e l y t h e scheme i s n o t s e l f - d o c u m e n t i n g , and t h e Sec 5.4.2 1 23 programmer must p r o v i d e c l e a r d o c u m e n t a t i o n manuals t h a t w i l l e n a b l e a n a i v e u s e r t o q u i c k l y l e a r n t h e l a n g u a g e . T h i s w i l l be a l e s s f o r m i d a b l e t a s k f o r o p e r a t o r and programmer a l i k e i f t h e command l a n g u a g e a p p e a r s n a t u r a l o r i f , f o r most o f us, i t i s s i m i l i a r t o w r i t t e n E n g l i s h . A good d e a l o f work has been done on f r o n t - e n d n a t u r a l l a n g u a g e p r o c e s s o r s . The most s o p h i s t i c a t e d p r o g r a m s o p e r a t e i n s e v e r a l s t a g e s b e g i n n i n g w i t h t h e i n p u t of a s e n t e n c e from t h e o p e r a t o r . A f t e r some p r e p r o c e s s i n g t h e s e n t e n c e i s b r o k e n up i n t o words and t h e n s u b m i t t e d t o a p a r s e r . The p a r s e r u s e s g r a m m a t i c a l r u l e s t o b r e a k t h e s e n t e n c e i n t o i t s s t r u c t u r a l u n i t s ( e . g . s u b j e c t , v e r b , o b j e c t ) , w h i c h a r e t h e n u s e d a s t e m p l a t e s i n t h e n e x t s t a g e t o c o n s t r u c t s u b r o u t i n e s r e l a t e d t o t h e meaning o f t h e s e n t e n c e . F i n a l l y , t h e s u b r o u t i n e s a r e e x e c u t e d t o p e r f o r m t h e i n t e n d e d a c t i o n s . Such programming p r i m a r i l y t a k e s p l a c e w i t h i n t h e a r e n a of a r t i f i c i a l i n t e l l i g e n c e , but has i n c r e a s i n g a p p l i c a b i l i t y f o r d a t a b a s e s , e l e c t r o n i c o f f i c e s , and t e a c h i n g s y s t e m s . The most s t r i k i n g example must be T e r r y W i n o g r a d ' s SHRDLU program ( W i n o g r a d , 1 9 7 2 ) . I t m a i n t a i n s d i a l o g u e w i t h a s i m u l a t e d r o b o t , moving o b j e c t s a r o u n d i n t h e s i m u l a t e d e n v i r o n m e n t of i t s " b l o c k s w o r l d " . Such programs a r e f a r t o o complex, and l e n g t h y , t o be r e a l i s e d on a s m a l l m i c r o p r o c e s s o r , b u t t h e y d i d grow from s i m p l e r t h i n g s . In p a r t i c u l a r an e a r l i e r p r o g r am named E L I Z A (Weizenbaum, 1965), g i v e s an a m a z i n g i m p r e s s i o n o f i n t e l l i g e n c e f o r s o m e t h i n g t h a t i s t o t a l l y i d i o t i c . E L I Z A r e l i e s on a p a t t e r n m a t c h e r t o r e c o g n i s e c e r t a i n c l e v e r l y c h o o s e n keywords. The keywords t r i g g e r a s i m p l e r e s p o n s e , v a g u e l y r e l a t e d t o t h e Sec 5.4.2 124 c o n t e x t t h e keyword was u s e d i n , but m a i n l y b a s e d on t h e r a t h e r c y n i c a l n o t i o n t h a t c o n v e r s a t i o n s c a n be k e p t up by j u s t a p p e a r i n g i n t e r e s t e d ( by "uhuh" a t a p p r o p r i a t e moments, f o r e x a m p l e ) . The use of a p a t t e r n m a t c h e r i s a v a l u a b l e t e c h n i g u e , e s p e c i a l l y i n an e n v i r o n m e n t where n e a r l y a l l s e n t e n c e s a r e commands t o t h e s y s t e m . Here i t i s most u s u a l f o r a s i m p l e word i n t h e s y s t e m t o c a r r y a l l of t h e meaning, and i t s r e c o g n i t i o n by t h e m a t c h e r i s o f t e n a s u f f i c i e n t c o n d i t i o n t o e x e c u t e i t . F o r example, i f t h e keywords "START", "BEGIN", and "PROCESS", a l l i n i t i a t e sample p r o c e s s i n g t h e n i n p u t i n g t h e f o l l o w i n g s e n t e n c e s w i l l c a u s e t h e c o r r e c t a c t i o n i n e a c h c a s e . START PROCESS THE SAMPLES PLEASE BEGIN PROCESSING THE SAMPLES Of c o u r s e i t i s e a s y t o f o o l t h e s y s t e m w i t h n e g a t i v e s s u c h as "DO NOT START", but a l l o w i n g f o r s u c h w i l f u l e r r o r s i s of l i t t l e r e a l v a l u e when i t seems r e a s o n a b l e t o e x p e c t c o - o p e r a t i o n from t h e o p e r a t o r . By g i v i n g t h e p a t t e r n m a tcher a t a b l e of keywords we can i n c r e a s e t h e v o c a b u l a r y o f t h e command l a n g u a g e . The m a tcher t r y s e a c h keyword i n t u r n , s t o p p i n g a t t h e f i r s t t h a t m a t c h e s . Some c a r e must be t a k e n w i t h th e t a b l e t o a v o i d a m b i g u i t i e s i n t h e l a n g u a g e . F o r example, suppose t h a t "TEST" i s added t o t h e above commands, and t h a t i t i n i t i a t e s some s y s t e m t e s t r o u t i n e s . Then t h e s e n t e n c e "START THE SYSTEM TEST" can t a k e two meanings b e c a u s e of t h e p r e s e n c e of "START" ( b e g i n p r o c e s s i n g s a m p l e s , o r b e g i n t e s t i n g ) . T h i s i s e a s i l y r e s o l v e d by s p e c i f y i n g t h e Sec 5.4.2 1 25 keyword t a b l e i n t h e f o l l o w i n g o r d e r . PROCESS TEST BEGIN START M a t c h i n g o f "TEST" w i l l t h e n s u c c e e d b e f o r e "START" o r "BEGIN" and t h e s e n t e n c e f a k e s on i t s i n t e n d e d meaning. I t i s u n d e r s t a n d a b l y t e d i o u s e n t e r i n g a c o m p l e t e s e n t e n c e when a s i n g l e word or even a l e t t e r w i l l s u f f i c e , and t h e r e i s a g e n e r a l t e n d e n c y f o r t h e u s e r t o e v e n t u a l l y f a v o u r a b b r e v i a t e d forms of i n p u t . F o r t u n a t e l y i t i s e a s y t o m o d i f y t h e m a t c h i n g r o u t i n e t o r e c o g n i s e a b b r e v i a t i o n s , and even e x t e n s i o n s of keywords. C o n s i d e r a t a b l e t h a t c o n t a i n s t h e f o l l o w i n g keywords i n t h e o r d e r shown. ABORT TEST START STOP Then t h e words "T", "TE", "TES", and even "TESTING" w i l l a l l match w i t h "TEST"; whereas "S", "ST", and "STA" l i k e w i s e match t o "START". However "STO" i s t h e minimum a b b r e v i a t i o n f o r "STOP" b e c a u s e t h e r o u t i n e w i l l a t t e m p t a match of "START" f i r s t . A c a s e above t h a t i s p o t e n t i a l l y t r o u b l e s o m e i s t h e c o n f u s i o n between "A" u s e d as a d e t e r m i n e r , and as an a b b r e v i a t i o n f o r "ABORT". The s e n t e n c e "RUN A SYSTEM TEST" c o u l d a t t e m p t an a b o r t p r o c e d u r e . P l a c i n g "ABORT" a f t e r "TEST" i n t h e keyword t a b l e s o l v e s t h e p r o b l e m i n t h i s p a r t i c u l a r i n s t a n c e . Sec 5.4.2 1 26 In summary a r a t h e r s i m p l e p a t t e r n m a t c h i n g scheme p r o v e s c a p a b l e o f q u i t e " c l e v e r " p r o c e s s i n g . A p a r t from t h e a d v a n t a g e o f a n o n - s t r u c t u r e d command s y n t a x , t h e programmer c a n , t h r o u g h e x t e n s i v e use of " l o o k up" t a b l e s , make d r a s t i c c h a n g e s and a d d i t i o n s t o p r o c e s s o r commands w i t h o u t a l t e r i n g t h e d e c o d i n g s e t u p . 5.4.3 S o f t w a r e T o o l s Two i m p o r t a n t s u b r o u t i n e s a r e n e c e s s a r y . The f i r s t i s code t h a t c an o b t a i n t h e s e n t e n c e f rom t h e t e l e t y p e and s t o r e i t i n an a c c e s s i b l e l o c a t i o n . T h i s i s r e a l l y no p r o b l e m m a i n l y , b e c a u s e of t h e l i s t s t r u c t u r e d a p p r o a c h u s e d i n d e s i g n i n g t h e o p e r a t i n g s y s t e m . On r e c e i p t of t h e f i r s t c h a r a c t e r from t h e t e l e t y p e , a b u f f e r i s removed from t h e f r e e l i s t . A d d i t i o n a l c h a r a c t e r s a r e s t o r e d i n t h i s b u f f e r u n t i l t h e end of t h e s e n t e n c e i s f l a g g e d by a RETURN c h a r a c t e r ( o r when t h e b u f f e r i s f i l l e d ) . The b u f f e r i s r e t u r n e d t o t h e f r e e l i s t a f t e r command p r o c e s s i n g i s c o m p l e t e d o r , o p t i o n a l l y , when a CANCEL c h a r a c t e r i s i n p u t (CNTRL X ) . CANCEL a l l o w s t h e o p e r a t o r t o a b o r t a command i f he makes a m i s t a k e t y p i n g i t i n , and i s a l s o handy f o r d o c u m e n t i n g t h e p r i n t e d r e c o r d . B e c a u se t h e s t a n d a r d s i z e o f b l o c k s on t h e f r e e l i s t i s t h i r t y - t w o b y t e s , t h i s i s t h e maximum number of c h a r a c t e r s i n a s e n t e n c e ( i n c l u d i n g s p a c e s ) . I t has p r o v e n more t h a n a d e q u a t e f o r p r e s e n t n e e d s . A d d i t i o n a l l y i t i s p o s s i b l e t o a l t e r t h e c o n t e n t s o f t h e b u f f e r b e f o r e t h e s e n t e n c e i s r e l e a s e d f o r f u r t h u r p r o c e s s i n g b u t s u c h a l i n e e d i t o r has not been i m p l e m e n t e d . A l i s t i n g o f t h e s u b r o u t i n e may be f o u n d i n A p p e n d i x II under t h e name STRGET. Sec 5.4.3 127 The s e c o n d s u b r o u t i n e i s t h e p a t t e r n m a t c h e r d i s c u s s e d e a r l i e r . I t r e q u i r e s two i n p u t p a r a m e t e r s ; t h e l o c a t i o n of a keyword t a b l e , and t h e l o c a t i o n o f t h e s e n t e n c e t o be s e a r c h e d f o r t h e keywords. A word has been d e f i n e d a s a s t r i n g of c h a r a c t e r s p r e c e d e d by a s p a c e , and ended w i t h any one of a s e t of v a l i d t e r m i n a t o r s ( s p a c e , comma, l e f t b r a c k e t , o r r e t u r n ) . Some examples a r e u n d e r l i n e d below. TEST RACK(1) VAC, #?* Two e x i t p o i n t s a r e p r o v i d e d f o r t h e s u b r o u t i n e . The f i r s t i s u s e d when none of t h e keywords i n t h e t a b l e c a n be f o u n d i n t h e s e n t e n c e . U s u a l r e s p o n s e s t o s u c h an e x i t a r e t o s e a r c h a n o t h e r t a b l e , o r t o p r i n t an e r r o r message. The o t h e r e v e n t u a l i t y i s a s u c c e s s f u l match. When t h i s i s t h e c a s e t h e o t h e r e x i t p o i n t i s u s e d , w i t h t h e i n d e x of t h e m a t c h i n g t a b l e e n t r y b e i n g r e t u r n e d i n one of t h e wo r k s p a c e r e g i s t e r s . The i n d e x may be u s e d t o a c c e s s d a t a i n t a b l e s w i t h a o n e - t o - o n e c o r r e s p o n d e n c e t o t h e keyword t a b l e . Common examples a r e t a b l e s of s u b r o u t i n e a d d r e s s e s , d a t a , d a t a t y p e s , or argument t y p e s . F o r added f l e x i b i l i t y t h e r o u t i n e a l s o r e t u r n s t h e l o c a t i o n of th e m a t c h i n g word i n t h e s e n t e n c e . T h i s a l l o w s o t h e r t a b l e s t o s e a r c h f o r keywords i n t h e r e s t of t h e s e n t e n c e , and p e r m i t s t h e programmer t o b u i l d o r d e r i n g i n t o t h e command s y n t a x . Such a f e a t u r e has p r o v e n u s e f u l d u r i n g t h e manual mode when i t i s o f t e n n e c e s s a r y t o p e r f o r m s e v e r a l o p e r a t i o n s a t once. F o r more d e t a i l t h e s u b r o u t i n e MATCH s h o u l d be examined i n t h e program l i s t i n g o f A p p e n d i x I I . Sec 5.4.3 5.5 THE MANUAL AND COMMAND TASKS 128 As can be seen from t h e above, t h e o p e r a t o r i n t e r f a c e f a l l s n a t u r a l l y i n t o two s e p a r a t e and d i s t i n c t c a t e g o r i e s . I t can t h e r e f o r e be r e p r e s e n t e d by two t a s k s r u n n i n g under t h e c o n t r o l of t h e sample l i n e o p e r a t i n g s y s t e m . These a r e t h e command t a s k and t h e manual t a s k . The command t a s k u s e s o p e r a t o r i n p u t from t h e t e l e t y p e t o a l t e r t h e s t r u c t u r e of t h e o p e r a t i n g s y s t e m q u e u e s . M a n i p u l a t i v e examples i n c l u d e t h e power t o a b o r t , and hence d e l e t e , t a s k s f r o m t h e s y s t e m ; and t h e a b i l i t y t o move t a s k s f r o m t h e e r r o r queue, back i n t o t h e e x e c u t i o n queue. The most p o w e r f u l commands r e s u l t i n t h e f o r m a t i o n of a new t a s k , t o w h i c h t h e command t a s k r e l i n q u i s h e s c o n t r o l . Examples o f t h i s i n c l u d e t a s k s t o p e r f o r m sample p r e p a r a t i o n , e q u i l i b r a t i o n , and a n a l y s i s ; p r e s s u r e t e s t i n g ; and manual r a c k c o n t r o l . T h i s l a s t example r e s u l t s i n t h e i n t r o d u c t i o n of t h e manual t a s k t o t h e e x e c u t i o n queue. I t a l l o w s t h e o p e r a t o r t o m a n i p u l a t e a l l s o l e n o i d s and c o n t r o l l i n e s n e c e s s a r y t o t h e o p e r a t i o n of an i n d i v i d u a l r a c k . T h e s e i n c l u d e s h a r e d f a c i l i t i e s f r o m t h e mass s p e c t r o m e t e r and main l i n e s , so some p r o t e c t i o n must be p r o v i d e d t o p r e v e n t t h e o p e r a t o r i n a d v e r t e n t l y a f f e c t i n g t h e i r use by o t h e r r a c k s . The manual t a s k t h e r e f o r e RESERVes b o t h t h e main and mass s p e c t r o m e t e r l i n e s f o r i t s e x c l u s i v e use b e f o r e r e q u e s t i n g o p e r a t o r i n p u t . I t w i l l not r e l e a s e t h e s e r e s o u r c e s u n t i l i s s u e d t h e "STOP" command, and w i l l p r e v e n t o t h e r t a s k s from a c c e s s i n g them d u r i n g t h e i n t e r i m . T h i s f e a t u r e may p r o v e i n c o n v e n i e n t on a m u l t i - r a c k s y s t e m , b u t p r e s e n t s no p r o b l e m s on t h e c u r r e n t s i n g l e r a c k Sec 5.5 129 c o n f i g u r a t i o n . In any c a s e , a s r e p e a t e d l y p o i n t e d o u t , t h e t a s k o r i e n t e d n a t u r e of t h e sample l i n e o p e r a t i n g s y s t e m p e r m i t s t h e t h e o p e r a t o r i n t e r f a c e t a s k s t o be m o d i f i e d and r e p l a c e d a t w i l l . B o t h manual and command t a s k s o p e r a t e i n a s i m i l i a r manner. They c o n t i n u o u s l y i n t e r r o g a t e t h e t e l e t y p e k e y b o a r d u n t i l a s e n t e n c e has a c c u m u l a t e d . The s e n t e n c e i s s e a r c h e d f o r keywords from t a b l e s p e c u l i a r t o e a c h t a s k , w i t h f u r t h e r o p e r a t i o n d e p e n d i n g on t h e keywords f o u n d . F o r t h o s e r e a d e r s r e q u i r i n g a more d e t a i l e d u n d e r s t a n d i n g , i t i s b e s t t o c o n s u l t t h e p r o g r a m l i s t i n g i n A p p e n d i x I I , under t h e programs l a b e l e d TSKCMD & TSKMAN. D e s p i t e t h e s i m i l a r i t y o f t h e i r o p e r a t i o n t h e r e i s a f u n d a m e n t a l d i f f e r e n c e between t h e two t a s k s . The command t a s k i s i n t r o d u c e d t o t h e s y s t e m d u r i n g t h e i n i t i a l i s a t i o n p h a s e . I t n e v e r f i n i s h e s , but a l w a y s r e m a i n s i n t h e b a c k g r o u n d as t h e l o w e s t p r i o r i t y t a s k i n t h e s y s t e m . The manual t a s k , i n common w i t h a l l t a s k s i n t r o d u c e d from t h e command mode, i s t r a n s i e n t . I t i s c r e a t e d , u s e d , t h e n d e s t r o y e d , as needed. A l l t a s k s , e x c e p t t h e manual and command t a s k s , e x e c u t e v e r y r a p i d l y b e f o r e r e m o v i n g t h e m s e l v e s from t h e e x e c u t i o n queue t o w a i t on t h e t i m e r or r e s o u r c e q u e u e s . In f a c t t h e i r t o t a l u t i l i s a t i o n o f t h e c e n t r a l p r o c e s s o r i s so m i n i m a l t h a t t h e o p e r a t o r n e v e r n o t i c e s t h e i r p r e s e n c e and a l w a y s a p p e a r s t o be t a l k i n g t o e i t h e r t h e manual or command t a s k . To a v o i d o p e r a t o r c o n f u s i o n t h e c u r r e n t t a s k i s i d e n t i f i e d by an i n p u t p r e f i x . T h i s i s a s i n g l e c h a r a c t e r o u t p u t on t h e t e l e t y p e p r i n t e r whenever t h e c u r r e n t t a s k e x p e c t s i n p u t . I f t h e c h a r a c t e r i s a Sec 5.5 1 3 0 "#" t h e n i n p u t i s b e i n g r e q u e s t e d by t h e command t a s k ; and i f i t i s a ":" t h e manual t a s k i s i n c o n t r o l . The commands a v a i l a b l e f r o m t h e u s e r i n t e r f a c e a r e c u r r e n t l y b e i n g c o m p i l e d , and w i l l be a v a i l a b l e from t h i s l a b o r a t o r y i n t h e form of an o p e r a t i n g manual f o r t h e mass s p e c t r o m e t e r . Sec 5.5 CHAPTER V I . AUTOMATED SAMPLE PROCESSING METHODS 131 6.1 THE RACK PROCESSING TASK O n l y one more component need be d e s c r i b e d t o c o m p l e t e a w o r k i n g sample p r e p a r a t i o n s y s t e m . T h i s i s t h e t a s k t h a t r u n s t h e r a c k , and p r o c e s s e s t h e s a m p l e s . The r a c k t a s k was p r o b a b l y t h e e a s i e s t p a r t o f t h e s y s t e m t o implement, but o n l y b e c a u s e o f t h e e x t e n s i v e groundwork t h a t p r e p a r e d t h e way f o r i t s i n t r o d u c t i o n . In p a r t i c u l a r , t h e b o o k k e e p i n g o v e r h e a d s , and t h e c o n v o l u t e d f l o w of l o g i c t h a t i s o f t e n a c h a r a c t e r i s t i c of c o m p l i c a t e d c o n t r o l p r o g r a m s , a r e m i s s i n g b e c a u s e of t h e s u p e r v i s o r y n a t u r e of t h e sample l i n e o p e r a t i n g s y s t e m . The c a p a c i t y of t h e o p e r a t i n g s y s t e m t o o v e r s e e t a s k r e q u e s t s f o r r e s o u r c e s , t h e a b i l i t y of i t s r o u t i n e s t o i n a c t i v a t e t a s k s f o r p e r i o d s r a n g i n g from s e c o n d s t o h o u r s , and t h e p r o v i s i o n of an o r d e r l y method t h a t t r a p s t a s k s f a c e d w i t h r e a l - w o r l d o b s t r u c t i o n s , a r e j u s t some of t h e a r e a s where e x t e n s i v e s i m p l i f i c a t i o n of t h e r a c k t a s k has r e s u l t e d . T h e r e i s no p o i n t i n p r e s e n t i n g t h e d e t a i l of t h e r a c k p r o c e s s i n g a l g o r i t h m , but a b r i e f d e s c r i p t i o n of e a c h o f i t s s t a g e s i s g i v e n i n t h e f o l l o w i n g s e c t i o n s . T h e s e p a r a g r a p h s w i l l c o n c e n t r a t e upon t h e more u n u s u a l a s p e c t s of t h e t a s k , and t h e r e a d e r i s r e f e r e d t o t h e p r o g r a m l i s t i n g i n A p p e n d i x I I , u nder t h e l a b e l TSKRCK, f o r t h e e x a c t s e q u e n c e s . Sec 6.1 1 32 6.1.1 Sample P r e p a r a t i o n Samples a r e p r e p a r e d by pumping away t h e a i r above t h e water i n t h e sample t u b e s , and r e p l a c i n g i t w i t h c a r b o n d i o x i d e . I t i s i m p o r t a n t t o n o t e t h a t pumping must c o n t i n u e u n t i l g a s e s d i s s o l v e d w i t h i n t h e water have been removed. T h i s i s e v i d e n c e d by v i g o r o u s b o i l i n g when t h e t u b e i s f i r s t e v a c u a t e d , and of a c o n t i n u a l d e c r e a s e i n a c t i v i t y o v e r t h e n e x t t e n m i n u t e s . T h e r e was o r i g i n a l l y some c o n c e r n t h a t p r o b l e m s c o u l d a r i s e from d r o p l e t s of water s p l a s h e d o n t o t h e tub e w a l l s d u r i n g t h i s p h a s e , but t h e r a p i d l y s p i n n i n g s t i r r e r b a r s t e n d t o b r e a k up t h e l a r g e r b u b b l e s , and m i n i m i s e s p l a s h . I t has a l s o been o b s e r v e d t h a t l a r g e d r o p l e t s a d h e r i n g t h e w a l l s do e v a p o r a t e and, p r e s u m e d l y r e c o n d e n s e on t h e sample s u r f a c e , a s would be e x p e c t e d from t h e i r h i g h e r v a p o u r p r e s s u r e . In any c a s e , t h e t e s t t u b e w i l l be a p p r o x i m a t e l y u n i f o r m i n t e m p e r a t u r e , and e r r o r s r e s u l t i n g from e q u i l i b r a t i o n i n t h e d r o p l e t s s h o u l d be n e g l i g i b l e . The f i n a l p o i n t of n o t e i s t h e p r e s s u r e of c a r b o n d i o x i d e i n t h e sample t u b e s . I t was c h o o s e n t o be s l i g h t l y above a t m o s p h e r i c t o m i n i m i s e p o s s i b l e f r a c t i o n a t i o n and c o n t a m i n a t i o n r e s u l t i n g from s m a l l l e a k s t o t h e o u t s i d e a i r . F o r t h e same r e a s o n c a r b o n d i o x i d e i s l e f t i n t h e a d j a c e n t sample r e s e r v o i r s u n t i l t h e e q u i l i b r a t i o n r e a c t i o n i s c o m p l e t e . In t h i s c a s e t h e p r e s e n c e of d r y C 0 2 s h o u l d h e l p s t r i p w a t e r v a p o u r from t h e r e s e r v o i r w a l l s b e f o r e t h e e q u l i b r a t e d gas i s s t o r e d . 6.1.2 E q u i 1 i b r a t i o n A f t e r c o m p l e t i n g t h e sample p r e p a r a t i o n s t a g e , t h e r a c k t a s k e n t e r s an i d l e s t a t e , and r e m a i n s t h e r e u n t i l t h e Sec 6.1.2 1 33 e q u i l i b r a t i o n r e a c t i o n has c o m p l e t e d . D u r i n g e q u i l i b r a t i o n i t i s i m p o r t a n t t h a t t h e m a g n e t i c s t i r r e r s o p e r a t e c o n t i n u o u s l y i f e f f i c i e n t m i x i n g of t h e gas and t h e water i s t o o c c u r . The r e a c t i o n p r o c e e d s e x p o n e n t i a l l y t o w a r d s c o m p l e t i o n , w i t h a time c o n s t a n t d e p e n d e n t upon s e v e r a l f a c t o r s , i n c l u d i n g t h e r a t i o between t h e number o f m o l e c u l e s o f c a r b o n d i o x i d e and of water i n t h e sample t u b e . A t y p i c a l t i m e c o n s t a n t i s t h i r t y m i n u t e s , but t h e t o t a l e q u i l i b r a t i o n t i m e depends upon t h e i n i t i a l DEL d i f f e r e n c e between t h e water and t h e C 0 2 , and t h e maximum p e r m i s s i b l e e r r o r i n t h e DEL of t h e f i n a l e q u i l i b r a t e d g a s . C u r r e n t l y we o n l y a n a l y s e one r a c k p e r day, and t h e e q u i l i b r a t i o n t i m e of f o u r t e e n h o u r s has been c h o s e n t o f i t i n t o t h i s s c h e d u l e . The t i m e c o n s t a n t m e n t i o n e d above a l s o a p p l i e s t o s m a l l c h a n g e s i n t e m p e r a t u r e , and i t i s n e c e s s a r y t o keep t h e samples a t e q u a l t e m p e r a t u r e s f o r a b o u t t h e l a s t two h o u r s of e q u i l i b r a t i o n . A s m a l l f a n c i r c u l a t e s a i r r a p i d l y a r o u n d t h e r i m of t h e r a c k i n an a t t e m p t t o meeet t h i s c o n d i t i o n a s s i m p l y as p o s s i b l e . 6.1.3 Sample S t o r a g e When e q u i l i b r a t i o n i s c o m p l e t e t h e r e s e r v o i r s a r e e v a c u a t e d and c l o s e d o f f . The c o n n e c t i n g v a l v e between them and t h e sample t u b e s i s opened u n t i l t h e p r e s s u r e between t h e two c o n t a i n e r s e q u a l i s e s . C l o s i n g t h e c o n n e c t i n g v a l v e i s o l a t e s t h e gas i n t h e r e s e r v o i r f r o m any f u r t h e r exchange w i t h t h e water sample. I t c a n re m a i n t h e r e , i t s i s o t o p i c v a l u e s t a b l e , u n t i l r e q u i r e d f o r a n a l y s i s . Sec 6.1.3 134 6.1.4 Sample A n a l y s i s The a n a l y s i s o f samples i s t h e most c o m p l i c a t e d s e c t i o n of t h e p r o c e s s i n g a l g o r i t h m . A r a c k w i t h samples r e a d y t o a n a l y s e r e s e r v e s t h e mass s p e c t r o m e t e r l i n e ( t h u s p r e v e n t i n g o t h e r r a c k s from r e l e a s i n g s a m p l e s ) , s t a r t s up t h e P e l t i e r - c o o l e d v a p o u r t r a p , and s i g n a l s t h e mass s p e c t r o m e t e r i n t e r f a c e t h a t s amples a r e . r e a d y . H a v i n g c o m p l e t e d t h i s i n i t i a l i s a t i o n s e q u e n c e , t h e r a c k t a s k w a i t s f o r a sample r e q u e s t from t h e mass s p e c t r o m e t e r . When i t r e c e i v e s one, t h e common a r e a of t h e r a c k and t h e mass s p e c t r o m e t e r l i n e a r e e v a c u a t e d , t h e n s e a l e d . The r e s e r v o i r s o l e n o i d on t h e f i r s t r a c k p o s i t i o n i s opened, and e q u i l i b r a t e d sample gas f l o w s down t h e mass s p e c t r o m e t e r l i n e m a n i f o l d , t h r o u g h t h e P e l t i e r v a p o u r t r a p where any water v a p o u r i s removed, and o n t o t h e l i n e c o n n e c t i n g t h e t r a p t o t h e mass s p e c t r o m e t e r ' s i n l e t l i n e . At t h e same time a s i g n a l i s s e n t t o t h e mass s p e c t r o m e t e r i n d i c a t i n g t h a t t h e sample i s r e a d y . The r a c k t a s k t h e n w a i t s u n t i l i t r e c e i v e s a r e q u e s t from t h e mass s p e c t r o m e t e r f o r a n o t h e r sample. The r e s e r v o i r t h a t i s c u r r e n t l y open i s s e a l e d o f f , and t h e p r o c e d u r e r e p e a t s w i t h t h e n e x t sample i n t h e r a c k . The s e q u e n c e c o n t i n u e s u n t i l e v e r y sample on t h e r a c k has been r e l e a s e d . The r a c k t a s k f i n i s h e s by r e l e a s i n g t h e mass s p e c t r o m e t e r l i n e , so t h a t o t h e r r a c k t a s k s can s u b m i t t h e i r samples f o r a n a l y s i s . N o te t h a t sample gas i s c o n s e r v e d w h e r e v e r p o s s i b l e , so t h a t gas r e m a i n s i n t h e r e s e r v o i r a f t e r t h e f i r s t a n a l y s i s . On the p r e s e n t s y s t e m t h e r e i s enough l e f t f o r two more a n a l y s e s , s o , i f t i m e p e r m i t s r e p e a t s c a n be p e r f o r m e d t o i n c r e a s e t h e a c c u r a c y o f t h e r e s u l t . Sec 6.1.4 135 6.2 THE PUMPING ALGORITHM The most f r e q u e n t o p e r a t i o n d u r i n g r a c k p r o c e s s i n g i s t h e e v a c u a t i o n o f g a s e s from v a r i o u s s e c t i o n s o f t h e s y s t e m . T h i s i s a l s o t h e a r e a most l i k e l y t o c a u s e s e r i o u s p r o b l e m s , e i t h e r f r o m l e a k s , pump f a i l u r e , o r s o l e n o i d m a l f u n c t i o n . A s p e c i a l s u b r o u t i n e was w r i t t e n t o t a k e a c c o u n t of t h e p e c u l i a r i t i e s of t h e vacuum pump. I t has been d e s i g n e d t o c h e c k t h e p r e s s u r e i n s u c h a manner as t o d e t e c t s m a l l l e a k s , and t o use a s p e c i a l e r r o r e x i t i f c e r t a i n c r i t e r i a a r e not met. B e f o r e c a l l i n g t h e pump r o u t i n e , t h e u s e r i s r e s p o n s i b l e f o r o p e n i n g a l l v a l v e s l e a d i n g t o t h e a r e a t o be e v a c u a t e d . The r o u t i n e must be p r o v i d e d w i t h t h e l o c a t i o n o f a s p e c i a l t a b l e of pumping p a r a m e t e r s , and an a d d r e s s t o w h i c h t h e pr o g r a m w i l l b r a n c h i n c a s e of e r r o r . The f i r s t t a b l e e n t r y i s t h e t y p e of p r e s s u r e gauge on wh i c h a l l p r e s s u r e measurements w i l l be p e r f o r m e d ( p i e z o - e l e c t r i c o r t h e r m o c o u p l e ) . The s e c o n d i s a t i m e ( i n s e c o n d s ) f o r w h i c h t h e vacuum pump w i l l be c o n n e c t e d t o t h e main m a n i f o l d . A t t h e end of t h i s t i m e , t h e p r e s s u r e w i l l be measured, and compared w i t h t h e t h i r d t a b l e e n t r y . Any g r o s s l e a k s w i l l f a i l t h e f i r s t t e s t , and t h e s u b r o u t i n e w i l l be a b l e t o r e p o r t a pump-down f a i l u r e . However, s m a l l l e a k s w i l l n ot be n o t i c e d due t o t h e s m a l l o r i f i c e i n t h e v a l v e s t h r o u g h w h i c h r a c k s e c t i o n s a r e pumped. The l e a k s a r e d e t e c t e d by w a i t i n g a f t e r pump down f o r t h e p e r i o d s p e c i f i e d i n t h e f o u r t h t a b l e e n t r y . T h i s i s c h o s e n t o a l l o w p r e s s u r e t h r o u g h o u t t h e e v a c u a t e d s e c t i o n t o e q u a l i s e , and i n c r e a s e i n t h e c a s e of a l e a k . At t h e end of t h i s t i m e , p r e s s u r e i s a g a i n measured and Sec 6.2 136 compared w i t h t h e f i f t h and l a s t t a b l e e n t r y . F a i l u r e i s marked by a p r e s s u r e g r e a t e r t h a n t h a t s p e c i f i e d . The pumping a l g o r i t h m i s s p e c i f i e d i n A p p e n d i x I I , and can be f o u n d under t h e name PUMP i n t h e r a c k t a s k . 6.3 RACK ERRORS Most e r r o r s t h a t o c c u r a r e d e t e c t e d by t h e pump r o u t i n e d e s c r i b e d a b o v e . When t h i s i s t h e c a s e t h e r a c k t a s k i s s u e s an e r r o r message, t h e n p l a c e s i t s e l f on t h e o p e r a t i n g s y s t e m e r r o r queue. R e t r y s , from t h e e r r o r queue, u s u a l l y t a k e p l a c e a t t h e b e g i n n i n g o f t h e s t a g e i n w h i c h t h e e r r o r o c c u r r e d ( p r e p a r a t i o n , e q u i l i b r a t i o n , s t o r a g e , or a n a l y s i s ) . R e t r y s a r e e i t h e r i n i t i a t e d by t h e o p e r a t o r , o r i f o p e r a t o r a t t e n t i o n i s not f o r t h c o m i n g , a r e a u t o m a t i c a f t e r a s p e c i f i e d t i m e has e l a p s e d . Sometimes c o n d i t i o n s a r e s u c h t h a t a n o t h e r a t t e m p t w i l l s u c c e e d w i t h o u t o p e r a t o r i n t e r v e n t i o n . An example of t h i s c o u l d be a s m a l l d r o p of water l e f t i n one of t h e r e s e r v o i r s . S e v e r a l a t t e m p t s a t pumping may be r e q u i r e d b e f o r e t h e d r o p l e t e v a p o r a t e s . However some e r r o r s a r e e x t r e m e l y u n l i k e l y t o d i s a p p e a r , and must be r e c t i f i e d b e f o r e r a c k p r o c e s s i n g c an p r o c e e d . An example i s t h e l a c k o f c a r b o n d i o x i d e p r e s s u r e when a t t e m p t i n g t o b a c k f i l l t h e water sample t u b e s . In t h i s c a s e t h e r a c k t a s k w i l l r e m a i n on t h e e r r o r queue i n d e f i n i t e l y , and t h e o p e r a t o r must r e s p o n d b e f o r e t h e t a s k c a n p r o c e e d . The d o o r s s u r r o u n d i n g t h e samples i n t h e r a c k a r e n e c e s s a r y d u r i n g t h e l a s t s t a g e s of e q u i l i b r a t i o n , so t h e r a c k t a s k i s p r e v e n t e d from p r o c e e d i n g u n t i l t h e y a r e a l l i n p l a c e . Though Sec 6.3 1 37 t h i s e n s u r e s t h a t t h e r a c k i s s e t up c o r r e c t l y , t h e r e i s no e a s y way t o p r e v e n t t h e i r r e m o v a l l a t e r on. In f a c t , i t i s not n e c e s s a r i l y a d v a n t a g e o u s t o do s o . Sometimes t h e o p e r a t o r may w i s h t o make r e p a i r s "on t h e r u n " , and t h e s e c an o f t e n be done w i t h o u t a d v e r s e l y a f f e c t i n g sample e q u i l i b r a t i o n . T h e r e c o u l d be c o n d i t i o n s where s m a l l e r r o r s a r e p r e f e r a b l e t o t h e l o s s of t h e whole r a c k , a day o f t i m e , o r i r r e p l a c e a b l e s a m p l e s . Door o p e n i n g s , and c l o s u r e s , a r e t h e r e f o r e n ot c o n s i d e r e d a s e r r o r s ; but t h e y a r e r e p o r t e d by t h e o p e r a t i n g s y s t e m . When s u c h an e v e n t g e n e r a t e s a CMOS bus i n t e r r u p t , t h e o p e r a t i n g s y s t e m t e s t s t h e r a c k r e f r e s h t a b l e t o see i f t h e i n t e r r u p t i n g r a c k i s c u r r e n t l y i n u s e . I f i t i s , s t a t u s words showing t h e s t a t e of th e r a c k d o o r s a r e p r i n t e d on t h e t e l e t y p e ; b u t i f i t i s not t h e n t h e e v e n t i s i g n o r e d ( s e e TSKLOG i n APPENDIX I I ) . Sec 6.3 CHAPTER V I I . PRELIMINARY TESTS AND RESULTS 138 7.1 PRECISION OF SAMPLE PREPARATION 7.1.1 Methods and R e s u l t s The p r e c i s i o n o f sample p r e p a r a t i o n i s c o n v e n i e n t l y e s t i m a t e d by p r e p a r i n g e q u i l i b r a t e d C 0 2 samples from a r a c k l o a d e d w i t h i d e n t i c a l w a ter s a m p l e s , and t h e n m e a s u r i n g t h e DEL of t h e C 0 2 s a m p l e s on t h e mass s p e c t r o m e t e r . The s t a n d a r d d e v i a t i o n of t h e DELs g i v e s an e s t i m a t e of t h e combined e r r o r f r o m sample p r e p a r a t i o n and measurement. The f o l l o w i n g t e s t was run t o e v a l u a t e e r r o r s a r i s i n g from th e measurement s t a g e . U s i n g t h e manual c o n t r o l f a c i l i t i e s , t h e s i x t e e n sample r e s e r v o i r s were e v a c u a t e d , t h e n f i l l e d w i t h tank c a r b o n d i o x i d e . The gas i n t h e r e s e r v o i r s was a n a l y s e d i n t h e n o r m a l manner by e v o k i n g t h e ANALYSE command from t h e sample l i n e t e l e t y p e . The r e s u l t s of one s u c h t e s t ( r u n #025) u s i n g t h i s method a r e shown i n f i g u r e 7.1. To o b t a i n t h e o v e r a l l p r e c i s i o n of a n a l y s e s p e r f o r m e d on t h e s y s t e m , w a t e r samples were p r e p a r e d and a n a l y s e d i n t h e u s u a l manner. The s i x t e e n sample t u b e s were l o a d e d w i t h samples p i p e t t e d from a w e l l mixed b e a k e r of t a p w a t e r . The r e s u l t s from two s u c h r u n s (#020a and #022) a r e shown i n f i g u r e 7.2. A l l t h e r e s u l t s have been p l o t t e d as t h e r e s i d u a l s l e f t a f t e r s u b t r a c t i n g out t h e mean DEL v a l u e o b t a i n e d from t h a t r u n . A l i n e a r r e g r e s s i o n has been u s e d t o r e l a t e t h e measured DEL t o Sec 7.1.1 139 r a c k p o s i t i o n , and t h e l i n e of b e s t f i t i s p l o t t e d amongst the o 0.3 • A run 025 © 0.0 < 0 2 3 5 6 -0.3 slope = -0.036 F i g u r e 7.1 R e s u l t s f r o m I d e n t i c a l Gas Samples d a t a p o i n t s . 7.1.2 D i s c u s s i o n of R e s u l t s T u r n i n g our a t t e n t i o n t o t h e r e s u l t s of t h e measurement e v a l u a t i o n e x p e r i m e n t ( f i g u r e 7.1) a s t r o n g l i n e a r t r e n d i s i m m e d i a t e l y a p p a r e n t . The r e s i d u a l DEL v a l u e i s t h e r e f o r e s t r o n g l y c o r r e l a t e d t o e i t h e r r a c k p o s i t i o n , e l a p s e d t i m e , or t h e number o f s a m p l e s a n a l y s e d . The f i r s t p o s s i b i l i t y i s u n l i k e l y g i v e n t h e f a c t t h a t no e q u i l i b r a t i o n was i n v o l v e d i n t h e t e s t . I t would be even more r e m a r k a b l e i f t i m e d e p e n d e n t e f f e c t s , s u c h as t h e p r e s e n c e of s m a l l l e a k s i n e v e r y r e s e r v o i r , m a n i f e s t e d t h e m s e l v e s i n s u c h a f a s h i o n . The l a s t p o s s i b i l i t y i s t h e most l i k e l y , and t h e p r i m e s u s p e c t i s a s l o w c o n s t a n t f r a c t i o n a t i o n of t h e s t a n d a r d gas as i t i s d e p l e t e d f r o m i t s r e s e r v o i r on t h e i n l e t l i n e . I f s u c h i s t h e c a s e t h e n t h e o b s e r v e d t r e n d c a n o n l y be e x p l a i n e d i f l i g h t e r m o l e c u l e s a r e Sec 7.1.2 1 40 b e i n g removed i n p r e f e r e n c e t o t h e h e a v i e r o n e s . Such b e h a v i o u r 0.3L o OJ 0.0 < -0.3 run020a slope = -0.019 0.3r- o T3 <1 -0.3 F i g u r e 7.2 "A Â-__ A* 0 1 2 ^ \ A A 3 6 A slope = - 0.023 run022 9 Q b c d e f R e s u l t s f r o m I d e n t i c a l Water Samples i s p o s s i b l e i f t h e C 0 2 f l o w s t h r o u g h a m o l e c u l a r l e a k a t t h e i n l e t l i n e t o t h e mass s p e c t r o m e t e r . T h i s l e a k i s s u s p e c t e d as a s o u r c e o f i n s t a b i l i t y i n t h e mass s p e c t r o m e t e r a n a l y s e s f o r o t h e r r e a s o n s , and i t w i l l s h o r t l y be r e p l a c e d w i t h a more s t a b l e g l a s s one. The r e s u l t s i n f i g u r e 7.2 show a s i m i l i a r Sec 7.1.2 141 t r e n d , b u t t h e c o r r e l a t i o n i s not as p r o n o u n c e d . These e a r l i e r r u n s s u g g e s t t h a t t h e p r o b l e m i s u n p r e d i c t a b l e , and c o u l d a l s o be g r o w i n g more s e r i o u s . In view of t h e above, a s e p a r a t i o n o f t h e r e p e a t i b i l i t y of sample p r e p a r a t i o n from t h a t of t h e r e s t of t h e s y s t e m i s somewhat d i f f i c u l t . Some i d e a c a n be o b t a i n e d by r e m o v i n g t h e l i n e a r t r e n d from e a c h s e t of r e s u l t s , t h e n c a l c u l a t i n g a s t a n d a r d d e v i a t i o n from e a c h s e t o f r e s i d u a l s . When t h i s i s done t h e s t a n d a r d d e v i a t i o n i s f o u n d t o be^ 0.06°/oo/ 0.09°/oo/ and 0 . 1 0 ° / 0 0 f o r run #025, run #020a, and run #022 r e s p e c t i v e l y . T h e s e a r e p r o b a b l y r e a s o n a b l e e s t i m a t e s o f t h e p r e c i s i o n t h a t w i l l be a t t a i n a b l e when t h e d r i f t p r o b l e m s a r e r e m e d i e d . I , t h e r e f o r e , t e n t a t i v e l y p l a c e t h e o v e r a l l p r e c i s i o n of t h e measurement a t a r o u n d 0 . 1 0 ° / 0 0 / w i t h a b o u t 0 . 0 6 ° / O o of t h a t b e i n g due t o e r r o r s i n t r o d u c e d d u r i n g a n a l y s i s . The r e m a i n i n g 0 . 0 4 ° / o o i s p r o b a b l y a t t r i b u t a b l e t o l a c k of c o n s t a n c y i n c o n d i t i o n s t h r o u g h o u t t h e sample r a c k and i s , when compared w i t h o t h e r s y s t e m s , a v e r y e n c o u r a g i n g f i g u r e . 7.2 ERRORS FROM CROSS CONTAMINATION 7.2.1 Methods and R e s u l t s A s e c o n d k i n d of e r r o r r e s u l t s when a sample, r e l e a s e d t o t h e mass s p e c t r o m e t e r , has i t s DEL v a l u e a l t e r e d by r e s i d u a l gas and a d s o r b e d w ater l e f t i n common c o n n e c t i n g l i n e s from t h e r e l e a s e o f t h e p r e v i o u s sample. To t e s t t h e s e e f f e c t s , t h e r a c k was l o a d e d w i t h a b l o c k s o f f o u r t u b e s c o n t a i n i n g i d e n t i c a l t a p w a t e r s a m p l e s , a l t e r n a t i n g w i t h b l o c k s of f o u r empty t u b e s . Sec 7.2.1 142 A f t e r e q u i l i b r a t i o n , t h e DEL of t h e C 0 2 i n t h e t u b e s c o n t a i n i n g 24.0 o a? r 23.7 CU run024 TD 0) I 0.6h cu E 0 1 2 3 4 5 6 7 8 9 a b | c d e f 0.3 A t a P water % dry C0 2 gas 0.0L F i g u r e 7.3 R e s u l t s of t h e C r o s s C o n t a m i n a t i o n T e s t w a t e r c h a n g e s by a b o u t 2 4 ° / 0 0 , and t h e gas becomes t h o r o u g h l y s a t u r a t e d w i t h water v a p o u r . D u r i n g a n a l y s i s t h e d r y C 0 2 sample i m m e d i a t e l y f o l l o w i n g t h e b l o c k o f wet ones w i l l be s u b j e c t e d t o t h e maximum e f f e c t s o f c o n t a m i n a t i o n from r e s i d u a l gas and a d s o r b e d w a t e r , w i t h t h e e f f e c t t a i l i n g o f f as e a c h new sample i n t h e d r y b l o c k i s a n a l y s e d . S i m i l a r l y , t h e wet sam p l e s f o l l o w i n g t h e d r y b l o c k s h o u l d a l s o show t h e d e c r e a s i n g e f f e c t s of c o n t a m i n a t i o n , b u t o n l y t h o s e a r i s i n g f r o m t h e i r m i x t u r e w i t h r e s i d u a l g a s e s . Sec 7.2.1 143 A n a l y s e s o b t a i n e d f r o m a r a c k c o n f i g u r e d i n s u c h a manner a r e shown i n f i g u r e 7.3. 7.2.2 D i s c u s s i o n of R e s u l t s E x a m i n i n g t h e r e s u l t s shows t h e e x p e c t e d p a t t e r n of h i g h and low DEL v a l u e s . However, t h e low DEL v a l u e s a p p e a r q u i t e v a r i a b l e , and t h e t r e n d s e x p e c t e d f r o m c o n t a m i n a t i o n c o u l d be l o s t i n t h e " n o i s e " . S t i l l , i t i s p o s s i b l e t o a t t r i b u t e an a b s o l u t e maximum e r r o r of 0 . 3 0 ° / O o t o t h e e f f e c t , o r as i t i s u s u a l l y e x p r e s s e d , a b o u t one p e r c e n t of t h e d i f f e r e n c e i n DEL between a d j a c e n t s a m p l e s . T h e r e i s o n l y one t r a n s i t i o n f r o m d r y t o wet s a m p l e s , b u t i t i s b e t t e r b e h a v e d . Here t h e m a g n i t u d e of t h e c o n t a m i n a t i o n e r r o r i s below 0 . 1 0 ° / 0 0 or a r o u n d 0.3 p e r c e n t of t h e d i f f e r e n c e . T h e s e f i g u r e s a r e a c c e p t a b l e f o r most r o u t i n e a n a l y s e s . Sec 7.2.2 144 APPENDIX I . CIRCIUT DESCRIPTION AND OPERATION A1.1 THE TMS9980 MICROPROCESSOR A1 .1 .1 M i c r o p r o c e s s o r O p e r a t i o n A d e t a i l e d and e x t e n s i v e d i s c u s s i o n o f t h e o p e r a t i o n o f t h e TMS9980 m i c r o p r o c e s s o r i s beyond t h e s c o p e of t h i s t h e s i s . In any c a s e o p e r a t i o n i s w e l l documented and e x p l a i n e d i n t h e a p p r o p r i a t e r e f e r e n c e manual (Te x a s I n s t r u m e n t s , 1979). S t i l l , t h e b a s i c way i n w h i c h memory i s r e a d and w r i t t e n s h o u l d be e x p l a i n e d i f f u r t h u r s e c t i o n s of t h i s c h a p t e r a r e t o be c o m p r e h e n s i b l e . T h e r e a r e f i v e c o n t r o l l i n e s t h a t s y n c h r o n i s e r e a d and w r i t e o p e r a t i o n s . These a r e b r i e f l y e x p l a i n e d below and by r e f e r e n c e t o f i g u r e A1.1. 03-; T h i s i s d e r i v e d from t h e c l o c k (phase t h r e e ) and i s use d as a t i m i n g r e f e r e n c e . DBIN: When h i g h t h i s i n d i c a t e s t h a t t h e m i c r o p r o c e s s o r i s r e a d y t o r e c e i v e d a t a on t h e d a t a bus. MEMEN-: (Memory e n a b l e ) . When low t h e a d d r e s s bus has a v a l i d memory a d d r e s s . WE-: ( W r i t e e n a b l e ) . When low t h e d a t a bus h o l d s v a l i d ouput d a t a and c a n be w r i t t e n t o memory. READY: The r e a d y s i g n a l a l l o w s e x t e n d e d memory c y l e s . When h i g h i t i n d i c a t e s t o t h e m i c r o p r o c e s s o r t h a t d a t a c an be r e a d o r w r i t t e n d u r i n g t h e n e x t c l o c k c y c l e . The TM9980 e n t e r s a Sec A1.1.1 145 w a i t s t a t e u n t i l t h i s l i n e i s h i g h . •WRITE cycle 1 | READ cycle F i g u r e A1.1 T y p i c a l WRITE and READ c y c l e When t h e m i c r o p r o c e s s o r w i s h e s t o w r i t e , i t p l a c e s t h e low b y t e of d a t a on t h e d a t a bus, and t h e a d d r e s s on t h e a d d r e s s b u s . The v a l i d a d d r e s s i s f l a g g e d by l o w e r i n g MEMEN- and v a l i d d a t a by l o w e r i n g WE-. The h i g h b y t e o f d a t a i s p l a c e d on t h e d a t a bus a f t e r WE- r e t u r n s h i g h and t h e a d d r e s s i s i n c r e m e n t e d by r a i s i n g A13. WE- r e t u r n s low when t h e s e c o n d b y t e of o u t p u t d a t a becomes v a l i d . Sec A1.1.1 146 A r e a d c y c l e p e r f o r m s i n an i d e n t i c a l manner e x c e p t a r e q u e s t f o r i n p u t d a t a i s f l a g g e d by r a i s i n g DBIN. The i n t e r f a c e c i r c u i t r y i s t h e n r e s p o n s i b l e f o r p l a c i n g t h e d a t a on t h e d a t a bus b e f o r e t h e s e c o n d c l o c k p u l s e a r r i v e s . I f an e x t e r n a l d e v i c e i s not r e a d y t o r e c e i v e o r t r a n s m i t d a t a t o t h e d a t a bus i t s h o u l d l o w e r READY b e f o r e t h e n e x t c l o c k p u l s e 03-, and r a i s e READY when t h e d a t a i s v a l i d . The l o n g p r o p a g a t i o n d e l a y s t h r o u g h t h e CMOS bus, have made t h i s " h a n d s h a k i n g " n e c e s s a r y when r e a d i n g from r e g i s t e r s on t h e r a c k o r m a s t e r c o n t r o l b o a r d s . A1.2 OPERATION OF THE ANALOGUE-TQ-DIGITAL CONVERTER O p e r a t i o n of t h e ADC may be u n d e r s t o o d by r e f e r r i n g t o f i g u r e A1.2. An ADC c o n v e r s i o n i s i n i t i a t e d when t h e CPU w r i t e s an a n a l o g u e c h a n n e l number t o t h e ADC a d d r e s s . T h i s c a u s e s b o t h ADCEN- (ADC e n a b l e ) and WRSTB- ( w r i t e s t r o b e = EXPWE- . EXP03-) t o b o t h become a c t i v e ( l o w ) . C o n s e q u e n t l y t h e o u t p u t of G1 w i l l go h i g h , l a t c h i n g t h e f o u r l e a s t s i g n i f i c a n t b i t s of t h e d a t a bus i n t o t h e m u l t i p l e x e r t o s e l e c t t h e a n a l o g u e c h a n n e l number. At t h e same t i m e F1 w i l l c l o c k i t s D i n p u t and r a i s e t h e R/H- ( r u n / h o l d ) i n p u t on t h e ICL7104. The c o n v e r s i o n t h e n b e g i n s and a f t e r a s h o r t t i m e STTS ( s t a t u s ) goes h i g h t o f l a g a c o n v e r s i o n i n p r o g r e s s . In t h e p r o c e s s i t l o w e r s t h e o u t p u t of F2, but b e c a u s e STTS i s h i g h t h e s t a t e o f USERINT4- r e m a i n s i n a c t i v e . When t h e c o n v e r s i o n i s c o m p l e t e STTS goes low, a c t i v a t i n g t h e i n t e r r u p t , and r e s e t t i n g F 1 . T h i s p l a c e s t h e ADC i n a h o l d s t a t e u n t i l t h e i n t e r r u p t i s s e r v i c e d . Sec A1 .2 147 At t h e f i r s t o p p o r t u n i t y t h e p r o c e s s o r s e r v i c e s t h e WRTSTB- ADCEN- EXPDBIN- ,Q Q. USERINT^- Q f2 sp-4 - U d Ol • - c <u e C - Q . C f data bus EXPDB0-7 R/H- STTS ICL7104 CE- LBEN- HBEN- F i g u r e A1.2 S i m p l i f i e d S c h e m a t i c of ADC i n t e r r u p t by r e a d i n g from t h e ADC a d d r e s s . T h i s c a u s e s b o t h ADCEN- and EXPDBIN- t o become a c t i v e , s e t t i n g F2 a n d r e s e t t i n g t h e i n t e r r u p t l i n e t h r o u g h G3. As w e l l t h e ICL7104 o u t p u t b u f f e r s a r e e n a b l e d b e c a u s e CE- and LBEN- (low b y t e e n a b l e ) w i l l b o t h be low. The l o w e s t b y t e o f t h e c o n v e r s i o n v a l u e i s t h u s p l a c e d on t h e d a t a bus and t h e p r o c e s s o r r e a d s i t . The s t a t e of EXPA13 i s c h a n g e d i n t h e s e c o n d p a r t o f t h e r e a d c y c l e l o w e r i n g HBEN- ( h i g h b y t e e n a b l e ) and so a l l o w i n g t h e r e s t o f t h e c o n v e r s i o n v a l u e t o be r e a d . When t h e c y c l e i s c o m p l e t e d t h e ADC r e m a i n s i n a h o l d s t a t e , t h e o u t p u t b u f f e r s a r e d i s a b l e d , Sec A1.2 1 48 and t h e i n t e r r u p t l i n e i s i n a c t i v e (HIGH). The ADC i s t h e n r e a d y f o r a n o t h e r c o n v e r s i o n r e q u e s t . F o r an i n - d e p t h l o o k a t t h e a c t u a l c o n v e r s i o n p r o c e d u r e i t i s b e s t t o r e f e r t o t h e d e v i c e d a t a s h e e t s ( I n t e r s i 1 , 1 9 8 1 ) b u t i t c o u l d be d e s c r i b e d a s an a u t o - z e r o , d u a l s l o p e t e c h n i q u e . A n o t h e r p o i n t t o n o t e i s t h a t t h e ADC a d d r e s s i s c o m p l e t e l y s e l e c t a b l e u s i n g t w e l v e d u a l i n l i n e r o c k e r s w i t c h e s . I t may be p l a c e d anywhere i n t h e range 2000 t o 2FFE. A1.3 THE CMOS BUS INTERFACE A1.3.1 CMOS Bus L i n e s As w i t h any m i c r o p r o c e s s o r bus, t h e CMOS bus can be g r o u p e d i n t o t h r e e d i f f e r e n t f u n c t i o n s . C o n t r o l l i n e s t o and from t h e m i c r o p r o c e s s o r s u p e r v i s e i t s a c t i o n s , a d d r e s s l i n e s s e l e c t t h e d e s i r e d d e v i c e , and d a t a l i n e s t r a n s m i t t h e two way f l o w of d a t a . The l i n e s a r e named and d e s c r i b e d i n t h e f o l l o w i n g p a r a g r a p h s . CRACKEN- : (Rack e n a b l e ) T h i s l i n e becomes a c t i v e (low) whenever a r a c k a d d r e s s i s o u t p u t on t h e a d d r e s s bus by t h e m i c r o p r e s s o r . V a l i d r a c k a d d r e s s e s s r e s i d e i n a b l o c k of c o n t i g u o u s memory from 2X00 t o 2XFF. "X" i s a h e x a d e c i m a l d i g i t s e l e c t a b l e from f o u r s w i t c h e s l o c a t e d on t h e e x p a n s i o n b o a r d . In t h i s v e r s i o n X i s s e t t o z e r o . CMSTREN- : ( M a s t e r e n a b l e ) W i l l become a c t i v e (low) whenever an a d d r e s s i n t h e range 2Y00 t o 2YFF i s a c c e s s e d . Y i s s e l e c t a b l e u s i n g a n o t h e r b o a r d mounted s w i t c h b u t s h o u l d n e v e r be t h e same as X. Sec A 1.3.1 149 CWE-: ( w r i t e e n a b l e ) becomes a c t i v e (low) whenever an v a l i d o u t p u t d a t a from t h e m i c r o p r o c e s s o r i s p r e s e n t on t h e d a t a bus (CDO- t o CD7-). CBUSIN-: (Bus i n p u t ) Becomes a c t i v e (low) t o f l a g a r e q u e s t from t h e m i c r o p r o c e s s o r f o r i n p u t from t h e CMOS b u s . CREADY: T h i s c o n t r o l l i n e i s u s e d t o i n f o r m t h e p r o c e s s o r when a d e v i c e on t h e CMOS bus has d a t a r e a d y t o be r e a d ( i n r e s p o n s e t o a CBUSIN-). Because two r e a d c y c l e s a r e u s e d , a s i m p l e e n c o d i n g scheme g e n e r a t e s t h e c o r r e c t t i m i n g on t h e m i c r o p r o c e s s o r ( s e e s e c t i o n A 1 . 3 . 3 ) . CINT-: (Bus I n t e r r u p t R e q u e s t ) A d e v i c e on t h e CMOS bus l o w e r s t h i s l i n e whenever i t w i s h e s t o i n t e r r u p t t h e m i c r o p r o c e s s o r . B e c a u s e i n t e r r u p t s a r e m a i n l y g e n e r a t e d from m e c h a n i c a l s w i t c h e s t h e l i n e i s debounced b e f o r e i t e n t e r s USER INT3- on t h e U s e r I/O p o r t ( see s e c t i o n A 1 . 3 . 4 ) . CAS t o CA13: (The A d d r e s s B u s ) . The e i g h t l e a s t s i g n i f i c a n t a d d r e s s l i n e s a r e d i v i d e d i n t o two f i e l d s . The most s i g n i f i c a n t f i e l d (CA6 t o CA9) s e l e c t s t h e r a c k w h i l e t h e o t h e r (CA10 t o CA12) a d d r e s s e s one of t h e r e g i s t e r s w i t h i n t h e r a c k . The CA13 l i n e i s u s e d t o f l a g t h e h i g h o r low b y t e o f t h e a d d r e s s e d r e g i s t e r ( s e e f i g u r e 3 . 3 ) . CDO- t o CD7-: (The D a t a B u s ) . The s e e i g h t l i n e s form an i n v e r t e d image of t h e m i c r o p r o c e s s o r d a t a b us. They a r e u s e d t o t r a n s m i t d a t a v a l u e s t o and from t h e r a c k r e g i s t e r s . A d d i t i o n a l l y , power (+12 v o l t ) i s s e n t t o a l l CMOS d e v i c e s t h r o u g h t h e b u s . The h i g h n o i s e immunity and t h e u l t r a low power c o n s u m p t i o n of t h e s u p p l i e d e l e c t r o n i c s make t h i s f e a s i b l e . Sec A1.3 .1 150 A1.3.2 L e v e l T r a n s l a t i o n L o g i c l e v e l s on t h e CMOS bus a r e much h i g h e r t h a n t h e i r TTL e q u i v a l e n t s so l e v e l t r a n s l a t o r s must be u s e d t o i n t e r f a c e t h e two. T h e r e a r e t h r e e d i f f e r e n t modes of t r a n s l a t i o n . The f i r s t g r o u p o f bus l i n e s i n v o l v e s t h o s e s i g n a l s o r i g i n a t i n g a t t h e m i c r o p r o c e s s o r and r e q u i r e s t r a n s l a t o r s t o s h i f t t h e l e v e l upwards. The s e c o n d g r o u p i s s i m i l a r e x c e p t t h e d i r e c t i o n and s h i f t a r e r e v e r s e d . B o t h t h e s e g r o u p s of l i n e s a r e t e r m e d u n i d i r e c t i o n a l and a s u i t a b l e t r a n s l a t o r was f o u n d t o be m a n u f a c t u r e d by RCA (Type CD40109). The quad l o w - t o - h i g h v o l t a g e t r a n s l a t o r i s i n t e n d e d p r i m a r i l y f o r TTL t o CMOS c o n v e r s i o n s b u t i t may be u s e d i n t h e o p p o s i t e s e n s e by r e v e r s i n g t h e a p p r o p r i a t e power s u p p l y l e a d s . The p e n a l t y p a i d f o r t h i s c o n v e n i e n c e i s an e x t r e m e l y l o n g p r o p a g a t i o n d e l a y i n t h e r e v e r s e mode (up t o 1.6nS ! ! ) . However f o r t h e CMOS bus t h e r e i s no r e a l d i s a d v a n t a g e g i v e n t h a t o n l y two l i n e s r e q u i r e h i g h t o low t r a n s l a t i o n (CINT- and CREADY) and t h a t e x t r a d e l a y s a r e u n i m p o r t a n t t o t h e i r o p e r a t i o n . The t h i r d g r o u p of bus l i n e s r e q u i r i n g t r a n s l a t i o n a r e b i d i r e c t i o n a l . S i g n a l s on t h e d a t a bus (CD0- t o CD7-) can o r i g i n a t e a t e i t h e r t h e p r o c e s s o r or a bus d e v i c e , and t h e t r a n s l a t o r i s r e q u i r e d t o f u n c t i o n i n b o t h d i r e c t i o n s . A n o t h e r RCA d e v i c e (CD40115) c o n v e n i e n t l y f u l f i l l e d a l l t h e above r e q u i r e m e n t s . A s i n g l e c h i p (24 p i n DIP) can t r a n s l a t e e i g h t b i d i r e c t i o n a l l i n e s between CMOS and TTL l e v e l s . P r o p a g a t i o n d e l a y s a r e v e r y low i n b o t h d i r e c t i o n s (below 30nS) even when o u t p u t s a r e c a p a c i t i v e l y l o a d e d by l o n g bus l i n e s . In f a c t t h i s d e v i c e was so much f a s t e r t h a n t h e Sec A1..3.2 151 u n i d i r e c t i o n a l t r a n s l a t o r s t h a t i t c o u l d s w i t c h d i r e c t i o n and b e g i n t r a n s m i t t i n g d a t a b e f o r e CMOS b u f f e r s , j u s t r e a d , c o u l d be d i s a b l e d . A l t h o u g h no s h o r t t e r m p r o b l e m s were e x p e r i e n c e d when t h e s e two d e v i c e s a t t e m p t e d t o d r i v e i n o p p o s i t e d i r e c t i o n s , l o g i c was i n c o r p o r a t e d o n t o t h e d a t a t r a n s l a t o r t o throw i t i n t o a h i g h impedance s t a t e whenever t h e CMOS bus was n o t b e i n g u s e d . A1.3.3 Ready H a n d s h a k i n g READY .91 at CREADY to other racks 10>JS pulldown resistor EXP03- EXPA13 BUSIN- g3 V—<7 RDYREF CA13 CBUSIN- RACKEN- CRACKEN- RACKRD- rack select logic EXPA6- EXPA12 > CA6-CA12 J ui O l o o Ltranslatori j_ propagation i L_rack select i ' delays ' I delays ' ' delays I F i g u r e A1.3 READY H a n d s h a k i n g C i r c u i t Long p r o p a g a t i o n d e l a y s t h r o u g h t h e CMOS bus, bus d e v i c e s , and l e v e l t r a n s l a t o r s make i t i m p o s s i b l e t o r e a d t h e d e v i c e s w i t h o u t e s t a b l i s h i n g a h a n d s h a k i n g p r o t o c o l . A s i m p l e e n c o d i n g Sec A1.3.3 152 scheme has been u s e d t o g e n e r a t e s i g n a l s a p p r o p r i a t e t o t h e Q) EXPANSION BOARD END busin- C)READY DECODING I rdyref expa13' cready rdyref ready b) RACK END rackrd- Ica13 n CPU reads low byte bus propagation & rack select delays. creadyj F i g u r e A1.4 H a n d s h a k i n g S i g n a l s o p e r a t i o n o f t h i s m u l t i p l e x e d bus ( f i g u r e s A1.3 & A 1 . 4 ) . At t h e e x p a n s i o n b o a r d end t h e BUSIN- l i n e goes low whenever d a t a i s r e q u e s t e d from a CMOS bus d e v i c e . A r e f e r e n c e s i g n a l , RDYREF, i s g e n e r a t e d t h r o u g h g a t e G3 t h a t goes h i g h when t h e f i r s t b y t e i s r e q u e s t e d . A f t e r t h e f i r s t b y t e i s r e a d , and th e p r o c e s s o r wants t h e s e c o n d , t h e RDYREF l i n e r e t u r n s low (f i g u r e A 1 . 4 a ) . S i m i l i a r c i r c u i t r y a t t h e bus d e v i c e (G4, f i g u r e A1.3) w i l l g e n e r a t e an i d e n t i c a l s i g n a l on t h e CREADY bus l i n e . When t h i s s i g n a l a r r i v e s back a t t h e CMOS bus i n t e r f a c e i t w i l l be d e l a y e d from RDYREF by t h e sum o f l e v e l t r a n s l a t o r d e l a y s , bus p r o p a g a t i o n d e l a y s , and d e v i c e s e l e c t d e l a y s ( f i g u r e A 1 . 4 b ) . Sec A1.3.3 1 53 Thus a l l CMOS bus s i g n a l s a r e i n t r a n s i t i o n when CREADY and RDYREF d i f f e r , d a t a l i n e s w i l l n o t be v a l i d , and t h e m i c r o p r o c e s s o r must be s u s p e n d e d u n t i l t h e y a r e . T h i s i s done by d r i v i n g t h e m i c r o p r o c e s s o r READY l i n e from an e x c l u s i v e NOR g a t e , G2, t h a t d i r e c t l y compares t h e two s i g n a l s . F i g u r e A1.4c shows t h e r e l a t i o n s h i p g r a p h i c a l l y . The m o n o s t a b l e , M1, p r o v i d e s a " t i m e - o u t " f a c i l i t y i f a n o n - p r e s e n t bus d e v i c e i s a d d r e s s e d . In s u c h a c a s e t h e READY l i n e w i l l go low, t h e m i c r o p r o c e s s o r w i l l go i n t o coma, and t h e l a c k o f bus acknowledgement w i l l hang-up t h e s y s t e m . N o r m a l l y t h e s y s t e m c l o c k (EXP03-) c o n t i n u o u s l y r e t r i g g e r s t h e m o n o s t a b l e k e e p i n g t h e ouput low. When BUSIN- goes low t h e t r i g g e r i n g i s b l o c k e d and t h e m o n o s t a b l e must e v e n t u a l l y change s t a t e , s e n d i n g READY h i g h t o wake t h e p r o c e s s o r up. In p r a c t i c e a d e l a y i n t h e t h e m o n o s t a b l e of t e n m i c r o s e c o n d s a l l o w s a d e q u a t e t i m e f o r bus r e s p o n s e w i t h o u t d e l a y i n g p r o c e s s o r o p e r a t i o n u n n e c e s s a r i l y . A1.3.4 I n t e r r u p t L i n e Debounce C i r c u i t I t i s n e c e s s a r y t o p r e v e n t s w i t c h c o n t a c t bounce from i n f l u e n c i n g t h e m i c r o p r o c e s s o r d u r i n g t h e s e r v i c e of an i n t e r r u p t ( s e e s e c t i o n 3.10.1). The most common hardware a p p r o a c h i s t o use a two p o l e s w i t c h t h a t s e t s o r r e s e t s an RS f l i p - f l o p . W h i l s t a s o l i d , r e l i a b l e , and f a s t s o l u t i o n , t h e component and c o n n e c t o r c o u n t i s s i g n i f i c a n t , e s p e c i a l l y when sample s e n s e s w i t c h e s a r e c o n t e m p l a t e d . Where s p e e d of r e s p o n s e i s u n i m p o r t a n t a more e c o n o m i c a l s o l u t i o n i s o f f e r e d u s i n g s o f t w a r e g e n e r a t e d d e l a y s t o d e f e r i n t e r r u p t s e r v i c e u n t i l t h e s w i t c h has h a d . t i m e t o s e t t l e ( a r o u n d 20 ms). However t h e d e l a y " t i e s - u p " t h e p r o c e s s o r d u r i n g t h e w a i t i n g p e r i o d , and p r e v e n t s Sec A 1.3.4 1 54 o t h e r i n t e r r u p t s f r o m f u n c t i o n i n g . S o f t w a r e schemes t h a t do not do t h i s u s u a l l y r e q u i r e a s i g n i f i c a n t b o o k - k e e p i n g o v e r h e a d , and can become q u i t e messy. I n s t e a d a s i m p l e c i r c u i t has been u s e d t h a t i n c o r p o r a t e s t h e most u s e f u l f e a t u r e s o f b o t h h a r d w a r e / s o f t w a r e d e b o u n c e r s . A s i m p l i f i e d c i r c u i t i s u s e d t o d e m o n s t a t e t h e d e b o u n c i n g c i r c u i t r y i n f i g u r e A1.5. When t h e s w i t c h S1 i s c l o s e d i t e n a b l e s t h e t r i s t a t e b u f f e r B1, and l o w e r s CINT-. T h i s b l o c k s t h e r e - t r i g g e r i n g s i g n a l t o t h e m o n o s t a b l e (M1). A f t e r a d e l a y , USERINT5- w i l l go low, g e n e r a t i n g an i n t e r r u p t a t t h e m i c r o p r o c e s s o r v i a t h e s y s t e m I/O p o r t . I f , a t any t i m e , CINT- goes h i g h a g a i n t h e m o n o s t a b l e i n s t a n t l y r e t r i g g e r s , r e s e t t i n g t h e d e l a y . By c h o o s i n g t h e m o n o s t a b l e d e l a y t o be s i g n i f i c a n t l y g r e a t e r t h a n t h e l o n g e s t t i m e between b o u n c e s USERINT5- w i l l r e m a i n h i g h u n t i l a f t e r t h e s w i t h has s e t t l e d . A f t e r o b s e r v i n g t h e o p e r a t i o n o f t h e s w i t c h e s u s e d on t h e cmos bus F i g u r e A1.5 Bus I n t e r r u p t L i n e D e b o u n c i n g Sec A 1.3. 4 155 r a c k a s u i t a b l e t i m e was f o u n d t o be a r o u n d 10 ms. T h i s may be e t e r n i t y t o t h e m i c r o p r o c e s s o r b u t i t a p p e a r s i n s t a n t a n e o u s t o a human. A1.4 THE RACK INTERFACE A1.4.1 The Rack S e l e c t L o g i c and C o n t r o l L i n e s CA6- CA12 CA6 CA7 T CAS CAat -o»o 4 Tit CRACKEN- g2 V CBUSIN- RACKRD- CWE- RACKWR- CA13 b1 CA13- CA13- F i g u r e A1.6 Rack S e l e c t L o g i c A l t h o u g h r a c k r e g i s t e r s a r e r e a d and w r i t t e n d i r e c t l y from t h e CMOS bus, r e d u n d a n t d e c o d i n g c i r c u i t r y c a n be e l i m i n a t e d by Sec A 1.4.1 156 c e n t r a l i s i n g t h e r a c k s e l e c t l o g i c on one b o a r d , and by s e n d i n g d e c o d e d c o n t r o l s i g n a l s where needed. A s i m p l e , s t r a i g h t f o r w a r d scheme i s u s e d ( s e e f i g u r e A 1 . 6 ) . The e x c l u s i v e OR g a t e s , CO t o C3, compare t h e c o n f i g u r a t i o n of f o u r s w i t c h e s t o t h e r a c k number f i e l d on t h e CMOS a d d r e s s bus ( b i t s 6 t o 9 ) . When t h e two match, t h e o u t p u t o f G1 w i l l go low. I f RACKEN- i s a l s o low t h e r a c k w i l l be s e l e c t e d by t h e o u t p u t o f G2. By g a t i n g t h e o u t p u t of G2 w i t h CRACKIN- (G3) and CWE- (G4), r a c k r e a d (RACKRD-) and r a c k w r i t e (RACKWR-) s i g n a l s a r e p r o d u c e d , and c a n c o n t r o l t h e o p e r a t i o n o f a l l r a c k r e g i s t e r s . B1 i n v e r t s t h e b y t e s e l e c t l i n e (CA13) t o a v o i d t h e n e c e s s i t y o f r e p e a t i n g t h i s a t e a c h r e g i s t e r . A1.4.2 Rack S t a t u s R e g i s t e r and I n t e r r u p t G e n e r a t i o n A s i m p l i f i e d v e r s i o n of t h e r a c k s t a t u s l o g i c i s shown i n f i g u r e A1.7. Assume t h a t t h e r a c k i s i n a q u i e s c e n t s t a t e w i t h no i n t e r r u p t s p e n d i n g , and t h a t a l l p r e v i o u s i n t e r r u p t s have been r e s e t . The D t y p e f l i p - f l o p , F l , w i l l have i n p u t and o u t p u t e q u a l , t h e o u t p u t of t h e c o m p a r a t o r C1 w i l l be low, t h e o u t p u t s of G3 and G4 w i l l be low, and t h e CINT- bus l i n e w i l l be h i g h . I f t h e door s w i t c h , S1, ch a n g e s p o s i t i o n , t h e n t h e c o m p a r a t o r i n p u t s become u n e q u a l , DORCNG goes h i g h , t h e t r i s t a t e b u f f e r B3 i s e n a b l e d and t h e CINT- l i n e goes low. A f t e r a d e b o u n c i n g p e r i o d ( s e e s e c t i o n A1.3.4) USERINT5- on t h e s y s t e m I/O p o r t w i l l a l s o become low f l a g g i n g a CMOS bus i n t e r r u p t . At t h e f i r s t a v a i l a b l e o p p o r t u n i t y t h e m i c r o p r o c e s s o r b e g i n s p o l l i n g a l l d e v i c e s a t t a c h e d t o t h e CMOS bus. F o r t h e r a c k s i t w i l l r e a d t h e s t a t u s r e g i s t e r of e a c h r a c k from 0 t o F. When t h e r a c k g e n e r a t i n g t h e i n t e r r u p t i s r e a d t h e RACKRD- l i n e Sec A1.4.2 157 a n d t h e o u t p u t o f t h e r e g i s t e r s e l e c t c o m p a r a t o r goes low status register field comparator data bus RACKRD- CA13 gT)> status register 2 Ifm other interrupts DORCNG CINT- other doors EN b1 DOOR.D EN b2 F i g u r e A1.7 Rack S t a t u s and I n t e r r u p t L o g i c s e n d i n g G1 h i g h . D u r i n g t h e s e c o n d p a r t of t h e r e a d c y c l e CA13 a l s o goes h i g h , e n a b l i n g B1 and B2 v i a G2, and p l a c i n g t h e s t a t u s r e g i s t e r l i n e s on t h e d a t a b u s . When t h e p r o c e s s o r c o m p l e t e s i t s r e a d c y c l e t h e o u t p u t of G2 r e t u r n s h i g h , and c l o c k s t h e e d g e - t r i g g e r e d l a t c h , F 1 . The two i n p u t s t o t h e c o m p a r a t o r C1 t h e r e f o r e e q u a l i s e and CINT- r e t u r n s h i g h , r e s e t t i n g t h e i n t e r r u p t . In t h e meantime, h a v i n g f e t c h e d t h e r a c k s t a t u s r e g i s t e r , and h a v i n g t e s t e d i t , t h e m i c r o p r o c e s s o r s o f t w a r e has d e t e r m i n e d Sec A1.4.2 158 t h e i n t e r r u p t s o u r c e , and t a k e s a p p r o p r a t e a c t i o n . O t h e r d o o r s use i d e n t i c a l c i r c u i t r y t o t h a t shown h e r e f o r DOOR.D, s e n d i n g DORCNG low t h r o u g h G3. In a s i m i l a r f a s h i o n o t h e r i n t e r r u p t s l o w e r t h e CINT- l i n e t h r o u g h G4. A1.4.3 Rack W r i t e O p e r a t i o n s The o p e r a t i o n of t h e w r i t e l o g i c i s s t r a i g h t f o r w a r d , and a s i m p l i f i e d c i r c u i t i n c o r p o r a t i n g a l l i t s e l e m e n t s i s shown i n f i g u r e A1.8. F i g u r e A1.8 Rack W r i t e L o g i c When t h e r a c k and r e g i s t e r a r e a d d r e s s e d t h e o u t p u t o f G1 w i l l go h i g h a f t e r v a l i d d a t a a p p e a r s on t h e d a t a b u s . D u r i n g t h e h i g h b y t e p a r t o f t h e w r i t e c y c l e , CA13 w i l l be h i g h and w i l l c l o c k d a t a , v i a G2, o n t o t h e o u t p u t o f B1 f r o m t h e d a t a bus. D u r i n g t h e low b y t e CA13- w i l l be h i g h a n d w i l l e n a b l e t h e Sec A1.4.3 159 l a t c h of B2 v i a G3. The s o l e n o i d d r i v e r s a r e MOS V-FETS c h o o s e n f o r t h e i r power c a p a b i l i t i e s a nd s i m p l i c i t y o f i n t e r f a c e . A d i o d e p r o t e c t s them a g a i n s t d e s t r u c t i v e back emfs d u r i n g s h u t o f f . The LED d r i v e i s p a r t o f a pa c k a g e d e s i g n e d t o d r i v e s e v e n segment LED d i s p l a y s ( S p r a g u e Type ULN2003), and would p r o b a b l y be s u i t a b l e f o r d r i v i n g t h e s o l e n o i d s as w e l l . T h i s i s recommended i n f u t u r e v e r s i o n s . B e c a u s e t h e CMOS bus i s an i n v e r t e d image o f t h e m i c r o p r o c e s s o r one, i n v e r t e r s a r e p l a c e d between t h e l a t c h e s and d r i v e r s . In t h e c a s e of t h e s o l e n o i d s a g a t e p e r f o r m s t h e f u n c t i o n . The s p a r e i n p u t i s i n t e n d e d t o a c t as a s a f e t y i n t e r l o c k when used i n c o n j u n c t i o n w i t h sample s e n s e s w i t c h e s . I f a sample t u b e i s not p r e s e n t t h e s w i t c h w i l l h o l d t h e g a t e i n p u t h i g h and p r e v e n t t h e s o l e n o i d from f u n c t i o n i n g . A1.5 THE MASTER CONTROL BOARD The c o n t r o l and s t a t u s r e g i s t e r s a r e r e a d and w r i t t e n i n an i d e n t i c a l manner t o t h e i r r a c k c o u n t e r p a r t s d e s c r i b e d e a r l i e r , b u t a c r u d e r , more ambiguous a d d r e s s d e c o d i n g scheme i s u s e d . The c i r c u i t r y t h a t g e n e r a t e s sample r e q u e s t i n t e r r u p t s u s e s m a s t e r and s l a v e f l i p - f l o p s t o e f f e c t t h e e d g e - t r i g g e r e d i n t e r r u p t , and t o p r e v e n t t h e f a t a l l o s s of i n t e r r u p t s a r r i v i n g d u r i n g a m a s t e r s t a t u s r e a d c y c l e ( f i g u r e A 1 . 9 ) . When t h e r e i s no r e a d c y c l e i n p r o g r e s s , t h e b u f f e r e n a b l e l i n e w i l l be h i g h , t h e t r i s t a t e b u f f e r s w i l l be i n t h e i r h i g h impedance s t a t e , and t h e g a t e G2 w i l l be t r a n s p a r e n t t o s i g n a l s a r r i v i n g a t i t s i n p u t . A sample r e q u e s t f r o m t h e i n l e t l i n e w i l l l o w e r Sec A1.5 160 ISREQ- l i g h t i n g t h e LED, and s a t u r a t i n g t h e t r a n s i s t o r i n t h e •5v CINT F i g u r e A1.9 Sample R e q u e s t I n t e r r u p t L o g i c o p t i c a l i s o l a t o r . An i n v e r t e r c l e a n s up t h e i s o l a t o r s i g n a l c a u s i n g a s h a r p r i s e i n t h e C.REQ l i n e t h a t c l o c k s t h e o u t p u t o f t h e JK f l i p - f l o p ( F i ) h i g h . When G2 i s t r a n s p a r e n t t h e o u t p u t o f F1 s e t s F2, r a i s i n g SREQ.INT and r e s e t t i n g F1 i n p r e p a r a t i o n f o r t h e n e x t i n t e r r u p t . The CINT- l i n e i s l o w e r e d when t h e SREQ.INT e n a b l e s t h e t r i s t a t e b u f f e r (B3) v i a G3. When t h e m a s t e r s t a t u s r e g i s t e r i s r e a d t h e b u f f e r e n a b l e l i n e w i l l be l o w e r e d e n a b l i n g B1 and B2, and p l a c i n g t h e sample r e q u e s t (C.REQ) and i n t e r r u p t f l a g s (SREQ.INT) on t h e d a t a b u s . At t h e end o f t h e r e a d c y c l e t h e b u f f e r e n a b l e l i n e i s r a i s e d , d i s c o n n e c t i n g B1 and B2, and r e s e t t i n g F 2. I f an i n t e r r u p t Sec A1.5 161 a r r i v e d d u r i n g t h e r e a d c y c l e t h e n F1 would have been s e t . Gate G2 w o u l d have p r e v e n t e d F2 f r o m b e i n g s e t and F1 r e s e t , b ut w i l l a l l o w t h e sequence t o c o n t i n u e as soon as t h e b u f f e r e n a b l e s i g n a l r e t u r n s h i g h . Sec A1 .5 162 APPENDIX I I . PROGRAM LISTING OF THE SAMPLE LINE OPERATING SYSTEM MICROFICHE INDEX C o n t e n t s Index RAM memory B1 t o E1 I n t e r r u p t v e c t o r s B1 XOP v e c t o r s B1 I n t e r r u p t w a i t p o i n t e r s B1 System queue p o i n t e r s C1 Semaphore t a b l e C1 Rack r e f r e s h t a b l e C1 D e d i c a t e d w o r k s p a c e s & TCB's C1 ASCII c l o c k C1 E q u a t e s & D e f i n i t i o n s D1 t o E1 EPROM memory F1 t o 16 C o n s t a n t s F1 S u p e r v i s e r E n t r y P o i n t s G1 t o K1 S t a r t u p i n i t i a l i s a t i o n G1 FINISH L1 RELINQ M1 WAIT N1 WAIT.INT B2 WAIT.ERR C2 RESERV D2 RELESE E2 System e r r o r s F2 PSVSAV G2 PSVGET G2 I n t e r r u p t s e r v i c e r o u t i n e s H2 t o K2 SRVDSP H2 t o 32 SRVADC J2 SRVBUS K2 XOP d e f i n i t i o n s L2 t o M2 L i s t m a n i p u l a t i o n r o u t i n e s N2 t o C3 INSERT N2 DELETE B3 FIND B3 POPL C3 PUSHL C3 G l o b a l S u b r o u t i n e s E3 t o B4 TCBGET E3 ADCGET F3 DISOLV G3 STRGET H3 t o 13 MATCH J 3 t o K3 CALCBIT L3 PUMP M3 t o N3 Sec A2 163 ABORT B4 T a s k s !c4 t o 16 TSKCUD C4 t o D4 TSRCMD E4 t o N4 TSKMAN ...B5 t o H5 TSKRCK J 5 t o D6 TSKTST E 6 t o H6 TSKLOG 16 C r o s s R e f e r e n c e T a b l e J6 t o F7 MICRO F I C H E •. R C o Ikc-hons. — R o o k e d - ? e , 2- Sec A2 164 APPENDIX I I I . REFERENCES CONSULTED IN THIS THESIS A h e r n , T.K. (1975) "An 0 1 8 / 0 1 6 S t u d y of Water Flow i n N a t u r a l Snow". M.Sc. T h e s i s , U n i v e r s i t y of B r i t i s h C o l u m b i a , 164pp. A h e r n , T.K. (1980) "The Development o f a C o m p l e t e l y Automated Mass Oxygen I s o t o p e S p e c t r o m e t e r " . Ph.D. T h e s i s , U n i v e r s i t y of B r i t i s h C o l u m b i a , 181pp. C r a i g , H. (1957) " I s o t o p i c s t a n d a r d s f o r c a r b o n and oxygen, and c o r r e c t i o n f a c t o r s f o r mass s p e c t r o m e t r i c a n a l y s i s of c a r b o n d i o x i d e " . G e o c h i m i c a e t C o s m o c h i m i c a A c t a . Volume 12, pp133-149. C r a i g , H., G o r d o n , L . I . , and H o r i b e , Y. (1963) " I s o t o p i c e x c h a n g e e f f e c t s i n t h e e v a p o r a t i o n o f w a t e r " . J o u r n a l o f G e o p h y s i c a l R e s e a r c h . Volume 68, number 17, pp5079-5087. D i j k s t r a , E.W. (1965) " C o - o p e r a t i n g s e q u e n t i a l p r o c e s s e s " . M a t h e m a t i c s D e p a r t m e n t , T e c h n o l o g i c a l U n i v e r s i t y , E i n d h o v e n , The N e t h e r l a n d s . D i j k s t r a , E.W. (1968) " C o - o p e r a t i n g s e q u e n t i a l p r o c e s s e s " . In F.Genuys ( e d . ) , Programming L a n g u a g e s , Academic P r e s s , New Y o r k , pp43-112. Dushman, S. (1962) " S c i e n t i f i c F o u n d a t i o n s of Vacuum T e c h n i q u e " . 2nd E d i t i o n , J o h n W i l e y & Sons, I n c . E p s t e i n , S. and Mayeda, T. (1953) " V a r i a t i o n s of t h e O 1 8 C o n t e n t of W a t e r s from N a t u r a l S o u r c e s " . G e o c h i m i c a e t C o s m o c h i m i c a A c t a . , volume 4, 213-224. F e l l e r , W. (1968) "An I n t r o d u c t i o n t o P r o b a b i l i t y T h e o r y and i t s A p p l i c a t i o n s " . W i l e y , New Y o r k , 2nd E d i t i o n . F r a n k , H.S. (1929) "Low p r e s s u r e a d s o r p t i o n on a washed g l a s s s u r f a c e " . J o u r n a l of P h y s i c a l C h e m i s t r y , Volume 33, pp970-976. A l s o see Dushman (1962) f o r a d i s c u s s i o n of t h e s e and o t h e r r e s u l t s . I n t e r s i l (1981) "Data Book 1981". pg 4-118, I n t e r s i l , I n c . 10710 N . T a n t a u Avenue, C u p e r t i n o , C a l i f o r n i a , 95014, U.S.A. K o l l a r , F. ( i 9 6 0 ) "The p r e c i s e i n t e r c o m p a r i s o n o f l e a d i s o t o p e r a t i o s " . Ph.D. T h e s i s , U n i v e r s i t y o f B r i t i s h C o l u m b i a , 107pp. L a n g m u i r , I . (1918) "The a d s o r p t i o n of g a s e s on p l a n e s u r f a c e s of g l a s s , m i c a , and p l a t i n u m " . J o u r n a l of t h e A m e r i c a n C h e m i c a l S o c i e t y , Volume 40, p p 1 3 6 l - 1 4 0 2 . A l s o see Dushman (1962) f o r a p r e c i s and f u r t h u r r e f e r e n c e s . M c H a f f i e , I.R. and L e h n e r , S. (1925) "The a d s o r p t i o n of water Sec A3 165 from t h e gas phase on p l a n e s u r f a c e s of g l a s s and p l a t i n u m " . J o u r n a l o f t h e C h e m i c a l S o c i e t y , Volume 127, pp1559-1572. McK i n n e y , C.R., McCrea, J.M., E p s t e i n , S., A l l e n , H.D. and U r e y , H.C. (1950) "Improvements i n mass s p e c t r o m e t e r s f o r t h e measurement o f s m a l l d i f f e r e n c e s i n i s o t o p e abundance r a t i o s " . Review of S c i e n t i f i c I n s t r u m e n t s . Volume 21, pp724-730. M i c r o m a s s (1978) "Water I s o t o p i c A n a l y s i s " , P u b l i c a t i o n 02.254/1, Dec 78 DL/WDU. VG I s o t o p e s L t d . , Ion P a t h , Road T h r e e , W i n s f o r d , C h e s h i r e , CW7 3BX, E n g l a n d . M i l l s , G.A. and U r e y , H.C. (1939) "Oxygen exchange between c a r b o n d i o x i d e , b i c a r b o n a t e i o n , c a r b o n a t e i o n , and w a t e r " . J o u r n a l o f t h e A m e r i c a n C h e m i c a l S o c i e t y . Volume 61, pg534. M i l l s , G.A. a n d U r e y , H.C. (1940) "The k i n e t i c s o f i s o t o p i c e x change between c a r b o n d i o x i d e , b i c a r b o n a t e i o n , c a r b o n a t e i o n and w a t e r " . J o u r n a l of t h e A m e r i c a n C h e m i c a l S o c i e t y . Volume 62, PP1019-1026. N i e r , A.O. (1940) "A mass s p e c t r o m e t e r f o r r o u t i n e i s o t o p e abundance measurements". Review o f S c i e n t i f i c I n s t r u m e n t s . Volume 11, p p 2 l 2 - 2 1 6 . N i e r , A.O. (1947) "A mass s p e c t r o m e t e r f o r i s o t o p e and gas a n a l y s i s " Review of S c i e n t i f i c I n s t r u m e n t s . Volume 18, number 6, pp398-419. N i e r , A.O., Ney, E.P., and Inghram, M.G., (1947) "A n u l l method f o r t h e c o m p a r i s o n of two i o n c u r r e n t s i n a mass s p e c t r o m e t e r " . Review of S c i e n t i f i c I n s t r u m e n t s . Volume 18, number 5, pp294- 297. R u s s e l l , R.D. and A h e r n , T.K. (1974) " E c o n o m i c a l mass s p e c t r o m e t e r i o n c u r r e n t measurement w i t h a c o m m e r c i a l p a r a m e t r i c a m p l i f i e r " . Review of S c i e n t i f i c I n s t r u m e n t s . Volume 45, number 11, pp1467-1469. R u s s e l l , R.D., B l e n k i n s o p , J . , Meldrum, R.D., and M i t c h e l l D.L. (1971) " O n - l i n e computer a s s i s t e d mass s p e c t r o m e t r y f o r g e o l o g i c a l r e s e a r c h " . Mass S p e c t r o s c o p y . Volume 19, number 1, pp19-36. R u s s e l l , R.D. and K o e r n e r , R. "DEL O 1 8 v a r i a t i o n s i n snow on t h e Devon I s l a n d i c e cap, N o r t h w e s t T e r r i t o r i e s , C a n a d a". Volume 16, number 7, pp1419-1427. R o e t h e r , W. (1970) " W a t e r - C 0 2 exchange s e t - u p f o r t h e r o u t i n e oxygen-18 a s s a y of n a t u r a l w a t e r s " . I n t e r n a t i o n a l J o u r n a l o f A p p l i e d R a d i a t i o n and I s o t o p e s . Volume 21, pp379-387. Shaw, A.C. (1974) "The l o g i c a l d e s i g n o f o p e r a t i n g s y s t e m s " . P r e n t i c e - H a l l , I n c . , Englewood C l i f f s , N . J., U.S.A. S m i t h , D . C , I r b y , C , K i m b a l l , R. , V e r p l a n k , B.., and H a r s l e m , Sec A3 166 E. (1982) " D e s i g n i n g t h e S t a r u s e r i n t e r f a c e " . B y t e , Volume 7, number 4, pp242-282. S t a s c h e w s k i , D. (1964) " E x p e r i m a n t e l l e b e s t i m m i n g d e r 0 1 B / 0 1 6 t r e n n f a k t o r e n i n den systemen C 0 2 / H 2 0 und C 0 2 / D 2 0 " . Bunsen G e s e l l s c h a f t f u r P h y s i k a l i s c h e Chemie. Volume 68, pp454-457. T e x a s I n s t r u m e n t s (1979) "TM990/180 M i c r o c o m p u t e r U s e r s G u i d e " . P u b l i c a t i o n #1602004-9701. Weizenbaum, J . (1965) "ELIZA - A computer p r o g r a m f o r t h e S t u d y of N a t u r a l Language Communication between Man and M a c h i n e " . C o m m u n i c a t i o n s o f t h e A s s o c i a t i o n f o r Computing M a c h i n e r y , Volume 9, number 1. A l s o see W i n s t o n ( 1 9 7 7 ) , pages 323,333-335, f o r an e a s i l y r e a d summary. W i n o g r a d , T. (1972) " U n d e r s t a n d i n g N a t u r a l Language". Ph.D. T h e s i s , Academic P r e s s . A l s o see W i n s t o n ( 1 9 7 7 ) , pages 157-166. W i n s t o n , P.H. (1977) " A r t i f i c i a l I n t e l l i g e n c e " , A d d i s o n - W e s l e y P u b l i s h i n g Company I n c . , 444pp.

Cite

Citation Scheme:

    

Usage Statistics

Country Views Downloads
United States 5 0
China 2 0
Japan 1 0
City Views Downloads
Beijing 2 0
Ashburn 2 0
Manhattan 2 0
Redmond 1 0
Tokyo 1 0

{[{ mDataHeader[type] }]} {[{ month[type] }]} {[{ tData[type] }]}

Share

Share to:

Comment

Related Items