problem wirh parallel port, need help!

Hello anyone:

I want to do control with parellel port, but I have some problems to use it. I am new in QNX and so ask some questions.

  1. what is difference between
    devc-par -p 0x378 &
    and
    devc-par -p 0x3f8 &

the second one works but the first one not. parallel port address is 0x378, why does second one work?

  1. when I use parallel port to create square wave, my code is like
    out8(0x378, 0x00);
    sleep(sec);

    out8(0x378, 0xff);
    sleep([i]sec[/i]);
    

the scope always gets a 1sec half period even though the sec is changed to 0.1

what’s wrong here?

any answer is welcome.

thank you very much!

First, if you start devc-par you should NOT play with the parallel port yourself. Either you use services provided by devc-par or you deal with the parallel port yourself and don’t start devc-par. You cannot have two programs accessing the same hardware at the same time.

sleep unit are second so even if you use .1 you end up with 1 second (I would expect that if you pass .1 it gets truncated to 0 and I’m don’t remember how sleep behave is you pass 0 to it).

Use delay() instead which work in tick size. Also read the doc carefully, delay does not guaranty a minimum time…