Datalogger

by Martin Clausen (mc AT rotgradpsi DOT de)

This is a datalogger with a SAB-C515 and 64k user RAM which is easily setup via RS232 and a PC.

Table of contents:

Features

System Requirements

8086, some RAM, about 106kb harddiskspace, serial port, DOS or Windows (see this note)

Usage

sampler [/h] [/slow] [/setup]

Parameter definition:

/hhelp
/slowforce slow mode, use if timing-code fails
/setupforce program to enter setup first


ucmm [/h]

Parameter definition:

/hhelp


Principle of Operation

Signal Inputs

Each input has a protection resistor, a resistor to ground and an amplifier. The protection resistor ensures that overvoltages do not destroy the input of the amplifier. In case that to all channels an overvoltage is applied, voltages up to approximately 50 volts are allowed. The pull down resistor guaranties always a defined input. The amplifiers reduces the impedance for the inputs of the MCU. Their output resistor prevents high currents flowing into the MCU when the amplifier drive their output above 5 volts or below ground.

Power Supply

The power supply generates three different voltages: +/- 8 volts and 5 volts. If rail-to-rail OP were used, the generation of 5 volts only would have been sufficent. Also the output resistors of the amplifiers could then be omitted. Single-supply OP can be used with 8 volts and 5 volts for the digital parts.

MCU Circuit

The SAB-C515 comes along with 3 timers, a boud rate generator, a 8 channel 8 bit ADC with range selection and many features more. But it lacks any program memory. Therefore an EPROM is added to the circuit. With the same bus as for the EPROM a 128K bytes SRAM is connected to the MCU. It can be accessed in two banks, because the linear address space of 8051 is limited to 64K bytes. One bank stores the measured data. The other bank saves only the configuration and is therefore mainly empty. If no power is applied to the circuit, the MAX690 takes care of the SRAMs power supply and by this way also of the stored data. The circuit is no low power design. I measured a consumption of 60mA.

Software

The MCU software as many jobs to do: Process commands from the RS232 interface, take care of of the measurement sequence and timing, check counters for overflow, update the display and respond to the button. The main program looks for flags set from the interrupt subprograms, new data on the serial port and the button. If the measurement flag is set, the measurement sub program will be called.
If a command is via RS232 received, all measurements are stopped and the command is processed. After this operation is compleatly finished the MCU returns to the main program and waits for further instructions.
Timer 0 and 1 are used for the measurement of pulses on the digital inputs. The timers are expanded by interrupt driven routines that register every overflow. Otherwise it could not be distinguished between 65536 and one pulse. Timer 2 is used to generate a clock rate of 10 Hz. This clock is feed via an interrupt into a 16 bit software counter. The software counter counts down and activates when ever it reaches zero the measurement subprogram and reloads the through the configuration given number.
The measurement subprogram reads the configuration data and execute the required measurement. First the voltage of all analog input channels is determined. Then timer 0 is stopped, read, reset and restarted. For timer 1 the same procedure follows.

Parts

Download of Program and Circuit

The part description in schematics is read as follows:
part type + value in exponential form + package description + subpart number in package
for example: C1040805,1 means Capacitor, 100nF, package SMD 0805, first subpart in package

Disclaimer: No warranty at all!
Copyright by Martin Clausen, Germany.
Contact the author: mc AT rotgradpsi DOT de
Impressum