
I) How to install the HP48ADC:

	1	Cut out the source you are finding below this description, and 
		transmit it to the HP48 using the serial-port.
	 	Note: It must be placed in the home-directory.
 	
	2	Go into the ADC directory and press ASN. If you have any USR-key at 
		keypossions 91.2 and 91.3, they will be erased. Sorry..
		Now you are ready for using the ADC software.

	3	To connect the ADC with the HP48, you will need to have/buy a 
		serial cable for the calculator. 
		Then connect the two things with the serial-cable, and connect the 
		ADC input with the object you want to log from.
		The ADC will automaticly start when the HP48 ask for a new set of 
		data. 
	
	4	In the DATA directory you will find 12 variables:
		
			SUMMADAT:	The data array.
			EQ:		The bestline equation.
			PPAR:		Plot parameters.
			SUMMAPAR:	Stat parameters.
			OFF:		An indicator for the status of the HP48, when an 
					log occoure.
			PATH:		The directory you were in just before a log 
					occoure.
			ALAR:		The alarm index of the log.
			TIME:		The time for the first log to occoure.
			SAMP:		Number of samples to log.
			NUMB:		The latest number of log.
			IOPAR:		IO parameters.
			FLAG:		You user defined flags.
		
			Note: None of these should be erased. If you, however, have 
			deleted them, you must press the ASN softkey again.
	
		
			

II) How to use the ADC software:

		Press the ADC softkey to enter the program. Here you will find 6 
		softkeys:
		
		| VOLT | DLOG | STOP | GET  | STAT | EXIT |

	
		| VOLT |	Choose this key to enter the continuous voltage-logger.
				To exit, press any key.
			
		| DLOG |	Under this softkey you will get 3 new softkeys:
			
				|  N   | TIME |      |      |      | START|
				
				|  N   |	Enter the numbers of data in the array.
				
				| TIME |	Enter the time betwen the the samples in 
						seconds.
			
				| START|	Start the data-logger.
			
				Note:	If you have set the log opsions to i.e N = 1440 
					and TIME = 1 minut, 
					the HP48 will use a lot of battery because it will 
					not be able to turn off between the samples.
					To avoid this you will have to turn off the 
					calculator using "USR OFF". To turn on the HP48 again,
					avoiding it will turn off when the next log 
					occoure, press "USR CONT".
				
					When START is pressed, you will get back to the 
					main menu.
					When the HP48 are logging it will give a low 
					frequence beep,
					and when it had finish the entire logging it will 
					give a high frequence beep.
				
					WARNING: When you hit DLOG, you will also delete 
					the latest data array.
					To avoid this: SAVE the array before starting a 
					new data-log.
				
		| STOP |	If You have set the numer to be large, and want to stop 
				the data-log, press this key.
		
		| GET  |	Pressing this key will get the latest log-data from the 
				array.
	
		| STAT |	Under this softkey you will find 6 new softkeys:
	
				| MIN  | MAX  | MEAN | BEST | PLOT | EXIT |
			
				| MIN  |	Get the 1st set of data in the array.
			
				| MAX  |	Get the latest set of data in the array.
			
				| MEAN |	Calculate the average of the data in the 
						array.
			
				| BEST |	Calculate the best line, that fits the data 
						in the array.
				
				| PLOT |	Plot the line and the data in the array. 
			
				| EXIT |	Exit to the main menu.
			
		| EXIT |	Exit the ADC program, and restore yours flags.


I'm at this very moment designing a data-logger/voltage-measurer for my HP48SX calculator. 
If you have any comments or idears, then please let me know. Under here You can see the 
specifications for the hardware:
 
KRAVSPEC:  
Resolution: 8-bit. 
Fsample: 800 Hz. 
Munber of modes: Two, Data-logging and voltage measuring. 
Vinput: 0 - 5 volt. 
Number of analog inputs: Two. 
Connection from/to the HP48: 9600BAUD/WIRE, 1-startbit, 8-databit, 2-stopbit. 
Time betwen last measuring and to turn the hardware off: 1 minute. 



If you likes this soft- and hard-ware, I would like to get an e- or just a 
snail-mail from you. My address is:

	Sren Bkhj Kjr
	Grnnegade 10, 1. Th.
	9000 Aalborg
	Denmark.
	
	Email: macdane@control.auc.dk
	http://www.control.auc.dk/~macdane/
	
Cut Here:
---------------------------
%%HP: T(3)A(R)F(.);

DIR

  DATA

    DIR

      \GSDAT

[[ 1 0 ]

 [ 2 0 ]]

      EQ '0+0*X'

      PPAR {

(1,-1.3) (2,1) X 0

(0,0) FUNCTION Y }

      \GSPAR { 1 2 0

0 LINFIT }

      off 0

      path { HOME

ADC DATA }

      alarm 6

      time 16384

      samples 2

      number 2

      IOPAR { 9600

0 0 0 3 3 }

      flags {

# 4038200050FF2h

# 0h }

    END

  asn

    \<< PATH DATA

'path1' STO UPDIR

      \<< HOME ADC

DATA 1 'off' STO

HOME OFF

      \>> 91.3 ASN

      \<< PATH HOME

ADC DATA 0 'off'

STO EVAL

      \>> 91.2 ASN

    \>>

  ADC

    \<< MEM DROP DATA

RCLF 'flags' STO {

9600 0 0 0 3 0 }

'IOPAR' STO -19 CF

-33 SF -35 CF -40

CF .1 STIME 2 FIX {

{ "VOLT"

      \<<

        DO 2 SRECV

DROP NUM 51 / \->STR

"_VOLT



PRESS KEY TO EXIT



"

+ 3 DISP

        UNTIL KEY

        END CLEAR

      \>> } { "DLOG"

      \<< DATA 0

'number' STO CL\GS {

{ "N"

        \<< 'samples'

STO

        \>> } {

"TIME"

        \<< UBASE

UVAL 8192 * 'time'

STO

        \>> } { } { }

{ } { "START"

        \<< DATE TIME

.0002 HMS+

          \<< PATH

HOME ADC DATA

'path' STO 'number'

INCR DUP "0" XMIT

DROP 1320 .1 BEEP 2

SRECV DROP NUM 51 /

\->V2 \GS+

            IF

samples \>=

            THEN

alarm DELALARM 1760

.1 BEEP 0 'off' STO

            END

            IF

'off' 1 ==

            THEN

OFF

            END

path EVAL DROP KILL

          \>> time {

} + + + + STOALARM

'alarm' STO UPDIR

ADC

        \>> } } TMENU

"ENTER INITDATA

AND PRESS START"

PROMPT

      \>> } { "STOP"

      \<< DATA alarm

DELALARM UPDIR ADC

      \>> } { "GET"

      \<< DATA '\GSDAT'

RCL UPDIR

      \>> } { "STAT"

      \<< DATA { {

"MIN" MIN\GS } {

"MAX" MAX\GS } {

"MEAN" MEAN } {

"BEST"

        \<< BESTFIT

\GSLINE

        \>> } {

"PLOT"

        \<< SCATRPLOT

'EQ' STO FUNCTION

DRAW GRAPH

        \>> } {

"EXIT"

        \<< UPDIR ADC

        \>> } } TMENU

      \>> } { "EXIT"

      \<< DATA

'flags' RCL STOF

HOME 2 MENU

"macdane@control.auc.dk"

3 DISP 2 WAIT KILL

      \>> } } TMENU

    \>>

END

---------------------------
