[04 Feb 2007] reading the parallel port

Contains all messages from the Hollywood mailing list between 01/2006 and 08/2012
Locked
darrensamiga66

[04 Feb 2007] reading the parallel port

Post by darrensamiga66 »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Sun, 04 Feb 2007 18:44:09 -0000

I have been writing to the parallel port using hollywood and successfully controlled some motors and lamps with it.

I did this by opening PAR: with OpenFile and wrote to it using WriteInt in a loop. But i would like some feedback in the system so i know where the motor is.

If i was to set OpenFile with ReadWrite would i be able to turn on my motor (connected to D0) and read from a positional sensor (connected to D1) at the same time?

Is there anyone who knows about controlling stuff on the parallel port especially having inputs and outputs on the port at the same time?
User avatar
lazi
Posts: 646
Joined: Thu Feb 24, 2011 11:08 pm

[04 Feb 2007] Re: reading the parallel port

Post by lazi »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Sun, 04 Feb 2007 22:47:39 +0100

Hello darrensamiga66

It depends on the parallel port that you want to use. Is it a built in port of a classic Amiga hardware? I did made a program in the past that used direct access of the cia registers for such task. If you would like it to see the source, I will run a search.
darrensamiga66

[04 Feb 2007] Re: reading the parallel port

Post by darrensamiga66 »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Sun, 04 Feb 2007 23:20:10 -0000
It depends on the parallel port that you want to use. Is it a built in port of a classic Amiga hardware? I did made a program in the past that used direct access of the cia registers for such task. If you would like it to see the source, I will run a search.
oh sorry i should have said, it's an amigaone XE parallel port.

Did you have both inputs & outputs working with your program at the same time?

I wanted to do it in a system friendly way and with hollywood i wrote to the PAR: device and it worked fine. The problem is can i read a switch connected to the parallel port in a similar way?
darrensamiga66

[06 Mar 2007] Re: reading the parallel port

Post by darrensamiga66 »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Tue, 06 Mar 2007 23:56:29 -0000

I have been learning a bit more about the parallel port and how i can read inputs to it.

As far as i can understand there are three data registers which control the parallel port DATA(0x378), STATUS(0x379) and CONTROL(0x37a).

I have already got control of the DATA register through Hollywood by writing to PAR: but i want to read inputs aswell.

So after doing a bit of reading i found there are available inputs on the STATUS register (Busy, Paper empty, select).

Can anyone help me with some ideas of reading the STATUS register? Or maybe i should try posting this on amigaworld?

BTW all the information was about PC parallel ports and i assume it should be the same for amigaone parallel ports.
User avatar
airsoftsoftwair
Posts: 5832
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

[07 Mar 2007] Re: Re: reading the parallel port

Post by airsoftsoftwair »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Wed, 07 Mar 2007 13:36:29 +0100

Just as a side note: Hollywood 2.5 will allow you to switch all DOS functions to unbuffered I/O. With this feature you will be able to write to the parallel port also by using the WriteChr(), WriteInt(), WriteString() etc. commands. In Hollywood 2.0 all the DOS functions EXCEPT WriteMem() and ReadMem() always ran in buffered I/O mode which is not very usable for writing to PAR:. In Hollywood 2.5, it should be much easier to communicate with the PAR: device.
darrensamiga66

[07 Mar 2007] Re: reading the parallel port

Post by darrensamiga66 »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Wed, 07 Mar 2007 18:45:53 -0000
Just as a side note: Hollywood 2.5 will allow you to switch all DOS functions to unbuffered I/O. With this feature you will be able to write to the parallel port also by using the WriteChr(), WriteInt(), WriteString() etc. commands. In Hollywood 2.0 all the DOS functions EXCEPT WriteMem() and ReadMem() always ran in buffered I/O mode which is not very usable for writing to PAR:. In Hollywood 2.5, it should be much easier to communicate with the PAR: device.
I use WriteInt to write to the PAR: device with V2.0 does this mean it's not as fast as it could be?

And would this be the same with ReadInt aswell?
User avatar
airsoftsoftwair
Posts: 5832
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

[07 Mar 2007] Re: Re: reading the parallel port

Post by airsoftsoftwair »

Note: This is an archived post that was originally sent to the Hollywood mailing list on Wed, 07 Mar 2007 20:25:17 +0100
I use WriteInt to write to the PAR: device with V2.0 does this mean it's not as fast as it could be?

And would this be the same with ReadInt aswell?
I'm not sure. But my surmise is that unbuffered I/O is much better for PAR: because everything is passed directly to the filesystem and does not end up in temporary buffers.
Locked