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:
8086, some RAM, about 106kb harddiskspace, serial port, DOS or Windows (see this note)
sampler [/h] [/slow] [/setup]
- 8 analog channels, 8 bit, 16 ranges selectable
- 2 digital counter, 16 bit, up to 500 kHz count rate
- Sampling rate selectable from 0.1 seconds to over an hour
- Standalone and PC driven operation
- Prepared for unexpected powerdown during measurement
- 64K user RAM
- 1* 16 character LCD
- Programmable via RS232
- Data can be saved for further processing using a spreadsheet or any other program
- PC program is menu driven.
- Additional software for eight channel voltmeter with display on the PC's screen, including a bargraph and range selector for each channel.
- Communication protocol documentation
- Program is freeware for non-commercial use.
|/slow||force slow mode, use if timing-code fails
|/setup||force program to enter setup first
- If you start the program for the first time or changed your com port configuration, enter sampler /setup so you can check the configuration.
- The file "sampler.ini" is expected in the same directory.
- While the MCU receives data from one of its counters, this one is disabled for 7µs.
- All overflow counters themselves do not overflow.
- If the key is pressed during power up, the device will be reseted to the following configuration:
This action needs to be performed after assembly or when the 1F capacitor is discharged.
- 8 analog channels on, full range
- 2 digital counter on
- sampling rate 10 measurements per second
- all counters are set to zero
- During normal operation the key can be used to toggle between measurement mode and standby.
- The autostart flag is set and the datapointer is reset, when the MCU goes into measurement mode. When measurement is terminated the autostart flag is cleared and the datapointer position is saved in status ram at 0000H. If a power failure occurs during measurement, the MCU will reset the datapointer and start on its own again to collect new data, the old data is lost.
- Any action performed by the PC program on the MCU will stop the measurement.
- By sending commands via RS232 the PC can initiate any measurement at any time.
- The setup file of the control and setup program sampler.exe is used to define the port configuration.
- The file "sampler.ini" is expected in the same directory.
- At startup any measurement will be stopped.
- Use "1" to select 5 volts range, "q" to select 2.5 volts, "a" to select 1.25 volts
- To exit the program, press "x"
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.
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.
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.
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.
- 1 programmed 27C512 or even any EPROM down to the old 2716
- 1 8*128k static RAM
- 1 MAX232 or ADM232
- 1 MAX690 or ADM690
- 1 SAB-C515
- 1 74HC 14
- 1 74HC 573
- 2 1N 4151
- 1 78l05
- 1 78l08
- 1 ICL7660
- 1 TL064
- 2 33pF cer
- 14 100nF cer
- 6 10µF
- 1 100µF
- 1 1F
- 1 27
- 1 100
- 8 1k
- 10 27k
- 1 100k
- 10 470k
- 1 12MHz crystal
- 1 Sub-D socket, 9 pin
- 1 cable, Sub-D plug-plug, 9 pin
- 1 pbc
- 1 some thin wire
- 1 low voltage power connector
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