Writting to parallel port on QNX 6.1

Hi!

Since we passed from QNX 6.0 to QNX 6.1 we are unable to write on the
parallel port in real-time using out8(). We are using the following
pseudo-code:

ThreadCtl(_NTO_TCTL_IO, 0) ;
mmap_device_io(1,0x378);
out8(0x378,0xff);
delay(2000);
out8(0x378,0x00);
delay(2000);
out8(0x378,0xff);
delay(2000);
out8(0x378,0x00);

We simply do not appear to have control on the parallel port’s output, it
always remains at the same value. The same code worked perfectly on
previous QNX versions. The same thing happenned with several PCs and we also
used a similar algorithm on QNX 4.25 with the same PCs to make sure it was
not a motherboard isssue. We also chacked that devc-par was up and running.

Thanks a lot.

Michel

“Michel Ouellet” <michel.ouellet@opal-rt.com> wrote in message
news:9v2gaf$17a$1@inn.qnx.com

Hi!

Since we passed from QNX 6.0 to QNX 6.1 we are unable to write on the
parallel port in real-time using out8(). We are using the following
pseudo-code:

ThreadCtl(_NTO_TCTL_IO, 0) ;
mmap_device_io(1,0x378);
out8(0x378,0xff);
delay(2000);
out8(0x378,0x00);
delay(2000);
out8(0x378,0xff);
delay(2000);
out8(0x378,0x00);

We simply do not appear to have control on the parallel port’s output, it
always remains at the same value. The same code worked perfectly on
previous QNX versions. The same thing happenned with several PCs and we
also
used a similar algorithm on QNX 4.25 with the same PCs to make sure it was
not a motherboard isssue.

We also chacked that devc-par was up and running.

That is probably the problem, devc-par should NOT be running.
Since you are handling the hardware yourself with out8() instruction
it could conflict with devc-par. In general that’s not a good idea
to have to driver handle the same hardware.

If you don’t do the initialisation of the hardware yourself
and rely on devc-par to do it that is also asking for trouble.


Thanks a lot.

Michel

Hi !
We had this problem and solved it by writing the value 0 to the control
register of the parallel port (0x37A) before writing to the data register.
You should use the line mmap_device_io(3,0x378); in order to access the
status and control register although it doesn’t seem to be required.

We used a test loop writing values from 0 to 255 to the port and a glitch
occured sometimes, just as if another process was accessing it. It also
occured when we wrote a stable value without refresh to the port . After
about 10 to 30 sec, the output changed. Did you ever faced this problem?

Fred & Martin

Michel Ouellet <michel.ouellet@opal-rt.com> a écrit dans le message :
9v2gaf$17a$1@inn.qnx.com

Hi!

Since we passed from QNX 6.0 to QNX 6.1 we are unable to write on the
parallel port in real-time using out8(). We are using the following
pseudo-code:

ThreadCtl(_NTO_TCTL_IO, 0) ;
mmap_device_io(1,0x378);
out8(0x378,0xff);
delay(2000);
out8(0x378,0x00);
delay(2000);
out8(0x378,0xff);
delay(2000);
out8(0x378,0x00);

We simply do not appear to have control on the parallel port’s output, it
always remains at the same value. The same code worked perfectly on
previous QNX versions. The same thing happenned with several PCs and we
also
used a similar algorithm on QNX 4.25 with the same PCs to make sure it was
not a motherboard isssue. We also chacked that devc-par was up and
running.

Thanks a lot.

Michel