DESKTOP 386SX PC AS DAQ (Data AQuisitor)

 

I bougth a Macintosh Powerbook 160, I downloaded a freeware BASIC interpreter called Chipmunk Basic.

So I was l ooking for a way to use this nice powerbook as a signal ploting device.  Macs have two serial ports, one for a printer, another one for a modem.  They are RS422, meaning that they a have differential TxD and RxD.  Macs use MINI DIN 8-pin.

So to make a handshake cable between a MAC and a PC, this is how you must wire:

PC

Pin

Pin

MAC

TXD

3

5

RXD-

RXD

2

3

TXD-

RTS

7

2

CTS

CTS

8

1

DTR

DTR

4*

 

 

DSR

6*

 

 

GND

5

4

GND

*On the DB9 pins 4 and 6 must be connected between them.

Chipmunk BASIC  has lots off useful functions.  So I wrote a small BASIC file to read the serial port and then plot the value on screen (Avaliable upon request FREE).

Next I made a ISA-BUS interface using a ADC0804, 74LS138, and a 74LS245.

Circuit diagram

Address of  ISA card can be selected by conecting the desired jumper (H200-H2E0), 8 addresses ara avaliable.

The desktop 386SX PC has a 1.44 FD and a 40M HD, a VGA with 256k of VRAM.  BIOS was configure as no KERBOARD, so no keyboard is used.  No monitor is needed either, but graphics card must be plugged, or POST (power-on self test) will beep and halt.  MS-DOS 5.0 is installed , a simple AUTOEXEC.BAT and a program that reads address 220h to access the ADC0804 and then send the value thru COM1: 9600,1 stop bit, No parity, 8 data bits.  Using Turbo C BIOS services on INT14h to communitcate.

Here is the c code for the stand alone DAQ.

#include<stdio.h>

#include<bios.h>

#include<dos.h>                       

 

#define N 350

 

void parametros(void)

{

                union REGS regs;

 

                /*Inicia puerto 9600,N,1,8*/

 

                regs.h.ah=0x00;

                regs.x.dx=0;

                regs.h.al=0xE3;

                int86(0x14,&regs,&regs);

}

 

void serout(unsigned char b)

{

                union REGS regs;

 

                regs.h.ah=0x01;

                regs.x.dx=0;

                regs.h.al=b;

                int86(0x14,&regs,&regs);

 

}

 

unsigned char serin(void)

{

                union REGS regs;

                unsigned char b;

 

                regs.h.ah=0x02;

                regs.x.dx=0;

                int86(0x14,&regs,&regs);

                b=regs.h.al;

                return(b);

}

 

unsigned char status(void)

{

                union REGS regs;

                unsigned char b;

 

                regs.h.ah=0x03;

                regs.x.dx=0;

                int86(0x14,&regs,&regs);

                b=regs.h.ah;

                return(b);

}

 

 

void main(void)

{

 

                unsigned char v;

                parametros();

 

                do

                {

            v=inportb(0x220);

                               if(v==0x00) v=0x01;

                               if((inportb(0x200)&0x01)==0x01) serout(v);

                               if((inportb(0x200)&0x01)==0x00) serout(0x00);

                               delay(40);

 

                }

                while(1);

}

This is the ISA bus DAQ card.  You can built it for $7.  Circuit diagram will SOON be here, meanwhile you can request it by e-mail.

  8 bits ADC  ISA BUS CARD por Desktop PC

  Powerbook on top of desktop PC

 System on setup (using a differential OpAmp reading a K-Thermocuple)

  Serial communications setup tool on Powerbook

  System running (I had lighten a match and the TC reading went up.)

Back to index page.