PicBasic Pro, PicBasic, BASIC Stamp, Microchip PIC, 8051, and Remote Control Projects

ADLog is an advanced analog data logging software application for monitoring and logging analog voltages. Features include display of voltages on an analog meter, strip chart, scrollable history buffer, user configurable High and Low alarm voltage triggers, sample count display, log event counter, LED indicators for high/low alarm status, automatic time and date stamp of each log event with alarm trigger voltage, automatically creates separate alarm log files for each day, and much more.


Download & test drive the demo version HERE

The demo version is the same as the full version, but with a limit of 100 sample counts. Example source code for the PicBasic Pro and CCS C compilers are available in the demo .zip file, and below. Please see the readme.txt file for instructions.


(on CD-ROM) Data Logging Analog Voltage Meter


Click For Larger View

Quantity:

Item: ADLog Analog Data Logging Software on CD-ROM
Price: $49.95 ea
Part Number: ADLOG-CD

Features:
bulletSupports 6 serial ports. Comm 1,2,3,4,5 and 6.
bulletUser configurable high and low voltage alarm thresholds.
bulletAutomatically creates individual daily log files with date/time stamp.
bulletLogs high and low alarm events with date, time, and voltage of each alarm event.
bulletDisplays voltage on strip chart and analog meter simultaneously with alarm thresholds.
bulletAllows scrolling through strip chart history with user configurable history buffer.
bulletCompatible with Windows 95/98/ME/XP.
bulletUpdates will be available for download free of charge.

(Download version) Data Logging Analog Voltage Meter


Click For Larger View

Item: ADLog Analog Data Logging Software (for download)
Price: $39.95 ea
Part Number: ADLOG

Features:
bulletSupports 6 serial ports. Comm 1,2,3,4,5 and 6.
bulletUser configurable high and low voltage alarm thresholds.
bulletAutomatically creates individual daily log files with date/time stamp.
bulletLogs high and low alarm events with date, time, and voltage of each alarm event.
bulletDisplays voltage on strip chart and analog meter simultaneously with alarm thresholds.
bulletAllows scrolling through strip chart history with user configurable history buffer.
bulletCompatible with Windows 95/98/ME/XP.
bulletUpdates will be available for download free of charge.

PicBasic Pro & CCS C Code Examples

PicBasic Pro Code: For PIC16F877A

DEFINE LOADER_USED 1
DEFINE OSC 20
DEFINE HSER_BAUD 9600
Quanta CON 1251 ' For 10-bit A/D +Vref = 5V : 5V/1023*256=1.251=Quanta
DEFINE ADC_BITS 10 ' Set number of bits in result
DEFINE ADC_CLOCK 3 ' Set clock source (3=rc)
DEFINE ADC_SAMPLEUS 50 ' Set sampling time in uS
ADval   VAR WORD ' Storage for A/D result

    TRISA = %11111111 ' Set PORTA to all input
    ADCON1.7 = 1 ' 10-bit A/D RA.3 = +Vref, Set PORTA analog and right justify result

loop:
    ADCIN 0,ADval ' Read A/D channel 0 to adval variable
    ADval = ADval */ Quanta
    HSEROUT [dec ADval dig 3,".",dec3 ADval,"~"]
    Pause 200 ' Wait period between updates
    Goto loop ' Do it forever
    End

CCS C Code: For PIC16F877A

/*

10-bit single-channel A/D code example for
PIC16F877A.

Reads 10-bit A/D on port RA0 and sends result
to PC ADLog data-logging application

*/

#include <16f877A.h>
#device adc=10
#use delay(clock=20000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7)

void init_adc();

void main()
{
    unsigned long ad0 = 0;
    float volts = 0;

    init_adc(); // Setup PortA, A/D clock, channel 0

    do {
         delay_ms(200); // delay
         ad0 = read_adc();
         volts = ad0 * (5.0/1023); // Convert 10-bit fp result
         printf("%1.3f~",volts);
         } while(TRUE);
}

void init_adc(void) // Setup channel-0 RA0 as A/D input
{
    setup_adc_ports(RA0_ANALOG);
    setup_adc(ADC_CLOCK_INTERNAL);
    set_adc_channel(0);
}

And here's a complete schematic with source code for a tiny 8-pin PIC12F683 configured to read a 0-5 V analog signal and send it to the ADLog software with 10-bit resolution.

Schematic:

PicBasic Pro Code:

    DEFINE OSC 8            ' We're using the internal oscillator set to 8MHz
    DEFINE DEBUG_REG GPIO   ' Define DEBUG port
    DEFINE DEBUG_BIT 1      ' Set GPIO.1 as DEBUG serial output pin
    DEFINE DEBUG_BAUD 9600  ' DEBUG baud rate = 9600 bps
    DEFINE DEBUG_MODE 1     ' 1 = inverted, 0 = true
    
    DEFINE ADC_BITS 10     ' Set to 10-bit resolution
    DEFINE ADC_CLOCK 5     ' Set clock source to Frc/16
    DEFINE ADC_SAMPLEUS 50 ' Set sampling time in uS
    Quanta CON 1251        ' For 10-bit A/D +Vref = 5V : 5V/1023*256=1.251=Quanta

' PIN# NAME     USE & CONNECTION
'  1   Vdd      +5VDC power supply
'  2   GPIO.5   N/C (N/C= NO CONNECTION)
'  3   GPIO.4   N/C
'  4   GPIO.3   N/C
'  5   GPIO.2   N/C
'  6   GPIO.1   Serial output pin to PC serial port RX pin
'  7   GPIO.0   A/D input pin
'  8   Vss      Power supply ground
'-------------------------------------------------------------------------

    ANSEL = %00110001  ' Set GPIO.0 to A/D, A/D clock = Frc
    CMCON0 = 7         ' Disable comparator
    ADCON0.7 = 1       ' Right justify for 10-bit
    TRISIO = %00000001 ' GP.1 = serial out, GPIO.0 = A/D in, rest outputs
    OSCCON = %01110000 ' Internal 8MHz osc
    ADval  VAR WORD    ' A/D conversion result

MAIN:
    ADCIN 0, ADval      ' Read all A/D
    ADval = ADval */ Quanta
    DEBUG DEC ADval DIG 3,".",DEC3 ADval,"~"
    PAUSE 200
    GOTO MAIN

    END

Copyright © 1999-2008 Reynolds Electronics

| Contact Information |