Amiga.org
Amiga computer related discussion => Amiga Software Issues and Discussion => Topic started by: Tenacious on March 28, 2008, 01:35:53 AM
-
I mentioned here recently that I struggle with guilt about under-using some of the Amigas that I've "rescued". I think I would like to utilize some of them as data-loggers and controllers. Unfortunately, I'm not a programmer.
There are some good books about using parallel and serial ports for these purposes, usually specifically about the old IBM. The included software is always IBM stuff. (Yes, I'm aware that Amiga's parallel port is a superior, bi-directional design.)
Anyway, has anyone used Blitz Basic like this? Is there information to address the ports (game port, too).
I think I could find a reason to start programming for a project like this.
-
A lot of dataloggers just use USB drives...
-
@ Persia
That is hardly an answer.
-
@ Tenacious
What would you like to log?
There are some relatively simple projects for doing weather checking. You can do things like monitor door and window movement via switches. You can even be alerted via a motion detector with just on-off monitoring.
The fun comes in collecting the info and making it available in an intelligent way.
See http://oww.sourceforge.net/ for some ideas. I know nothing of Blitz Basic however. I use ARexx, c, and python.
Amiga's parallel port is not particularly superior to any other "modern" parallel port. It does have some peculiarities, too. For on-off work, anything will work: serial or parallel, no matter how primitive.
ggw
-
The hardware designes are much less of a challenge to me than is the software. Writing a program that displays "Hello world" is not too tough (grin), but how does one get information to and from the ports?
I have tinkered with Basic some over the years and have heard great things about Blitz. There must be some information somewhere detailing this. Perhaps the Rom Kernal Manuals? Are these still available? I believe there were some good reference books floating around specific to Amiga.
-
@gwyche:
I'm surprised you havent joined by now...
@Tenacious:
if you want to use your Amiga to log something, you're going to have to learn to code.
I have a datalogger from DataQ ...specifically:
http://www.dataq.com/products/startkit/di194rs.htm
and what I'm using it for is monitoring my wideband o2 sensor readings on my race car. I already have seperate hardware to do this but I wanted to see if I could do it myself. Oh but its on a PC not Amiga.. You can write something on the Amiga to do the same, you just have to look at the specs on the datalogger to see what format its coming in as and code accordingly. It (specs/diagram) provided when you buy that datalogger or you can just ask for it via email before you buy just in case you want to get a head start.
-Alex
-
Amigas make excellent controllers, even to this day, because of the fast interrupt response time and the ability to control execution priorities. CMB/Amiga came very close to tweaking the OS and marketing it as a hard real time system.
I have been, and continue, to use one at work since 1987 for a real time control application. The A1000 has long been replaced by an A4000, but the custom wirewrap Zorro boards plugged in are still chugging along. (Wirewrap boards only have a life expectency of 20 years due to the contact corrosion, so please don't tell them:)
I spent yesterday ay a conference for VxWorks, the US$20000 per CPU operating system that is more like US$50000 per computer by the time you get it running, and only now with current hardware are they getting the response thet I measured over 10 years ago on an A4000 :lol:
The Amiga OS is so deterministic and fast that it was used as a controller for a very time-critical device quite a while ago - the Video Toaster; maybe you have heard of it.
-
I didnt use it on the Amiga because its just too big and bulky. I prefer a mini-itx board sitting inside my car or smaller :) or a LM1/LMA3 combo.
-
Thanks to all for your enthusiastic replies.
I may not have formed my question very well, or, maybe the answer is so obvious to everyone else that you think I already know. I really am a newb at this and am looking for a documentation file, a book, etc, that I can study.
Does anyone have experience accessing the parallel, serial, and game ports from within a basic program? I want to move data into and out of these ports.
Thanks Again
-
read the AmigaBasic manual that came w/the Amiga 500 and get AmigaBASIC Inside & Out..
use google to search on how to access serial port.. sample here:
http://amiga.nvg.org/warlock/oldwartrans/source.txt
-
I have used HiSoft Basic to talk to a Radio TNC(modem) on the serial port with success.
I gave up with Amiga Basic as it was slow and clunky.
-
Tenacious wrote:
Does anyone have experience accessing the parallel, serial, and game ports from within a basic program? I want to move data into and out of these ports.
Thanks Again
You will probably not find much information of accessing Hardware from Basic programs.
It is possible as long as the basic can access the system API.
But using C as programming language is a lot better when it comes to Hardware access.
Here is a simple Example Program that opens the parallel.device and send a string of data to it.
#include <stdio.h>
#include <stdlib.h>
#include <proto/exec.h>
#include <devices/parallel.h>
int main(int argc, char *argv[])
{
struct IOExtPar * Parallelport;
struct MsgPort * ParallelMsgPort;
BYTE Returnvalue;
if(ParallelMsgPort = CreateMsgPort())
{
if(Parallelport = (struct IOExtPar *) CreateIORequest(ParallelMsgPort, sizeof(struct IOExtPar)))
{
Parallelport->io_ParFlags = PARF_SHARED;
}
else
{printf("CreateIORequest failed\n");}
}
else
{printf("CreateMsgPort failed\n");}
printf("Open Parallelport...\n");
Returnvalue = OpenDevice("parallel.device",0L,(struct IORequest *)Parallelport,0);
if(Returnvalue == 0)
{
printf("Opening Parallel Port successful\n");
}
else
{
printf("An Error accured.\n");
}
printf("Press any key to send Data...\n");
Parallelport->IOPar.io_Length = -1;
Parallelport->IOPar.io_Data = (APTR)"Parallel lines cross 7 times...";
Parallelport->IOPar.io_Command = CMD_WRITE;
DoIO((struct IORequest *)Parallelport);
printf("Any key to quit...\n");
getchar();
CloseDevice((struct IORequest *)Parallelport);
DeleteMsgPort(ParallelMsgPort);
DeleteIORequest((struct IORequest *)Parallelport);
printf("Any key to quit...\n");
getchar();
return Returnvalue;
}