referring now to fig1 a downhole tool 10 suitable for use in a production well for measuring temperature and pressure over a period of time is illustrated . the tool 10 includes three separate pressure and fluid tight housings 11 , 12 and 13 , which are typically sized for passage through a small diameter production tubing by means of a wireline w and the connecting head 13 which contains the d . c . batteries 14 . the head 13 and housing 11 are independently sealed and when interconnected , the battery means 14 are electrically coupled to the electrical processing circuits within the housing 11 . by separately housing the battery pack and the electrical processing circuits in the housing 11 , the processing circuits are never exposed to the field environments . for example , after a test , it is only necessary to exchange batteries to run the next test . the pressure and temperature sensors are contained in a lower housing 12 . thus , when it is desired to run the sensors on an electrical wireline , they can be used independently of the housings 11 and 13 . the present invention enables testing of the equipment at the surface with new batteries to determine if the tool is functioning properly and if all of the programs and memory are proper for the next test as will be explained later . in the housing 11 is an electronic power supply 15 which supplies electrical power to an electronic clock or timer means 16 . the clock means 16 is an electronic device which functions over a period of time to periodically control the application of power to the processing equipment ( shown by the line 28 ) and to discontinue the power to the processing equipment in accordance with a pre - selected set of pre - installed software recording instructions . each recording instruction enables the measuring and memory circuits in the tool to operate for a time period as determined by the number of samples to be obtained and to be turned off for discrete time intervals as determined by the sample rate until the completion of the test . the time periods and time intervals can be independently set for a range or number of the program instructions . in the present invention , 32 program instructions are used , each program recording instruction establishing a time sequence for sampling a predetermined number of pressure and temperature data samples and the time interval or sampling rate between taking the next number of samples . the clock means 16 , when turned on , enables operating power to be applied to a random access memory ( ram ) circuit means 17 , a central processing unit ( cpu ) circuit means 18 , a nonvolatile program memory ( pm ) circuit means 19 , a nonvolatile data memory ( eprom ) circuit means 20 , an input - output ( i / o ) circuit means 21 , and a driver circuit means 22 . at the same time , the clock means 16 , by a connection 23 , resets the cpu 18 each time it is turned on . the clock 16 , ram 17 , cpu 18 , program memory 19 , the i / o 21 are all interconnected by a data bus 24 which interrelates the programed functions and data transfer for the various units . an audible accoustic device 25 is connected to the driver circuit 22 . a first sensor 26 and a second sensor 27 are coupled to the i / o circuit 21 by a connector 30 and the data from the sensors is in a digital format or converted to a digital format . in operation of the system , the clock means 16 controls the period of time that the various units are turned off . the clock means 16 is operated by the recording program instructions which are input at the earth &# 39 ; s surface prior to running the tool . the recording program instructions are a series of commands to operate software to control the operation of the equipment for a discrete number of sampling periods and set the time intervals between each sampling period . in each sampling period of an instruction , data samples for each of the temperature and pressure data are obtained and the number of samples of each data sample is established by the instruction . the recording program instructions thus serve to direct the operating functions of the cpu to obtain data samples . the flow chart for the recording program instructions is shown in fig2 a - 2c . at the earth &# 39 ; s surface , when the power is applied to the cpu and logic circuits , a program instruction to the cpu ascertains if all of the following conditions are met by the tool ( see fig2 ): ( 1 ) that the nonvolatile memory is erased and contains no data ; ( 3 ) that all of the memory in the system properly functions ; and if all of these functions are met or satisfied by the system , the driver circuit 22 is actuated for a one minute period to actuate the audible acoustic device 25 such as a beeper . this assures the operator , prior to running the tool in the well bore , that the batteries are operating , the processing equipment is functioning , that the memory is clear of prior data , and that the sensors are properly connected . after completing the surface test of the equipment which determines proper functioning and the absence of any prior data from the system , the tool is positioned in the well bore . the clock is programed by the program instruction ( a recording delay ) to not operate for a sufficient period of time to permit location of the tool in the desired location in the well after the surface test . once the tool is located in the well bore at the desired depth , the clock next initiates operation of the cpu and the software program in the cpu ( shown in fig2 ) which locates the first recording program instruction of the recording program instructions . when the first recording program instruction is located , the software program checks if the recording instruction is complete , i . e . has the entire instruction been implemented . if the first recording instruction has been completed , the software determines if the recording instruction read is the last recording instruction of the instruction program . when the last instruction is reached , the system power is disabled . prior to reaching the last instruction the recording program finds the first or next recording program instruction . for the first instruction the program sets a data pointer beginning at the start of the data memory . for other recording program instructions , the software program reads the base address of the last instruction and determines the number of samples from the prior instruction reading and takes the next available data memory in the nonvolatile memory to collect the next temperature and pressure data . the collected data is processed in the ram 17 and is recorded in a set of cells in a nonvolatile memory 20 a first time and then the data is re - entered in the same order to the same set of cells in the nonvolatile memory . if desired the data can be re - recorded more than twice . the purpose for this is that reinforcement by a second entry of the data into the nonvolatile memory insures that the nonvolatile memory adequately records the data . this is necessary because eeproms are reliable at ambient temperatures but at the high temperatures in a well bore the temperature limits are close to being reached . thus , the reinforcement permits successful operation of eeproms at higher temperatures . after recording the sampled data , the program determines if the data collected was the last sample of the last instruction to collect data . prior to the last instruction , the program sets the clock for the next &# 34 ; turn on &# 34 ; period and turns off the power . if the last sample of data instruction has been received or collected , the program determines if the last instruction has been completed , which turns the power off to the cpu . if the last data instruction has not been processed , the clock is set for the next operation and the power is turned off . in the operation of the foregoing system , the software starts each time the clock turns the power on with the first programed instruction . the programed instructions functions are a series of bytes with information in a fixed array , and one of the bytes is allocated as a marker to indicate whether an instruction is finished or not . when an instruction is finished , the marker byte is used to indicate that an instruction is complete . the program instructions can , for example , consist of 10 bytes each having 8 bits . one byte is left erased as a marker or flag and two bytes are left erased as a place to store an address which is the start data address for the next instruction . the rest of the bytes contain information as to what the instruction is supposed to do . the number of program instructions available can be 32 but not all of the program instructions need to be used . when the last instruction is completed , the equipment is disabled . prior to reaching the last instruction the program finds the next recording instruction and determines if the instruction is complete . the program searches the memory , upon completion of an instruction , for the next available memory . in the nonvolatile memory , it was found that eeproms did not reliably obtain a record of the data with a single recording at high temperatures . this is because eeproms are not identically responsive to input voltage levels so that data may not necessarily be impressed on the eeprom sufficiently to provide a read - out of the data . by re - recording the data at least once on the eeprom , the additive effect insures that the data is applied to the eeprom for a read - out . information concerning eeproms may be found in the &# 34 ; electronics &# 34 ; journal for june 30 , 1982 as &# 34 ; 5 volt - only ee - prom mimics static - ram timing &# 34 ; and in the &# 34 ; edn &# 34 ; journal for may 12 , 1983 as &# 34 ; understand your application in chosing novram , ee - prom &# 34 ;. by using nonvolatile memory , the entire processor can be turned off between sampling periods so that downhole power of the batteries is conserved and the test can be run for a longer period of time . referring now to fig3 the system for inputting and collecting data from the memories in the processing equipment is schematically illustrated . as shown in fig3 the tool cpu 18 is normally powered by a battery voltage received on line 28 via a blocking diode to a voltage regulator 33 which supplies a regulated voltage to the cpu 18 . to input or output data to the system , the sensor housing 12 is disconnected to provide access to the connector 30 . a data communication or interface circuit 31 is interconnected between the input / output circuit 21 and the cpu 18 . the data communication circuit 31 has a first voltage regulator 33 which applies constant operating voltage to the cpu 18 and as necessary to the other circuits . the constant voltage regulator 33 is supplied voltage via the connector 30 from an externally located voltage regulator 35 . the voltage regulator 35 is supplied from a source of voltage v r from a host cpu 37 . thus , the cpu 37 provides an operating voltage independent of the battery source . to place the tool cpu 18 in communication with the host cpu 37 , a voltage discriminator circuit 40 is coupled to i / o circuit 21 . the external voltage regulator 35 includes a switch means 41 which interconnects a voltage v r1 or vr 1 to the voltage regulator 35 . the switch means 41 is operated by the host cpu 37 to encode a binary voltage input code to the voltage regulator 35 which is detected by the voltage discriminator 40 in the tool . the voltages v r1 and v r2 are at a higher level than the battery voltage v r which functions to place the cpu 18 in a mode to receive or send date from the cpu 18 to the cpu 37 . the battery voltage 28 is not necessary for the operation . the binary voltage input code which is input by voltage pulses representing digital 0 and 1 by programs input into the cpu 37 and the program memory , the software instruction programs and the operating program are input to the tool cpu 18 . thus , the programs are placed in the tool in a non - volatile memory which will retain the programs independent of power to the cpu 18 . during the inputting of the programs , or at the completion of the input of the software , the host cpu 37 executes a verify step which directs the cpu 18 to play back the input programs to the host cpu 37 . this is accomplished by encoding the programs as a binary current code . the binary current code is obtained by a transistor circuit 42 in which the current is varied to provide the pulse code from the i / o circuit 21 . externally of the tool , a load resistor 44 detects the current changes ( which are in binary code ) and inputs the current code to the host computer 37 for a read - out of the program or verification of the data . the voltage code input is , of course , operated independently of the current code output . this is accomplished by a circuit 46 which separate voltage and current signals . the system thus provides a single communication path for inputting data by a voltage code and outputting data by a current code . after inputting the program instructions and operating instructions , the tool is ready for the surface test and subsequent collection of data downhole . after collecting the data , at the surface , the tool is again connected to the host cpu 37 , where the current code is used to output the collected data to the host cpu 37 for recording and analysis . it will be apparent to those skilled in the art that various changes may be made in the invention without departing from the spirit and scope thereof and therefore the invention is not limited by that which is enclosed in the drawings and specifications but only as indicated in the appended claims .